I have a constraint of the form:
s dist {0:= 20, 1:= 25, 2:= 30, <many more, possibly hundreds>};
Instead of writing down the constraint this way, I found in my application the RHS (i.e. the weights - 20, 25, 30, etc,) could come from an array my_array whose i-th element contains the weight for the i-th element.
Is there any way to shorten it to something like below? This is just to show the concept and is syntactically incorrect:
s dist {foreach rhsArray[j] {j: rhsArray}};