lingo中不是可以取消变量的非负限制吗,为什么老是出错啊Model:Title Location Problem;sets:demand/1..6/:a,b,d;supply/1..2/:x,y,e;link(demand,supply):c;endsetsdata:a=1.25,8.75,0.5,5.75,3,7.25;b=1.25,0.75,4.75,5,6.5,7.75;d=3,5,4,7,6,1
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/05 11:45:58
![lingo中不是可以取消变量的非负限制吗,为什么老是出错啊Model:Title Location Problem;sets:demand/1..6/:a,b,d;supply/1..2/:x,y,e;link(demand,supply):c;endsetsdata:a=1.25,8.75,0.5,5.75,3,7.25;b=1.25,0.75,4.75,5,6.5,7.75;d=3,5,4,7,6,1](/uploads/image/z/6077604-12-4.jpg?t=lingo%E4%B8%AD%E4%B8%8D%E6%98%AF%E5%8F%AF%E4%BB%A5%E5%8F%96%E6%B6%88%E5%8F%98%E9%87%8F%E7%9A%84%E9%9D%9E%E8%B4%9F%E9%99%90%E5%88%B6%E5%90%97%2C%E4%B8%BA%E4%BB%80%E4%B9%88%E8%80%81%E6%98%AF%E5%87%BA%E9%94%99%E5%95%8AModel%3ATitle+Location+Problem%3Bsets%3Ademand%2F1..6%2F%3Aa%2Cb%2Cd%3Bsupply%2F1..2%2F%3Ax%2Cy%2Ce%3Blink%28demand%2Csupply%29%3Ac%3Bendsetsdata%3Aa%3D1.25%2C8.75%2C0.5%2C5.75%2C3%2C7.25%3Bb%3D1.25%2C0.75%2C4.75%2C5%2C6.5%2C7.75%3Bd%3D3%2C5%2C4%2C7%2C6%2C1)
lingo中不是可以取消变量的非负限制吗,为什么老是出错啊Model:Title Location Problem;sets:demand/1..6/:a,b,d;supply/1..2/:x,y,e;link(demand,supply):c;endsetsdata:a=1.25,8.75,0.5,5.75,3,7.25;b=1.25,0.75,4.75,5,6.5,7.75;d=3,5,4,7,6,1
lingo中不是可以取消变量的非负限制吗,为什么老是出错啊
Model:
Title Location Problem;
sets:
demand/1..6/:a,b,d;
supply/1..2/:x,y,e;
link(demand,supply):c;
endsets
data:
a=1.25,8.75,0.5,5.75,3,7.25;
b=1.25,0.75,4.75,5,6.5,7.75;
d=3,5,4,7,6,11;
e=20,20;
enddata
init:
x,y=5,1,2,7;
endinit
[OBJ] min=@sum(link(i,j):c(i,j)*((x(j)-a(i))^2+(y(j)-b(i))^2)^(1/2));
@for(demand(i):[DEMAND_CON] @sum(supply(j):c(i,j))=d(i););
@for(supply(i):[SUPPLY_CON] @sum(demand(j):c(j,i))
lingo中不是可以取消变量的非负限制吗,为什么老是出错啊Model:Title Location Problem;sets:demand/1..6/:a,b,d;supply/1..2/:x,y,e;link(demand,supply):c;endsetsdata:a=1.25,8.75,0.5,5.75,3,7.25;b=1.25,0.75,4.75,5,6.5,7.75;d=3,5,4,7,6,1
是可以的 但是你把;写成:了
这样就行了
Model:
Title Location Problem;
sets:
demand/1..6/:a,b,d;
supply/1..2/:x,y,e;
link(demand,supply):c;
endsets
data:
a=1.25,8.75,0.5,5.75,3,7.25;
b=1.25,0.75,4.75,5,6.5,7.75;
d=3,5,4,7,6,11;
e=20,20;
enddata
init:
x,y=5,1,2,7;
endinit
[OBJ] min=@sum(link(i,j):c(i,j)*((x(j)-a(i))^2+(y(j)-b(i))^2)^(1/2));
@for(demand(i):[DEMAND_CON] @sum(supply(j):c(i,j))=d(i););
@for(supply(i):[SUPPLY_CON] @sum(demand(j):c(j,i))