forbidEnd

OPL constraint (scheduling) to limit the end of an interval variable.

context type
Model files (.mod)
boolean

Syntax

forbidEnd(a, F);

Where:

dvar interval a;
stepFunction F;

Description

This constraint is used to indicate that a given interval variable cannot end at a particular date. Let a denote a fixed interval and F an integer stepwise function. The constraint forbidEnd(a, F), states that whenever the interval is present, it cannot end at a value t where F(t-1) = 0.

Note: This constraint cannot be used in a meta-constraint.

Example

The following constraint will prevent interval variable a to end in any interval [7i, 7i + 5) for i in [0, 51]:

stepFunction F = stepwise(i in 0..51, p in 0..1) {
    100*p -> (7*i)+(5*p) ; 0 };
dvar interval a size 14;
constraints {
   forbidEnd(a, F);
};