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));!产量约束;

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/22 14:14:21
sets:supplyment/s1..s20/:supply;receiver/r1..r20/:demand;links(supplyment,receiver):cost,s;endsets!目

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));!产量约束;
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

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));!产量约束;
数据放到data段里面 括号要用半角的
另外给出错误提示