BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Santha
Pyrite | Level 9

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). 

RobPratt
SAS Super FREQ

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.

Santha
Pyrite | Level 9

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:

OrgDesBoxRatetypeRateRateBasis
SHASEALCLLinehaul31PerVolUOM
SHASEA20FLinehaul880PerBox
SHASEA40FLinehaul1100PerBox
SHASEA40HLinehaul1210PerBox
SHASEA45FLinehaul1320PerBox

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? 

Santha
Pyrite | Level 9

thanks a lot for ur support as always