MODEL:
SETS:
QUARTERS/1,2,3,4/:DEM,RP,OP,INV;
ENDSETS
MIN=@sum{QUARTERS:400*RP(i)+450*OP+20*INV};
@FOR{QUARTERS{I}:RP{I}<40};
@FOR{QUARTERS{I}|I#GT#1:
INV{I}=INV{I-1}+RP{I}+OP{I}-DEM{I};};
INV{1}=10+RP{1}+OP{1}-DEM{1};
DATA:
DEM=40,60,75,25;
ENDDATA
END
帮我看看这段lingo代码,我不明白为什么一直出现error code11的错误
答案:2 悬赏:0 手机版
解决时间 2021-03-15 06:28
- 提问者网友:暮烟疏雨之际
- 2021-03-14 18:05
最佳答案
- 五星知识达人网友:醉吻情书
- 2021-03-14 19:44
是圆括号()不是花括号{}
MODEL:
SETS:
QUARTERS/1,2,3,4/:DEM,RP,OP,INV;
ENDSETS
MIN=@sum(QUARTERS:400*RP+450*OP+20*INV);
@FOR(QUARTERS(I):RP(I)<40);
@FOR(QUARTERS(I)|I#GT#1:
INV(I)=INV(I-1)+RP(I)+OP(I)-DEM(I));
INV(1)=10+RP(1)+OP(1)-DEM(1);
DATA:
DEM=40,60,75,25;
ENDDATA
END
MODEL:
SETS:
QUARTERS/1,2,3,4/:DEM,RP,OP,INV;
ENDSETS
MIN=@sum(QUARTERS:400*RP+450*OP+20*INV);
@FOR(QUARTERS(I):RP(I)<40);
@FOR(QUARTERS(I)|I#GT#1:
INV(I)=INV(I-1)+RP(I)+OP(I)-DEM(I));
INV(1)=10+RP(1)+OP(1)-DEM(1);
DATA:
DEM=40,60,75,25;
ENDDATA
END
全部回答
- 1楼网友:神也偏爱
- 2021-03-14 19:55
没有问题,可以运行出来,运行结果 :
linearization components added:
constraints: 20
variables: 5
global optimal solution found.
objective value: 29.83636
objective bound: 29.83636
infeasibilities: 0.000000
extended solver steps: 0
total solver iterations: 17
model class: milp
total variables: 15
nonlinear variables: 0
integer variables: 5
total constraints: 25
nonlinear constraints: 0
total nonzeros: 73
nonlinear nonzeros: 0
variable value reduced cost
x1 218.1818 0.000000
y1 1.000000 4300.000
x2 0.000000 0.5718182e-01
y2 0.000000 -2700.000
x3 736.3636 0.000000
y3 1.000000 2500.000
x4 0.000000 0.2263636e-01
y4 0.000000 -2200.000
x5 45.45455 0.000000
y5 1.000000 4500.000
row slack or surplus dual price
1 29.83636 1.000000
2 336.3636 0.000000
3 0.000000 0.2983636e-01
4 0.000000 0.6181818e-03
5 0.000000 0.2363636e-02
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯