State functions looks like the best option for modeling my situation.
Now interval variable X might be in range of state functin from 'vmin' to 'vmax'.
But in my situation any interval variable is related to set of states and this states are not going in order.
For example, interval "product_1_Interval" is related to states 1 and 3. And not allowed in state 2. But interval "product_2_Interval" is related to states 2 and 3.
My desirable situation is this one: the image about how it should be
OPL Code example:
stateFunction myStateFunction;
dvar interval product_1_Interval;
dvar interval product_2_Interval;
subject to
{
alwaysConstant (myStateFunction, 0, 155);
alwaysConstant (myStateFunction, 156, 310);
/* Below need constraint that interval variable product_1_Interval might be in state 1 or 3 */
/* Below need constraint that interval variable product_2_Interval might be in state 2 or 3 */
}
I've tried to write something like:
alwaysEqual(myStateFunction, product_1_Interval, 1) or alwaysEqual(myStateFunction, product_1_Interval, 3);
But I got an error "Exception in presolve: Constraint 'alwaysEqual' is a top level constraint, it cannot be used in an expression..".
My question: Is it possible now in CPLEX Solver to model situation when an interval variable relates to some set of states (stateFunction) which are not going in order?
I would use alternative and write
and to get something like you look for
gives
and
gives