| Overview | Group | Tree | Graph | Index | Concepts |
This function can be used to define simple constraints that are not
predefined. It creates and returns a constraint for use in an IBM ILOG Concert
Technology model. That constraint is defined for all the
constrained variables in the array vars or for the single
constrained variable y.
This kind of constraint is sometimes known as an element constraint.
The semantics of that generic constraint can be specified in either one of several ways:
pred
specifies that predicate; set specifies the combinations of values that satisfy the
constraint, and the argument compatible must be
IloTrue;set specifies the unsatisfactory combinations of
values, and the argument compatible must be
IloFalse;y equal to the element
of the array a at the index specified by x. In
other words, y=a[x];The order of the constrained variables in the array vars is
important because the same order is respected in the predicate
pred or the set. That is,
IloTableConstraint passes an array of values to the member
function isTrue for a predicate or to the member function
isIn for a set, where the first such value is a value of
vars[0], the second is a value of vars[1], and in
general, the i-th value is a value of the constrained variable
vars[i].
To avoid exceptions, you must observe the following conditions:
pred as an
argument, the size of the array of constrained variables must be
three. vars is must be the same as the
size of the set.