Hello,
I am getting error 246 for the following model. I’ll be happy if you can help me.
Thank you.
OCT25MODEL.gms (4.44 KB)
Sets
*Dağıtım Yapılacak Bölgeler
n
/1*7/
*Aşı Öncelik Grubu
h
/1*3/
*Zaman Periyodu
t
/1*12/
*Araç Tipi
k
/1*4/;
Table D(n,h,t)
1 2 3 4 5 6 7 8 9 10 11 12
1.1 14323 14323 14323 14323 14323 14323 14323 14323 14323 14323 14323 14323
1.2 178148 178148 178148 178148 178148 178148 178148 178148 178148 178148 178148 178148
1.3 1460544 1460544 1460544 1460544 1460544 1460544 1460544 1460544 1460544 1460544 1460544 1460544
2.1 6578 6578 6578 6578 6578 6578 6578 6578 6578 6578 6578 6578
2.2 103656 103656 103656 103656 103656 103656 103656 103656 103656 103656 103656 103656
2.3 586558 586558 586558 586558 586558 586558 586558 586558 586558 586558 586558 586558
3.1 6497 6497 6497 6497 6497 6497 6497 6497 6497 6497 6497 6497
3.2 79319 79319 79319 79319 79319 79319 79319 79319 79319 79319 79319 79319
3.3 775430 775430 775430 775430 775430 775430 775430 775430 775430 775430 775430 775430
4.1 3907 3907 3907 3907 3907 3907 3907 3907 3907 3907 3907 3907
4.2 34528 34528 34528 34528 34528 34528 34528 34528 34528 34528 34528 34528
4.3 390708 390708 390708 390708 390708 390708 390708 390708 390708 390708 390708 390708
5.1 3702 3702 3702 3702 3702 3702 3702 3702 3702 3702 3702 3702
5.2 37629 37629 37629 37629 37629 37629 37629 37629 37629 37629 37629 37629
5.3 323310 323310 323310 323310 323310 323310 323310 323310 323310 323310 323310 323310
6.1 9392 9392 9392 9392 9392 9392 9392 9392 9392 9392 9392 9392
6.2 107708 107708 107708 107708 107708 107708 107708 107708 107708 107708 107708 107708
6.3 722839 722839 722839 722839 722839 722839 722839 722839 722839 722839 722839 722839
7.1 5382 5382 5382 5382 5382 5382 5382 5382 5382 5382 5382 5382
7.2 89545 89545 89545 89545 89545 89545 89545 89545 89545 89545 89545 89545
7.3 423106 423106 423106 423106 423106 423106 423106 423106 423106 423106 423106 423106
;
*Ana Depo Kapasitesi
Parameters CapWH;
CapWH=35000;
*Bölge Depo Kapasitesi
Parameters CapSH;
CapSH=7980;
*Araç Kapasitesi
Parameters CapC(k)
/1 1425,
2 2725,
3 4575,
4 7500/;
*Kapsama Oranı
Parameters R(h)
/1 0.03,
2 0.02,
3 0.02/;
Variables
TBH(n,h)
Con3(n,h,t)
DD(n,h,t)
Con1(n,h,t)
Con2(n,h,t)
InvWH(t)
InvSH(n,t)
C(n,k,t)
;
Positive Variables
z
TBH(n,h)
Con3(n,h,t)
DD(n,h,t)
Con1(n,h,t)
Con2(n,h,t)
InvWH(t)
InvSH(n,t)
C(n,k,t)
;
Equations
amac
k1(n)
k2(n)
k3(n)
k4(n)
k5(n)
k6(n)
k7(n)
k8(n)
k9(n)
k10(t)
k11(n)
k12(k)
k13(n,t)
k14(t)
k15(n,t)
k16(n,t)
k17(n,t)
k18(n,t)
;
amac.. z=e=sum((n,h), TBH(n,h));
k1(n).. sum ((h),TBH(n,h))=e=sum ((h,t), Con3(n,h,t));
k2(n).. sum((h,t)$(ord(t)=1), DD(n,h,t))=l=sum ((h,t)$(ord(t)=1), D(n,h,t)-Con1(n,h,t));
k3(n).. sum((h,t)$(ord(t)=2), DD(n,h,t))=l=sum ((h,t)$(ord(t)=2), DD(n,h,t)+Con1(n,h,t-1)-Con1(n,h,t)-Con2(n,h,t));
k4(n).. sum((h,t)$(ord(t)>2), DD(n,h,t))=l=sum ((h,t)$(ord(t)>2), DD(n,h,t)+Con1(n,h,t-1)+Con2(n,h,t-1)-Con1(n,h,t)-Con2(n,h,t)-Con3(n,h,t));
k5(n).. sum ((h,t), Con1(n,h,t))=l=sum ((h,t), D(n,h,t));
k6(n).. sum ((h,t)$(ord(t)=1), Con2(n,h,t))=l=0;
k7(n).. sum ((h,t)$(ord(t)>1), Con2(n,h,t))=l=sum ((h,t), Con1(n,h,t-1));
k8(n).. sum ((h,t)$(ord(t)=2), Con3(n,h,t))=l=0;
k9(n).. sum ((h,t)$(ord(t)>2), Con3(n,h,t))=l=sum ((h,t), Con2(n,h,t-1));
k10(t).. InvWH(t)=l=CapWH;
k11(n).. sum ((t), InvSH(n,t))=l=CapSH;
k12(k).. sum ((n,t), C(n,k,t))=l=CapC(k);
k13(n,t).. InvSH(n,t-1)+sum ((k),C(n,k,t))=l=CapSH;
k14(t)$(ord(t)>1).. InvWH(t)=l=InvWH(t-1)+CapWH-sum ((n,k),C(n,k,t));
k15(n,t)$(ord(t)>1).. InvSH(n,t)=l=InvSH(n,t-1)+sum ((k), C(n,k,t))-sum ((h), Con1(n,h,t));
k16(n,t)$(ord(t)=2).. InvSH(n,t)=l=InvSH(n,t-1)+sum ((k), C(n,k,t))-sum ((h), (Con1(n,h,t)+Con2(n,h,t)));
k17(n,t)$(ord(t)>2).. InvSH(n,t)=l=InvSH(n,t-1)+sum ((k), C(n,k,t))-sum ((h), (Con1(n,h,t)+Con2(n,h,t)+Con3(n,h,t)));
k18(n,t).. sum ((h),Con1(n,h,t)+Con2(n,h,t)+Con3(n,h,t))=l=sum ((h) D(n,h,t)*R(h));
Model OCT25MODEL /all/;
Solve OCT25MODEL using mip maximizing z;