Originally posted by: PhilippeLaborie
In the model of Chris, y does not need to be a boolean variable, it can be any integer variable, and you can do things like:
model.add(IloIfThen(env, (x[0]<20 && x[1]<10),(y>10 && y<20)));
This being said, depending on what this table represents, there may be more compact ways to model the constraint:
* Is the constraint always about 3 variables (x[0],x[1] and y) or can it involve more than 2 x[i] variables ?
* Does fixing the values of all the variables x[i] results in a unique value for y ? (looking at your example, it does not seem to as for instance x[0]=30 and x[1]=30 results in two possible values {0,1} for y)
* Is it not possible to define the constraint in a closed form by using the available algebraical expressions available in CPO (min, max, +-*/, ...) ?
#CPOptimizer#DecisionOptimization