model:
sets:
aa/1..15/;
ss/1..7/:s;
cost(ss,aa):c,x;
pp/1..7/:p;
yy/1..14/:y;
ll/1..14/:l;
tt/1..7/:t;
endsets
data:
c=
264.3 160.3 140.2 98.6 38 20.5 3.1 21.2 64.2 92 96 105 121.2 128 142
309.3 205.3 100.2 171.6 111 95.5 86 71.2 114.2 142 146 156 171.2 178 192
324.3 220.3 200.2 181.6 121 105.5 96 86.2 48.2 82 86 96 111.2 118 132
354.3 250.3 235.2 216.6 156 140.5 131 116.2 84.2 62 51 61 76.2 83 97
349.3 245.3 225.2 206.6 146 130.5 121 111.2 79.2 57 33 51 71.2 73 87
359.3 255.3 235.2 216.6 156 140.5 131 121.2 84.2 62 51 45 26.2 11 28
369.3 265.3 245.2 226.6 166 150.5 141 131.2 99.2 77 66 56 38.2 26 2;
p=160 155 155 160 155 150 160;
l=104 301 750 606 194 205 201 680 480 300 220 210 420 500;
s=800 800 1000 2000 2000 2000 3000;
enddata
min=@sum(cost(i,j)p(i)+c(i,j))*x(i,j))+@sum(yy(i)(y(i)^2+y(i))+(l(i)-y(i))*(l(i)-y(i)+1))*0.05);
@for(ss(i)for(aa(j)gin(x(i,j))));
!@for(ss(i)for(yy(j)|2#le#j:@sum(cost(i,j):x(i,j))=y(j)+l(j-1)-y(j-1)));
@sum(cost(i,j):x(i,j))=5171;
@sum(ss(i):x(i,15))=l(14)-y(14);
@for(yy(i)|2#le#i:@sum(ss(j):x(j,i))=y(i)+l(i-1)-y(i-1));
@for(yy(i)|2#le#i:y(i)<=l(i));
@for(yy(i)|2#le#i:y(i)>=0);
@for(ss(i):@for(aa(j):x(i,j)>=0));
y(1)=0;
@for(ss(i):@sum(aa(j):x(i,j)*@sum(aa(j):x(i,j)-500))>=0);
@for(ss(i):@sum(aa(j):x(i,j))<=s(i));
!@for(tt:@bin(t));
!@for(ss(i):500*t(i)<=@sum(aa(j):x(i,j)));
!@for(ss(i):@sum(aa(j):x(i,j))<=s(i)*t(i));
end
|