不是很麻烦的lingo程序,望高手指点错误,只有语法也好
model:sets:
producer/1...7/:ability,price;
spot/1...15/:L,R,distance;
links(producer,spot):C,X;
endsets
data:
C=
200.3 188.3 178.6 103.6 43 23.6 3.1 21.2 74.2 113 143 165 176.2 193 212
255.3 243.3 235.2 197.7 137.1 117.7 97.2 76.2 129.2 168 198 220 231.2 248 267
275.3 263.3 255.2 217.7 157.1 137.7 117.2 96.2 49.2 88 118 140 151.2 168 187
331.3 319.3 311.2 273.7 213.1 193.7 173.2 152.2 105.2 72 66 86 95.2 112 131
336.3 24.3 316.2 278.7 218.1 198.7 178.2 157.2 110.2 63 33 55 76 105.2 124.2
364.3 352.3 344.2 306.7 246.1 226.7 206.2 185.2 138.2 105 83.2 61.2 40.2 11 36
376.3 364.3 356.2 318.7 258.1 238.7 218.2 197.2 150.2 117 95.2 73.2 52.2 29 4;
ability=800,800,1000,2000,2000,2000,3000;
price=150,155,155,160,155,155,165;
distance=0,120,301,750,606,194,205,210,680,480,300,220,210,420,500;
L(1)=0;
R(15)=0;
X=0
0
0
0
0
0
0;
enddata
min=@sum(links(i,j):price(i)*X(i,j)+C(i,j)*X(i,j)+0.1*((1+L(j))*L(j)+(1+R(j))*R(j))/2;
@for(spot(j): @sum(producer(i):X(i,j))=L(j)+R(j););
@for(spot(j): L(j+1)+R(j)=distance(j+1););
@for(producer(i): @sum(spot(j):X(i)(j))<=ability(i););
@for(producer(i): @sum(spot(j):X(i)(j))>=500;);
end 难道没有一个人可以解决吗?
转换成matlab也行啊 可以再试试看~~哈哈 X(i)(j)
这个表达式有问题 另外你的x赋值感觉比较奇怪 ??????????????????????
页:
[1]