Skip to main content
FRAMES NO FRAMES

IloAlwaysConstant

public IloConstraint IloAlwaysConstant(const IloEnv env, const IloStateFunction f, IloInt start, IloInt end, IloBool startAlign=IloFalse, IloBool endAlign=IloFalse)
Definition file: ilconcert/ilosmodel.h
Creates a constraint that ensures a constant state on an interval.

This function returns a constraint that ensures that state function f is defined everywhere on the interval [start,end) and remains constant over this interval.

Generally speaking, the optional Boolean values startAlign and endAlign allow synchronizing start and end with the intervals of the state function:

Note: This constraint cannot be used in a logical constraint.

For more information on state functions, see the concept State functions in CP Optimizer.


IloAlwaysConstant

public IloConstraint IloAlwaysConstant(const IloEnv env, const IloStateFunction f, const IloIntervalVar a, IloBool startAlign=IloFalse, IloBool endAlign=IloFalse)
Definition file: ilconcert/ilosmodel.h
Creates a constraint that ensures a constant state on an interval.

This function returns a constraint that ensures that whenever interval variable a is present, state function f is defined everywhere between the start and the end of interval variable a and remains constant over this interval.

Generally speaking, the optional Boolean values startAlign and endAlign allow synchronization of the start and end of interval variable a with the intervals of the state function:

Note: This constraint cannot be used in a logical constraint.

For more information on state functions, see the concept State functions in CP Optimizer.