Definition of disjunctions with restricted domain - Example 2
Example 2: using with and ord clause to controlling disjunction domains and constraints domain
In this example, the disjunction domains are controlled using the with and ord clauses. There exists a constraint with a domain not controlled by the disjunction that must be done in order to avoid semantic errors. Given the following set definition in the GAMS Section:
SET I /1*3/ , J /1*4/, K/1*2/;
...and the following disjunction declaration and definition in LogMIP Section:
$ONECHO > "%lm.info%" Disjunction D(i,j);
D(i,j) with (ord(i) < ord(j)) IS IF Y(i,j) THEN
CONSTR1(j);
CONSTR2(i,j); ELSE
CONSTR3(j);
CONSTR4(j,k) with (ord(k) ge 1); ENDIF; $OFFECHO
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').<
Observe that CONSTR4 is defined over sets j and k. In this case j does not have problems since its domain is controlled by disjunction D. This is not the case of k, where you must include a with sentence to control the domain and avoid a semantic error.
For the second term of the first disjunction D(‘1’,‘2’) the following constraints must be satisfied:CONSTR3(‘2’), CONSTR4(‘2’,’1’), CONSTR4(‘2’,’2’), CONSTR4(‘2’,’3’).