Definition of disjunctions with restricted domain - Example 1
Example 1: using with, ord and card to controlling disjunction domains
In this example, the disjunction domains are controlled using the with, ord and card clauses. The disjunction’s variables and constraints domains do not need an extra control. Given the following set definition in the GAMS Section:
SETI /1*3/ , J /1*4/;
...and the following disjunction declaration and definition in LogMIP Section:
$ONECHO > "%lm.info%" Disjunction D(I,J);
D(I,J) with (ord (J) lt card(J)) IS IF Y(I,J) THEN
CONSTRAINT(I,J);
CONSTRAINT(I,J); ELSE
CONSTRAINT(I,J);
CONSTRAINT(I,J); ENDIF;$OFFECHO
Only the domain of set J is controlled. The values of J must be less than the cardinality of J, meaning that only 1, 2 and 3 are permitted. The expansion of the previous definition renders 9 disjunctions (3 times 3): D(‘1’,’1’), D(‘1’,’2’), D(‘1’,’3’), D(‘2’,’1’), D(‘2’,’2’), D(‘2’,’3’), D(‘3’,’1’), D(‘3’,’2’) and D(‘3’,’3’).