model:
sets:
n1/1..4/:c,d,e;
n2/1..3/:a,b;
n3(n1,n2):x;
endsets
data:
a=10 16 8;
b=6800 8700 5300;
c=480 650 580 390;
d=3100 3800 3500 2850;
e=18 15 23 12;
enddata
max=d(i)*@sum(n2(j):x(i,j));
@for(n2(j):@sum(n1(i):x(i,j))<=a(j));
@for(n2(j):@sum(n1(i):c(i)*x(i,j))<=b(j));
@for(n1(i):@sum(n2(j):x(i,j))=e(i));
@for(n3(i,j):@gin(x(i,j))/a(j));
end
倒数第二行中@gin为@sum,打错了
lingo程序如下,提示161错误代码,求大神指点
答案:2 悬赏:70 手机版
解决时间 2021-03-09 16:26
- 提问者网友:棒棒糖
- 2021-03-08 17:27
最佳答案
- 五星知识达人网友:几近狂妄
- 2021-03-08 18:35
model:
sets:
n1/1..4/:c,d,e;
n2/1..3/:a,b;
n3(n1,n2):x;
endsets
data:
a=10 16 8;
b=6800 8700 5300;
c=480 650 580 390;
d=3100 3800 3500 2850;
e=18 15 23 12;
enddata
max=d(i)*@sum(n2(j):x(i,j));
@for(n2(j):@sum(n1(i):x(i,j))<=a(j));
@for(n2(j):@sum(n1(i):c(i)*x(i,j))<=b(j));
@for(n1(i):@sum(n2(j):x(i,j))=e(i));
@for(n3(i,j):@gin(x(i,j))/a(j));
end
sets:
n1/1..4/:c,d,e;
n2/1..3/:a,b;
n3(n1,n2):x;
endsets
data:
a=10 16 8;
b=6800 8700 5300;
c=480 650 580 390;
d=3100 3800 3500 2850;
e=18 15 23 12;
enddata
max=d(i)*@sum(n2(j):x(i,j));
@for(n2(j):@sum(n1(i):x(i,j))<=a(j));
@for(n2(j):@sum(n1(i):c(i)*x(i,j))<=b(j));
@for(n1(i):@sum(n2(j):x(i,j))=e(i));
@for(n3(i,j):@gin(x(i,j))/a(j));
end
全部回答
- 1楼网友:骨子里都是戏
- 2021-03-08 19:04
model: sets: shiduan/1..7/:t,need; xinghao/1..4/:num,minl,maxl,gcost,bcost,qcost; link(shiduan,xinghao):x,y,z; endsets data: t=6 3 3 2 4 4 2; need=12000 32000 25000 36000 25000 30000 18000; num=10 4 8 3; minl=750 1000 1200 1800; maxl=1750 1500 2000 3500; gcost=2250 1800 3750 4800; bcost=2.7 2.2 1.8 3.8; qcost=5000 1600 2400 1200; enddata min=s+q+r; s=@sum(link(i,j):x(i,j)*t(i)*gcost(j)); q=@sum(link(i,j):x(i,j)*bcost(j)*t(i)*(y(i,j)-minl(j))); !r=@sum(link(i,j):((@sign(x(i,j)-@if(i#eq#1,0,x(i-1,j)))+1)/2)*x(i,j)-@if(i#eq#1,0,x(i-1,j)))*qcost(j); !r=@sum(link(i,j):@if(link(i,j):x(i,j)#gt#x(i-1,j),x(i,j)-x(i-1,j)*qcost(j)),0); @for(shiduan(i):@sum(xinghao(j):x(i,j)*y(i,j))>=need(i)); @for(link(i,j):@gin(x(i,j))); @for(link(i,j):x(i,j)<=num(j)); @for(link(i,j):@bnd(minl(j),y(i,j),maxl(j))); end 问题出在注释掉的那句,但我不清楚你要做什么,所以没法改
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯