| Overview | Group | Tree | Graph | Index | Concepts |
This function creates and returns a constraint that works on sequences.
A sequence constraint groups several constraints created by the functions
IlcCard or IlcDistribute
into only one constraint in order to reduce domains of constrained variables more effectively.
The parameter nbMin indicates a minimum number of allowable values,
and nbMax indicates a maximum number of allowable values. The parameter
seqWidth indicates the number of elements in a sequence. The parameter
cards indicates an array of cardinalities (that is, how many occurrences).
In the new constraint created by this function, the constrained variables in the
array cards will be equal to the number of occurrences in the array
vars of the values in the array values such that for each
sequence of seqWidth (a number) consecutive constrained variables of
vars at least nbMin and at most nbMax values of
values are assigned to a constrained variable of the sequence.
The arrays cards and values must be the same length;
otherwise, Solver will throw an exception (an instance of IloSolver::SolverErrorException).
However, note that the array vars can contain values other than those that
appear in the array values.
If you do not explicitly state a filter level, then Solver uses the default filter
level for this constraint. The optional argument level can take values of the
enumeration IlcFilterLevel. Its lowest value is
IlcBasic. The amount of domain reduction during propagation depends on that
value. The value IlcExtended causes more domain reduction than does
IlcBasic; it also takes longer to run. See IlcFilterLevel
for an explanation of filter levels and their effect on constraint propagation.
See Also:
IlcCard, IlcDistribute, IlcFilterLevel