作业帮 > 综合 > 作业

lingo程序求解啊model:sets:warehouses/wh1..wh2/: capacity;vendors/

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/11 10:27:39
lingo程序求解啊
model:
sets:
warehouses/wh1..wh2/: capacity;
vendors/v1..v6/: demand;
axin/a1..a2/:a;
bxin/b1..b2/:b;
xgong/x1..x6/:x;
ygond/y1..y6/:y;
links(warehouses,vendors): length, m;
endsets
min=@sum(links: length*m);
@for(vendors(J):
@sum(warehouses(I): m(I,J))>=demand(J));
@for(warehouses(I):
@sum(vendors(J): m(I,J))
lingo程序求解啊model:sets:warehouses/wh1..wh2/: capacity;vendors/
这样写才对
model:
sets:
warehouses/wh1..wh2/: capacity;
vendors/v1..v6/: demand;
axin/a1..a2/:a;
bxin/b1..b2/:b;
xgong/x1..x6/:x;
ygond/y1..y6/:y;
links(warehouses,vendors): length, m;
endsets
data:
x=1.25 8.75 0.5 5.75 3 7.25;
y=1.25 0.75 4.75 5 6.5 7.25;
capacity=20 20;
demand=3 5 4 7 6 11;
enddata
@for(links(i,j):length(i,j)=@sqrt((x(j)-a(i))^2+(y(j)-b(i))^2));
min=@sum(links: length*m);
@for(vendors(J):
@sum(warehouses(I): m(I,J))>=demand(J));
@for(warehouses(I):
@sum(vendors(J): m(I,J))