sets: supplyment/s1..s20/: supply;&nbs
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/16 20:00:07
sets:
supplyment/s1..s20/: supply;
receiver/r1..r20/: demand;
links(supplyment ,receiver): cost, s;
endsets
!目标函数;
min=@sum(links: cost*s);
!需求约束;
@for(receiver(J):
@sum(supplyment(I): volume(I,J))<=demand(J));
!产量约束;
@for(supplyment(I):
@sum(receiver(J): volume(I,J))=supply(I));
s(I,J)=@if(volume(I,J)#ne#0,1,0)
supply= 0 \x051 \x050 \x052 \x050 \x050\x050\x059\x053\x058\x050\x050\x050\x050\x050\x050\x050\x050\x050\x057
;
demand=0 0 8 \x050 \x059 \x053\x057\x050\x050\x050\x052\x056\x053\x052\x054\x056\x0510\x059\x054\x050
;
cost=
.
enddata
end
supplyment/s1..s20/: supply;
receiver/r1..r20/: demand;
links(supplyment ,receiver): cost, s;
endsets
!目标函数;
min=@sum(links: cost*s);
!需求约束;
@for(receiver(J):
@sum(supplyment(I): volume(I,J))<=demand(J));
!产量约束;
@for(supplyment(I):
@sum(receiver(J): volume(I,J))=supply(I));
s(I,J)=@if(volume(I,J)#ne#0,1,0)
supply= 0 \x051 \x050 \x052 \x050 \x050\x050\x059\x053\x058\x050\x050\x050\x050\x050\x050\x050\x050\x050\x057
;
demand=0 0 8 \x050 \x059 \x053\x057\x050\x050\x050\x052\x056\x053\x052\x054\x056\x0510\x059\x054\x050
;
cost=
.
enddata
end
数据放到data段里面 括号要用半角的
另外给出错误提示
另外给出错误提示