lingo model:6发点8收点的运输问题sets:vendors/v1..v8/demand;warehouses/wh1..wh6/:capacity; links(warehouses,vendors):cost,volume;endsets目标函数min=@sum(links:cost*volume);需求约束@for(vendors(J):@sum(warehouses(I):volume(I,J)=demand(
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/22 12:13:24
lingo model:6发点8收点的运输问题sets:vendors/v1..v8/demand;warehouses/wh1..wh6/:capacity; links(warehouses,vendors):cost,volume;endsets目标函数min=@sum(links:cost*volume);需求约束@for(vendors(J):@sum(warehouses(I):volume(I,J)=demand(
lingo
model:
6发点8收点的运输问题
sets:
vendors/v1..v8/demand;
warehouses/wh1..wh6/:capacity;
links(warehouses,vendors):cost,volume;
endsets
目标函数
min=@sum(links:cost*volume);
需求约束
@for(vendors(J):
@sum(warehouses(I):volume(I,J)=demand(J));
产量约束
@for(wavehouses(I):
@sum(vendors(J):volume(I,J))
lingo model:6发点8收点的运输问题sets:vendors/v1..v8/demand;warehouses/wh1..wh6/:capacity; links(warehouses,vendors):cost,volume;endsets目标函数min=@sum(links:cost*volume);需求约束@for(vendors(J):@sum(warehouses(I):volume(I,J)=demand(
以下几个问题:
1、你用叹号进行标注的时候后面要加分号,而且叹号要用英文输入法的格式;
2、注意一些小错误吧,warehouses写成了wavehouses.还有一些其他错误
3、第一个for函数里面少了几半括号,可以跟我的对比一下
4、enddata之前少了个分号
model:
!6发点8收点的运输问题;
sets:
vendors/v1..v8/:demand;
warehouses/wh1..wh6/:capacity;
links(warehouses,vendors):cost,volume;
endsets
!目标函数;
min=@sum(links:cost*volume);
!需求约束;
@for(vendors(J):
@sum(warehouses(I):volume(I,J))=demand(J));
!产量约束;
@for(warehouses(I):
@sum(vendors(J):volume(I,J))