NO FRAMES

Class IloSequence

Definition file: ilconcert/ilomodel.h

An instance of this class represents a sequence constraint in a model. As you can see from the parameters of its constructor, an instance of this class enables 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(IloSequence::ImplClass *)
public IloSequence(const IloEnv, IloInt, IloInt, IloInt, const IloIntVarArray, const IloIntArray, const IloIntVarArray, const char *)
Method Summary
public IloSequence::ImplClass *getImpl()
Inherited Methods from IloConstraint
getImpl
Inherited Methods from IloIntExprArg
getImpl
Inherited Methods from IloNumExprArg
getImpl
Inherited Methods from IloExtractable
end, getEnv, getId, getImpl, getName, getObject, setName, setObject
Constructor Detail

IloSequence

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

IloSequence

public IloSequence(IloSequence::ImplClass * 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)

This constructor creates a sequence constraint in an environment. 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 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 IloSequence::ImplClass * getImpl()
This member function returns a pointer to the implementation object of the invoking handle.