求每一行的解释,尤其那个for循环.lingo关于最小运输费用的编程问题.求每一行的解释,尤其那个for循环.model:6 发点 8 收点运输问题; sets:warehouses/wh1..wh6/:capacity; vendors/v1..v8/:demand; links(warehouses,ven
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/05 15:33:14
求每一行的解释,尤其那个for循环.lingo关于最小运输费用的编程问题.求每一行的解释,尤其那个for循环.model:6 发点 8 收点运输问题; sets:warehouses/wh1..wh6/:capacity; vendors/v1..v8/:demand; links(warehouses,ven
求每一行的解释,尤其那个for循环.lingo关于最小运输费用的编程问题.
求每一行的解释,尤其那个for循环.
model:
6 发点 8 收点运输问题;
sets:
warehouses/wh1..wh6/:capacity;
vendors/v1..v8/:demand;
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))
求每一行的解释,尤其那个for循环.lingo关于最小运输费用的编程问题.求每一行的解释,尤其那个for循环.model:6 发点 8 收点运输问题; sets:warehouses/wh1..wh6/:capacity; vendors/v1..v8/:demand; links(warehouses,ven
!需求约束;
@for(vendors(J):
@sum(warehouses(I): volume(I,J))=demand(J));
首先先看里面的嵌套:@sum(warehouses(I): volume(I,J))=demand(J) 意思从1到i的产地分别运往接受地J的产量总和满足J的需求,外面的@for(vendors(J))是从1到J的意思.
!产量约束;
@for(warehouses(I):
@sum(vendors(J): volume(I,J))