Definition of disjunctions with restricted domain - Example 3

Example 3: using with and ord clause to controlling disjunction domains and domains that are already controlled

This example is a modification of the previous. For this case we need to control a domain set which is already controlled. An ALIAS definition in the GAMS section isneeded.
Given the following definition in the GAMS Section:
SET I /1*3/ , J /1*4/;

...and the following disjunction declaration and definition in LogMIP Section:
$ONECHO > ""

Disjunction D(i,j);
 D(i,j) with (ord(i) < ord(j)) IS
 IF Y(i,j) THEN
  CONSTR2(i,jj) with (ord(jj) le 2);
  CONSTR4(j,k) with (ord(k) lt card(k));

Since the domain j is controlled by the disjunction, and for CONSTR2 you need a different control, the ALIAS definition allow that you can define a with clause over it.
The previous example will generate the following disjunctions:
D('1', '2'), D('1', '3'), D('1','4'), D('2','3'), D('2','4') y D('3', '4').

Note that:

If you control the domain of a particular constraint with the sentence with you must be aware which domain expansion is assumed in order to avoid errors on it, that in the previous example it has been compared the order of a set item against an integer number, because the order is related to a position into the set, the position in which the item has been defined in the set.