AMPL : defining two condition in one constraint
<p>when I define my constraint in this way</p>

<pre><code>subject to p_inj {p in Step,  k in Dest : type[k] == 2 || type[k] == 3}
</code></pre>

<p>it works but when I use :</p>

<pre><code>subject to p_inj {p in Step : time[p] == 1 ,k in Dest : type[k] == 2 || type[k] == 3}
</code></pre>

<p>it does not work any more. </p>

<p>Can anyone explain why it does not work and if there is any way to make that work in this way or not?</p>

<p>also suppose my Step is like this :</p>

<pre><code>Set Step : = 1 2 ;
</code></pre>

<p>is there any way that I can tell AMPL in this way :</p>

<pre><code>subject to p_inj {p in Step : Step[p] == 1 ,k in BUS : bus_type[k] == 2 || bus_type[k] == 3}
</code></pre>

<p>I mean is there any way to use value of different elements of a set directly?</p>