FRAMES NO FRAMES

Class IloSequence

Definition file: ilconcert/ilomodel.h
For constraint programming: a sequence constraint in a model.

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.

See Also:

Constructor Summary
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)
Method Summary
public IloSequenceI *getImpl() const
Inherited Methods from IloConstraint
getImpl
Inherited Methods from IloIntExprArg
getImpl
Inherited Methods from IloNumExprArg
getImpl
Inherited Methods from IloExtractable
asConstraint, asIntExpr, asModel, asNumExpr, asObjective, asVariable, end, getEnv, getId, getImpl, getName, getObject, isConstraint, isIntExpr, isModel, isNumExpr, isObjective, isVariable, setName, setObject
Constructor Detail

IloSequence

public IloSequence()
This constructor creates an empty handle. You must initialize it before you use it.

IloSequence

public IloSequence(IloSequenceI * impl)
This constructor creates a handle object from a pointer to an implementation object.

IloSequence

public IloSequence(const IloEnv env, IloInt nbMin, IloInt nbMax, IloInt seqWidth, const IloIntVarArray vars, const IloIntArray values, const IloIntVarArray cards, const char * name=0)

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.


Method Detail

getImpl

public IloSequenceI * getImpl() const
This member function returns a pointer to the implementation object of the invoking handle.