model:
sets:
part/1..7/:a;
equipment/1..5/;!k; !这里,你的k只是下标,不是集的元素,所以不能那样写;
time/1..6/;!t; !同上,t;
machine_hour(equipment,part):d;
machine(equipment,time):b;
pxt(time,part):c,v,x;
endsets
data:
a=100 60 80 40 110 90 30;
d=0.5 0.7 0 0 0.3 0.2 0.5
0.1 0.2 0 0.3 0 0.6 0
0.2 0 0.8 0 0 0 0.6
0.05 0.03 0 0.07 0.1 0 0.08
0 0 0.01 0 0.05 0 0.05;
b=3 4 4 4 3
4 2 2 2 1
1 2 3 1 3
3 3 2 1 1
0 1 1 1 1
1 1 1 1 0;
c=500 1000 300 300 800 200 100
600 500 200 0 400 300 150
300 600 0 0 500 400 100
200 300 400 500 200 0 100
0 100 500 100 1000 300 0
500 500 100 300 1100 500 60;
enddata
max=@sum(pxt(t,i):x(t,i)*a(i)-5*v(t,i))-@sum(part(i):a(i)*50);
@for(pxt(t,i):v(t,i)