Skip to main content
FRAMES NO FRAMES

IloPresenceOf

public IloConstraint IloPresenceOf(const IloEnv env, const IloIntervalVar a)
Definition file: ilconcert/ilosmodel.h
Returns a logical constraint on an interval.

This function returns a constraint that states that interval variable a is present. You must add this constraint to a model and extract the model to an algorithm in order for it to be taken into account.

Typically, this constraint is used in combination with other constraints. For instance, the following code adds a constraint to the model specifying that at least one interval variable among a and b should be present:

model.add(IloPresenceOf(env,a)||IloPresenceOf(env,b));

For more information on presence of interval variables, see the concept Logical constraints.