To just clarify SHA-SEA-LCL - Is_BoxAvalable_for_a_lane=1 for this combo.
But SHA-SEA-LCL - there is no Rate at all (not even 0).
Because the variable BoxesNeeded[SHA_SEA_722,LCL] appears in the constraints but not the objective, it can be used "for free" without increasing the TotalCost, and the solver exploits that situation.
Hi Rob
Aah. Got it. I tried to fix it by doing the below code.
set <str,str,str> PerVol_Based_Rate_NoZeroes;
num PerVol_Based_Rate {PerVol_Based_Rate_NoZeroes};
read data CASUSER.BOXRATE (where=(RateBasis="PerVolUOM" and Ratetype='Linehaul' and Rate>0))
into PerVol_Based_Rate_NoZeroes=[ORG DES BOX] PerVol_Based_Rate=Rate;
impvar PerVol_Based_Costs = sum {i in ISN, b in BOX: <Org_ISN[i],Des_ISN[i],b> in PerVol_Based_Rate_NoZeroes}
PerVol_Based_Rate[Org_ISN[i],Des_ISN[i],b] * Vol_ISN[i]*BoxesNeeded[i,b];
Min TotalCost = PerBox_Based_Costs + PerVol_Based_Costs;
Basically, how I want the model to calculate cost is like this : - when the BOX type is "LCL", there is no BOX based charge. It is only a volume based charge. However, I am thinking LCL like a physical box with weight and volume capacities. So, I calculate the volume based costs as below.
PerVol_Based_Rate[Org_ISN[i],Des_ISN[i],b] * Vol_ISN[i]*BoxesNeeded[i,b];
But I realize that this may solve removing LCL, this is not the correct representation either, ie. multiplying by BoxesNeeded .
I did a test for a particular shipment by changing its input CBM and Wt and the rate as below.
data CASUSER.InputData_AssetMix;
Set CASUSER.InputData_AssetMix;
If ISN='SHA_SEA_10' then Volume=30;
If ISN='SHA_SEA_10' then Weight=100;
Run;
data CASUSER.BOXRATE;
Set CASUSER.BOXRATE;
If Org='SHA' and
Des='SEA' and
Box='LCL' then Rate=31;
Run;
these are the specs of this shipment: SHA_SEA_10: that has a volume of 30 and wt of 100 and a rate of this:
Org | Des | Box | Ratetype | Rate | RateBasis |
SHA | SEA | LCL | Linehaul | 31 | PerVolUOM |
SHA | SEA | 20F | Linehaul | 880 | PerBox |
SHA | SEA | 40F | Linehaul | 1100 | PerBox |
SHA | SEA | 40H | Linehaul | 1210 | PerBox |
SHA | SEA | 45F | Linehaul | 1320 | PerBox |
The model says 1X40F whereas that is actually more expensive ($1,100). I can ship it via 1x20F and 1xLCL for a total cost of ($880+ (1x31)=$911 . So can you please tell how to fix this?
thanks a lot for ur support as always
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.