| Overview | Group | Tree | Graph | Deprecated | Index | Concepts |

An instance of this class represents a sequence constraint in a model. As you can see from the arguments of its constructor, an instance of this class makes it possible for you to constrain:
In order for the constraint to take effect, you must add it to a model with the
template IloAdd or the member function
IloModel::add and extract the model for an algorithm
with the member function IloAlgorithm::extract.
Most member functions in this class contain assert statements. For an
explanation of the macro NDEBUG (a way to turn on or turn off these
assert statements), see the concept
Assert and NDEBUG.
Note: This constraint cannot be used in a logical constraint.
See Also:
| Method Summary | |
|---|---|
public IloSequenceI * | getImpl() const |
public | IloSequence() |
public | IloSequence(IloSequenceI * impl) |
public | IloSequence(const IloEnv env, IloInt nbMin, IloInt nbMax, IloInt seqWidth, const IloIntVarArray vars, const IloIntArray values, const IloIntVarArray cards, const char * name=0) |
Inherited Methods from IloConstraint |
|---|
getImpl, IloConstraint, IloConstraint |
Inherited Methods from IloIntExprArg |
|---|
getImpl, IloIntExprArg, IloIntExprArg |
Inherited Methods from IloNumExprArg |
|---|
getImpl, IloNumExprArg, IloNumExprArg |
Inherited Methods from IloExtractable |
|---|
asConstraint, asIntExpr, asModel, asNumExpr, asObjective, asVariable, end, getEnv, getId, getImpl, getName, getObject, IloExtractable, isConstraint, isIntExpr, isModel, isNumExpr, isObjective, isVariable, removeFromAll, setLocation, setName, setObject |
| Method Detail |
|---|
This constructor creates a sequence constraint in an environment.
The argument
nbMin specifies a minimum number of allowable values, and
nbMax specifies a maximum number of allowable values.
The argument
seqWidth specifies the number of elements in a sequence.
The argument
cards specifies an array of cardinalities
(that is, how many occurrences).
In the new constraint created by this class,
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
are assigned to a constrained variable of the sequence.
The arrays cards and values must be the same length;
otherwise, on platforms where C++ exceptions are supported and exceptions are enabled,
Concert Technology throws the exception InvalidArraysException.