lingo 循环语句中能不能使用if语句?程序是这样的:model:3个化肥厂4个需求地运输问题; sets:huafeichang/1..3/:chanliang,youhui;diqu/1..4/:xuqiu;links(huafeichang,diqu):yunfei,yunliang,danjia;endsets目标函数;min=@sum(links:dazhe*yunliang*danjia);需求约束;@for(diqu(J):@sum(huafeichang(I):yunliang(I,J))=xuqiu(J));产量约束;@for(huafeichang(I):@sum(diqu(J):yunliang(I,J))
问题描述:
lingo 循环语句中能不能使用if语句?
程序是这样的:
model:
3个化肥厂4个需求地运输问题;
sets:
huafeichang/1..3/:chanliang,youhui;
diqu/1..4/:xuqiu;
links(huafeichang,diqu):yunfei,yunliang,danjia;
endsets
目标函数;
min=@sum(links:dazhe*yunliang*danjia);
需求约束;
@for(diqu(J):
@sum(huafeichang(I):yunliang(I,J))=xuqiu(J));
产量约束;
@for(huafeichang(I):
@sum(diqu(J):yunliang(I,J))
答
理解不了你写的意思
最好自己找教程看@if怎么写的 @if不是集循环函数 你要搞清楚