<?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: SAS syntax &amp;quot;for all&amp;quot; i in SET in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-syntax-quot-for-all-quot-i-in-SET/m-p/944196#M4223</link>
    <description>Post it at SAS/OR forum:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/Mathematical-Optimization/bd-p/operations_research" target="_blank"&gt;https://communities.sas.com/t5/Mathematical-Optimization/bd-p/operations_research&lt;/A&gt;&lt;BR /&gt;And calling &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1636"&gt;@RobPratt&lt;/a&gt;</description>
    <pubDate>Tue, 17 Sep 2024 06:17:53 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2024-09-17T06:17:53Z</dc:date>
    <item>
      <title>SAS syntax "for all" i in SET</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-syntax-quot-for-all-quot-i-in-SET/m-p/944195#M4222</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to SAS and wondering what should be the right SAS syntax for the following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;/* Time constraints */
con time_constraints_A:
   sum{i in LOCATIONS, j in LOCATIONS} t_A[i, j] * x[i, j, k]
   + sum{i in LOCATIONS} s_A[i] * y[i, k] &amp;lt;= max_time[k], 
   for all k in VEHICLES where z[k] = 1;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I don't think the last line is correct but that is the logic in plain english I want to do. I want the sum + sum for all k in set VEHICLE where z[k] = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same for this constraint&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;con type_link:
      v_A[i] * z[k] + v_B[i] * (1 - z[k]) &amp;gt;= x[i, j, k], 
      for all i in LOCATIONS, j in LOCATIONS, k in VEHICLES;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 06:02:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-syntax-quot-for-all-quot-i-in-SET/m-p/944195#M4222</guid>
      <dc:creator>norachanisara</dc:creator>
      <dc:date>2024-09-17T06:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS syntax "for all" i in SET</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-syntax-quot-for-all-quot-i-in-SET/m-p/944196#M4223</link>
      <description>Post it at SAS/OR forum:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/Mathematical-Optimization/bd-p/operations_research" target="_blank"&gt;https://communities.sas.com/t5/Mathematical-Optimization/bd-p/operations_research&lt;/A&gt;&lt;BR /&gt;And calling &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1636"&gt;@RobPratt&lt;/a&gt;</description>
      <pubDate>Tue, 17 Sep 2024 06:17:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-syntax-quot-for-all-quot-i-in-SET/m-p/944196#M4223</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-09-17T06:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS syntax "for all" i in SET</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SAS-syntax-quot-for-all-quot-i-in-SET/m-p/944282#M4224</link>
      <description>&lt;P&gt;Assuming that you also want z[k] = 0 to imply that x[i,j,k] = 0 and y[i,k] = 0, you can impose the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con time_constraints_A {k in VEHICLES}:
   sum{i in LOCATIONS, j in LOCATIONS} t_A[i, j] * x[i, j, k]
   + sum{i in LOCATIONS} s_A[i] * y[i, k] &amp;lt;= max_time[k] * z[k];
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For the second constraint, here is correct syntax:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;con type_link {i in LOCATIONS, j in LOCATIONS, k in VEHICLES}:
      v_A[i] * z[k] + v_B[i] * (1 - z[k]) &amp;gt;= x[i, j, k];
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Sep 2024 15:29:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SAS-syntax-quot-for-all-quot-i-in-SET/m-p/944282#M4224</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2024-09-17T15:29:02Z</dc:date>
    </item>
  </channel>
</rss>

