<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: constraint declaration in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723051#M3343</link>
    <description>&lt;P&gt;Sorry, I don't quite understand your question.&amp;nbsp; The FIX statement will fix a variable to a given value, and your syntax for that looks correct.&amp;nbsp; Where does the sum come in?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Mar 2021 00:40:38 GMT</pubDate>
    <dc:creator>RobPratt</dc:creator>
    <dc:date>2021-03-03T00:40:38Z</dc:date>
    <item>
      <title>constraint declaration</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723046#M3340</link>
      <description>&lt;P&gt;Hi I am having syntax error in the constraint declaration&amp;nbsp;&lt;/P&gt;&lt;P&gt;The constraint that I want is to make sure that the model forces a specific combination. ie. IST-SAV-MAEU-SAV to be 1.&amp;nbsp; Not sure how to sum the containers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var IsPortsTransitLSPDC {Ports,Transit,LSP,DC} binary;

num IST_SAV;
fix IsPortsTransitLSPDC ['IST','SAV','MAEU','SAV']=1;
READ DATA STDOPT.PN3381_Data(where=(PortSource = "QIN" and RateMatchDest='SAV')) INTO IST_SAV=FEU;

/*Force IST to SAV via MAEU and SAV*/
CON IST_SAV_MAEU_SAV {p in {'IST'}, {t in {'SAV'}, c in {'MAEU'}, d in {'SAV'}}:
ContainersfromPortstoLSPtoDC ['QIN','SAV','MAEU','SAV'] =IST_SAV*IsPortsTransitLSPDC['IST','SAV','MAEU','SAV'];&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 00:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723046#M3340</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2021-03-03T00:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: constraint declaration</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723049#M3341</link>
      <description>&lt;P&gt;oops. here is the constraint&amp;nbsp; i have&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Force IST to SAV via MAEU and SAV*/
CON IST_SAV_MAEU_SAV {p in {'IST'}, {t in {'SAV'}, c in {'MAEU'}, d in {'SAV'}}:
ContainersfromPortstoLSPtoDC ['IST','SAV','MAEU','SAV'] =IST_SAV*IsPortsTransitLSPDC['IST','SAV','MAEU','SAV'];&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Mar 2021 00:28:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723049#M3341</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2021-03-03T00:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: constraint declaration</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723051#M3343</link>
      <description>&lt;P&gt;Sorry, I don't quite understand your question.&amp;nbsp; The FIX statement will fix a variable to a given value, and your syntax for that looks correct.&amp;nbsp; Where does the sum come in?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 00:40:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723051#M3343</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2021-03-03T00:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: constraint declaration</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723053#M3344</link>
      <description>&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;yeah i want that specific variable to be set 1 when the combo is IST-SAV-MAEU-SAV.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to do that i declare a binary variable&amp;nbsp;IsPortsTransitLSPDC and set it as 1. And also trying to set up a constraint so that this variable is used correctly and that the flow through this combo is exactly we see in my other variable&amp;nbsp;IST_SAV that&amp;nbsp; I have.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 00:46:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723053#M3344</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2021-03-03T00:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: constraint declaration</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723063#M3345</link>
      <description>&lt;P&gt;Tried this one as well: Feels am close but not yet&lt;/P&gt;&lt;PRE&gt;CON CONST_IST_SAV {p in {'IST'}, d in {'SAV'}}: &lt;BR /&gt;sum {t in Transit,c in LSP} ContainersfromPortstoLSPtoDC['IST',t,c,'SAV'] =IST_SAV*IsPortsTransitLSPDC['IST','SAV','MAEU','SAV'];&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Mar 2021 03:12:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723063#M3345</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2021-03-03T03:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: constraint declaration</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723079#M3346</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CON CONST_IST_SAV {p in {'IST'}, d in {'SAV'},c in {'LSP'}}: 
sum {t in Transit} ContainersfromPortstoLSPtoDC['IST',t,'MAEU','SAV'] =IST_SAV*IsPortsTransitLSPDC['IST','SAV','MAEU','SAV'];&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;based on your feedback, i tweaked&amp;nbsp; and this one worked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 04:23:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723079#M3346</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2021-03-03T04:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: constraint declaration</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723892#M3348</link>
      <description>&lt;P&gt;I'm glad you got it working.&amp;nbsp; Because you don't use p, d, or c anywhere, here's a simpler way to declare the same constraint:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CON CONST_IST_SAV:
sum {t in Transit} ContainersfromPortstoLSPtoDC['IST',t,'MAEU','SAV'] =IST_SAV*IsPortsTransitLSPDC['IST','SAV','MAEU','SAV'];
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Mar 2021 15:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/constraint-declaration/m-p/723892#M3348</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2021-03-05T15:54:42Z</dc:date>
    </item>
  </channel>
</rss>

