Here are several comments and corrections.
1. You also need new unique_t1, unique_t2, and unique_box tables.
2. The num Is_BoxAvalable_for_a_lane parameter is declared and populated but not used in the optimization model.
3. The following IMPVAR declaration cannot be correct because it does not link i to b or w. In particular, you want only the i for which T2_ISN[i] = w.
impvar VolumeInsideBox_CFS {b in BOX, w in T2} = sum{i in ISN} Volume_ISN[i] * Proportion_CFS[b,w];
4. You do not need to sum over m here:
/* impvar PerBox_Based_Costs_CYS {i in ISN} = sum {b in BOX,m in {'CYS'}}*/
impvar PerBox_Based_Costs_CYS {i in ISN} = sum {b in BOX}
PerBox_Based_Rate[Org_ISN[i],Des_ISN[i],b,'CYS',T1_ISN[i],T2_ISN[i]] * BOXNeeded_CYS[i,b];
5. You do not need Proportion_CYS or Is_ISN_MOL here, and removing them avoids nonlinearity:
/* impvar VolBasedCost_CYS {i in ISN, b in BOX} = VolumeInsideBox_CYS[i,b] * Proportion_CYS[i,b] * */
/* sum {<Org_ISN[i],Des_ISN[i],m,T1_ISN[i],T2_ISN[i]> in PerVol_Based_Rate_NoZeroes} */
/* PerVol_Based_Rate[Org_ISN[i],Des_ISN[i],'CYS',T1_ISN[i],T2_ISN[i]] * Is_ISN_MOL[i,'CYS'];*/
impvar VolBasedCost_CYS {i in ISN, b in BOX} =
sum {<Org_ISN[i],Des_ISN[i],m,T1_ISN[i],T2_ISN[i]> in PerVol_Based_Rate_NoZeroes}
PerVol_Based_Rate[Org_ISN[i],Des_ISN[i],'CYS',T1_ISN[i],T2_ISN[i]] * VolumeInsideBox_CYS[i,b];
6. Similar comment here, but the VolumeInsideBox[b,w] variable doesn't depend on i, so I suspect you want a different coefficient:
/* impvar VolBasedCost_CFS {b in BOX, w in T2} = sum{i in ISN} VolumeInsideBox_CFS[b,w] * Proportion_CFS[b,w] * */
/* sum {<Org_ISN[i],Des_ISN[i],m,T1_ISN[i],T2_ISN[i]> in PerVol_Based_Rate_NoZeroes} */
/* PerVol_Based_Rate[Org_ISN[i],Des_ISN[i],'CFS',T1_ISN[i],T2_ISN[i]] * Is_ISN_MOL[i,'CFS'];*/
impvar VolBasedCost_CFS {b in BOX, w in T2} = sum{i in ISN}
sum {<Org_ISN[i],Des_ISN[i],m,T1_ISN[i],T2_ISN[i]> in PerVol_Based_Rate_NoZeroes}
PerVol_Based_Rate[Org_ISN[i],Des_ISN[i],'CFS',T1_ISN[i],T2_ISN[i]] * VolumeInsideBox_CFS[b,w];
7. You do not need both Proportion_CYS and Is_ISN_MOL here, but I don't know which one you want because in the toy example each shipment happened to use only one box.
impvar ShipmentBasedCost_CYS {i in ISN, b in BOX} = Proportion_CYS[i,b] *
sum {<Org_ISN[i],Des_ISN[i],m,T1_ISN[i],T2_ISN[i]> in PerShp_Based_Rate_NoZeroes}
PerShp_Based_Rate[Org_ISN[i],Des_ISN[i],'CYS',T1_ISN[i],T2_ISN[i]] * Is_ISN_MOL[i,'CYS'];
8. Similar comment to #3 and #7:
impvar ShipmentBasedCost_CFS {b in BOX, w in T2} = sum{i in ISN} Proportion_CFS[b,w] *
sum {<Org_ISN[i],Des_ISN[i],m,T1_ISN[i],T2_ISN[i]> in PerShp_Based_Rate_NoZeroes}
PerShp_Based_Rate[Org_ISN[i],Des_ISN[i],'CFS',T1_ISN[i],T2_ISN[i]] * Is_ISN_MOL[i,'CFS'];
9. Avoid nonlinearity:
con SumProportionToOne_CYS {i in ISN}:
/* sum {b in BOX} VolumeInsideBox_CYS[i,b]= sum {b in Box}Volume_ISN[i] * Proportion_CYS[i,b] * IS_ISN_MOL[i,'CYS'];*/
sum {b in BOX} Proportion_CYS[i,b] = IS_ISN_MOL[i,'CYS'];
con SumProportionToOne_CFS {w in T2}:
/* sum {b in BOX} VolumeInsideBox_CFS[b,w]= sum {i in ISN,b in Box}Volume_ISN[i] * Proportion_CFS[b,w] * IS_ISN_MOL[i,'CFS'];*/
sum {b in BOX} Proportion_CFS[b,w] = 1;
10. This constraint needs to hold for each b, not a sum over b:
/* con BoxConCFS {w in T2}:*/
/* sum {b in BOX} Volume_Capacity_CFS[b,w] * BOXNeeded_CFS[b,w] >= sum {b in BOX} TotalVol['CFS',w] * VolumeInsideBox_CFS[b,w];*/
con BoxConCFS {w in T2, b in BOX}:
Volume_Capacity_CFS[b,w] * BOXNeeded_CFS[b,w] >= VolumeInsideBox_CFS[b,w];
11. Both CREATE DATA statements refer to parameters that are not defined:
/* VolBasedCost=VolBasedCost[i] */
VolBasedCost=VolBasedCost_CYS[i,b]
/* VolBasedCost=VolBasedCost[i] */
VolBasedCost=VolBasedCost_CFS[b,w]
I recommend working these issues out with the toy data before attempting to solve with your full data.
... View more