lingo运输问题设有两个工厂A、B,产量都是10万个,工厂有三个仓库x,y,z,产品都先送到仓库.现有四个顾
1个回答

这里面transport1 2分别代表从工厂到仓库和从仓库到顾客的运输量

model:

sets:

factory/1,2/:output;

warehouse/1,2,3/;

customer/1..4/:demand;

link1(factory,warehouse):cost1,transport1;

link2(warehouse,customer):cost2,transport2;

endsets

data:

output=10 10;

demand=3 5 4 5;

cost1=

4 2 5

3 1 2;

cost2=

5 7 10 20

9 6 7 15

20 6 7 4;

enddata

min=@sum(link1:cost1*transport1)+@sum(link2:cost2*transport2);

@for(factory(i):@sum(warehouse(j):transport1(i,j))