Skip to main content
FRAMES NO FRAMES

Class IloStateFunction

Definition file: ilconcert/ilosmodel.h
Map of IloStateFunctionIloStateFunctionIloStateFunctionIloExtractable
An instance of this class represents a state function in a model.

Informally speaking, a state function is a decision variable whose value is a set of non-overlapping intervals over which the function maintains a particular non-negative integer state. In between those intervals, the state of the function is not defined, typically because of an ongoing transition between two states.

For instance a state function could be used to describe the evolution of an oven's temperature over time. Assuming there are 3 possible temperature levels (indexed by 0, 1, and 2), a fixed value for this state function could be the following set of non-overlapping valued intervals:

A set of constraints is available to restrict the evolution of a state function. These constraints allow you to specify:

Note: This constraint cannot be used in a logical constraint.

For more information on state functions, see the concept State functions in CP Optimizer.

Method Summary
public IloStateFunctionI *getImpl() const
public IloStateFunction()
public IloStateFunction(IloStateFunctionI * impl)
public IloStateFunction(const IloEnv env, const char * name=0)
public IloStateFunction(const IloEnv env, const IloTransitionDistance tdist, const char * name=0)
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

IloStateFunction

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

IloStateFunction

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

IloStateFunction

public IloStateFunction(const IloEnv env, const char * name=0)

This constructor creates an instance of state function and makes it part of the environment env. By default, its name is the empty string, but you can specify a name of your own choice.


IloStateFunction

public IloStateFunction(const IloEnv env, const IloTransitionDistance tdist, const char * name=0)

This constructor creates an instance of state function with transition distance tdist and makes it part of the environment env.

The transition distance tdist of size size sets the number of states allowed for the function values in the range 0...size-1. The transition distance tdist must satisfy the triangular inequality. Unlike the noOverlap constraint for interval sequence variables for which the set of types is known by construction, the triangular inequality must hold on all possible states, even if a state is never used in the constraint stated on the function. For example, suppose a size 3 transition distance with a non-null distance between states 1 and 2, and such that state 0 is never used to constrain the function. By default, the distance between states 1 and 0 is 0 and between states 0 and 2 is 0: the triangular inequality is not satisfied. The proper value for any distance involving the state 0 is the maximum distance between two meaningful states.

By default, the name of the state function is the empty string, but you can specify a name of your own choice.


getImpl

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