各位大哥请问一下~~~为什么 此题lingo跑出来
一直出现集合错误的问题阿
改不出来~~~是不是哪里错了呢??请问一下各位大哥~~
谢谢啰!!!
MODEL:
SETS:
time/1..5/;
vendor/1..2/;
factility/1..2/;
warehouse/1..2/;
customer/1..3/;
part/1..3/;
goods/1..1/;
tvp(time,vendor,part):ltvp,mcost,ltvp_upbound;
tvfp(time,vendor,factility,part):rtvfp,vf_tcost;
tfp(time,factility,part):ltfp,fm_icost;
gp(goods,part):bom;
tfg(time,factility,goods):rtfg,pcost,rtfg_upbound,ltfg,fg_icost;
tfwg(time,factility,warehouse,goods):rtfwg,fw_tcost;
twg(time,warehouse,goods):ltwg,w_icost,ltwg_upbound;
twcg(time,warehouse,customer,goods):rtwcg,wc_tcost;
tcg(time,customer,goods):ltcg;
fg(factility,goods):tbomfg;
vf(vendor,factility):tvf;
fw(factility,warehouse):tfw;
wc(warehouse,customer):twc;
ENDSETS
data:
mcost = 10.5 6.5 8.5 20.5 7.5 7.5
10.4 6.4 8.4 20.4 7.4 7.4
10.3 6.3 8.3 20.3 7.3 7.3
10.2 6.2 8.2 20.2 7.2 7.2
10.1 6.1 8.1 20.1 7.1 7.1;
pcost = 0.4 0.45
0.4 0.45
0.4 0.45
0.4 0.45
0.4 0.45;
vf_tcost = 0.01 0.01 0.01 0.01 0.01 0.01
0.01 0.01 0.01 0.01 0.01 0.01
0.01 0.01 0.01 0.01 0.01 0.01
0.01 0.01 0.01 0.01 0.01 0.01
0.01 0.01 0.01 0.01 0.01 0.01
0.01 0.01 0.01 0.01 0.01 0.01
0.01 0.01 0.01 0.01 0.01 0.01
0.01 0.01 0.01 0.01 0.01 0.01
0.01 0.01 0.01 0.01 0.01 0.01
0.01 0.01 0.01 0.01 0.01 0.01;
fw_tcost = 0.2 0.3 0.5 0.1
0.2 0.3 0.5 0.1
0.2 0.3 0.5 0.1
0.2 0.3 0.5 0.1
0.2 0.3 0.5 0.1 ;
wc_tcost = 0.6 0.4 0.3 0.3 0.5 0.4
0.6 0.4 0.3 0.3 0.5 0.4
0.6 0.4 0.3 0.3 0.5 0.4
0.6 0.4 0.3 0.3 0.5 0.4
0.6 0.4 0.3 0.3 0.5 0.4;
fm_icost = 0.02 0.02 0.02 0.01 0.01 0.01
0.02 0.02 0.02 0.01 0.01 0.01
0.02 0.02 0.02 0.01 0.01 0.01
0.02 0.02 0.02 0.01 0.01 0.01
0.02 0.02 0.02 0.01 0.01 0.01;
fg_icost = 0.1 0.09
0.1 0.09
0.1 0.09
0.1 0.09
0.1 0.09;
w_icost = 0.07 0.05
0.07 0.05
0.07 0.05
0.07 0.05
0.07 0.05;
ltvp_upbound = 500 500 500 500 500 500
500 500 500 500 500 500
500 500 500 500 500 500
500 500 500 500 500 500
500 500 500 500 500 500;
rtfg_upbound = 70 35
70 35
70 35
70 35
70 35;
ltwg_upbound = 400 500
400 500
400 500
400 500
400 500;
bom = 1 2 3;
ltcg = 0 0 0
0 0 0
0 0 0
30 20 10
55 40 50;
tbomfg = 1 1;
tvf = 1 1
1 1;
tfw = 1 1
1 1;
twc = 1 1 1
1 1 1;
enddata
min = @sum(tvp(t,v,p):ltvp(t,v,p)*mcost(t,v,p)) +
@sum(tvfp(t,v,f,p):rtvfp(t,v,f,p) * vf_tcost(t,v,f,p))+
@sum(tfp(t,f,p):ltfp(t,f,p) * fm_icost(t,f,p))+
@sum(tfg(t,f,g):rtfg(t,f,g) * pcost(t,f,g))+
@sum(tfg(t,f,g):ltfg(t,f,g) * fg_icost(t,f,g))+
@sum(tfwg(t,f,w,g):rtfwg(t,f,w,g) * fw_tcost(t,f,w,g))+
@sum(twg(t,w,g):ltwg(t,w,g) * w_icost(t,w,g))+
@sum(twcg(t,w,c,g):rtwcg(t,w,c,g) * wc_tcost(t,w,c,g));
np = @size(time);
@for(tfg: @gin(rtfg);
@for(tvfp: @gin(rtvfp));
@for(tfwg: @gin(rtfwg));
@for(twcg: @gin(rtwcg));
@for(tvp: @gin(ltvp));
@for(tfp: @gin(ltfp));
@for(tfg: @gin(ltfg));
@for(twg: @gin(ltwg));
ltfp(1,1,1)= 200;
ltfp(1,1,2)= 300;
ltfp(1,1,3)= 300;
ltfp(1,2,1)= 100;
ltfp(1,2,2)= 100;
ltfp(1,2,3)= 100;
ltfg(1,1,1)=0;
ltfg(1,2,1)=0;
ltwg(1,1,1)=0;
ltwg(1,2,1)=0;
@for(tvp: ltvp<=ltvp_ubound);
@for(tfg: rtfg <= rtfg_ubound);
@for(twg: ltwg<=ltwg_ubound);
@for(tvp(t,v,p)sum(factility(f): rtvfp(t,v,f,p))= ltvp(t,v,p));
@for(tfp(t,f,p)|t#le# tvf(v,f) : ltfp(t,f,p)-@sum(gp(g,p): bom(g,p)*rtfg(t,f,g)) = ltfp(t+1,f,p));
@for(tfp(t,f,p)|(t #lt#np) #and# (t #gt# tvf(v,f)): ltfp(t,f,p)
+ @sum(vendor(v)|t #gt# tvf(v,f): rtvfp(t-tvf(v,f),v,f,p))
[email=-@sum(gp(g,p):bom(g,p]-@sum(gp(g,p):bom(g,p[/email]) * rtfg(t,f,g)) = ltfp(t+1,f,p));
@for(tfg(t,f,g)|t #le# tbomfg(f,g) : ltfg(t,f,g)
- @sum(warehouse(w): rtfwg(t,f,w,g)) = ltfg(t+1,f,g));
@for(tfg(t,f,g)|(t #lt#np) #and#(t #gt# tbomfg(f,g)) : ltfg(t,f,g)+rtfg(t-tbomfg(f,g),f,g) - @sum(warehouse(w) : rtfwg(t,f,w,g)) = ltfg(t+1,f,g));
@for(twg(t,w,g)|t #le# tfw(f,w) : ltwg(t,w,g) - @sum(customer(c):rtwcg(t,w,c,g)) = ltwg(t+1 ,w,g) );
@for(twg(t,w,g)|
(t #lt#np) #and# (t #gt# tfw(f,w)) : ltwg(t,w,g)
+ @sum(factility(f)|t #gt# fw(f,w) : rtfwg(t-tfw(f,w),f,w,g))
- @sum(customer(c):rtwcg(t,w,c,g)) = ltwg(t+1,w,g));
@for(tcg(t,c,g)|t #gt# twc(w,c) :
@sum(warehouse(w)|t #gt# twc(w,c) : rtwcg(t-twc(w,c),w,c,g))
= ltcg(t,c,g) );
END |