Originally posted by: UmarWaqas
Hi, I am trying to implement an OPL model which reads the names from a set and populates an array. The constraints have to be specified on the populated array.
The population is performed in pre-processing (ILOG OPL script). Please consider the code below:
/**************************/
{string} names = {"Mike","Tim"};
int members;
string populated
http://1..members;
execute INITIALIZE {
members = 2;
var count = 1;
for (var i in names)
{
populated
count = i;
count++;
}
}
/* Decision variables */
dvar int dummy
http://1..members in 1..10;
subject to{
forall (i in 1..members)
{
/* Required: this statement just checks whether "Mike" is accessed through "populated" */
(populated[i] == "Mike") => (dummy[i] != 2);
}
}
/**************************/
The compiler reports following errors:
1) CPLEX(default) cannot extract model: IloAlgorithm cannot extract extractable.
2) CPLEX(default) cannot extract expression: populated[i] == "Mike".
3) CPLEX(default) cannot extract expression: forall(i in 1..2) populated[i] == "Mike" => dummy[i] != 2.
I think i am misunderstanding the programming constructs available. Please rectify if possible.
#ConstraintProgramming-General#DecisionOptimization