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

Rob

I want to add a constraint UseProperRates  where I want only if the rates are greater than 1000 to be considered for model.

I did this but it is not working. 

 

con UseProperRates {p in Ports, t in Transit, c in LSP, d in DC}: InboundLinehaul[p,t,c,d] >=1000;

I added this one. Not sure if this is right. 

 

con UseProperRates {p in Ports, t in Transit, c in LSP, d in DC}:
sum {p in Ports, t in Transit,c in LSP, d in DC} InboundLinehaul [p,t,c,d] >=1000;

1 ACCEPTED SOLUTION

Accepted Solutions
RobPratt
SAS Super FREQ

Your first attempt is correct if you want each InboundLinehaul[p,t,c,d] variable to be >= 1000.  If you instead want the sum of all InboundLinehaul[p,t,c,d] variables to be >= 1000, the correct declaration is:

con UseProperRates:
   sum {p in Ports, t in Transit, c in LSP, d in DC} InboundLinehaul [p,t,c,d] >= 1000;

View solution in original post

5 REPLIES 5
RobPratt
SAS Super FREQ

Your first attempt is correct if you want each InboundLinehaul[p,t,c,d] variable to be >= 1000.  If you instead want the sum of all InboundLinehaul[p,t,c,d] variables to be >= 1000, the correct declaration is:

con UseProperRates:
   sum {p in Ports, t in Transit, c in LSP, d in DC} InboundLinehaul [p,t,c,d] >= 1000;
Santha
Pyrite | Level 9

Yes i tried the first one. but i guess infeasibility. Here are my three other constraints.

 

con Min_Qty_at_LSP_is_Respected {c in LSP}:
sum{p in Ports,t in Transit,d in DC} ContainersfromPortstoLSPtoDC [p,t,c,d]>=Min_Qty_LSP*Is_LSP[c];

 

con ModelOutput_Same_As_ModelInput {p in Ports, d in DC}:
sum {t in Transit,c in LSP} ContainersfromPortstoLSPtoDC[p,t,c, d] = Containers [p,d];

 

con CheckLSP {c in LSP}: ContainersatLSP[c] <= BigM*Is_LSP[c];

 

con UseProperRates {p in Ports, t in Transit, c in LSP, d in DC}: InboundLinehaul[p,t,c,d] >=1;

RobPratt
SAS Super FREQ

OK, I see from your other thread that InboundLineHaul is a NUM, not a VAR.  The constraints should all contain at least one variable.

 

I'm not quite sure what rule you are trying to enforce when you say "I want only if the rates are greater than 1000 to be considered for model."  Does this mean that if InboundLinehaul[p,t,c,d] < 1000 you want to treat it as 0 instead?  Or maybe if InboundLinehaul[p,t,c,d] < 1000 you want to force ContainersfromPortstoLSPtoDC[p,t,c, d] = 0?  Or something else?

Santha
Pyrite | Level 9

Thanks Rob. 

I am trying to enforce a rule where I want the model to just use costs when it is more than 1000. 

Anything less than 1000, I dont want model to consider it. 

 

Santha
Pyrite | Level 9

Thanks Rob

Based on ur feedback I did this: I declared a binary variable called IsPortsTransitLSPDC

 

con UseProperRates {p in Ports, t in Transit, c in LSP, d in DC}: IsPortsTransitLSPDC[p,t,c,d]*InboundLinehaul[p,t,c,d] >=1;

this seems to be working. i will check on the numbers closesly

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Multiple Linear Regression in SAS

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.

Discussion stats
  • 5 replies
  • 894 views
  • 1 like
  • 2 in conversation