Overview | Group | Tree | Graph | Deprecated | Index | Concepts |
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:
[start=0, end=100): state=0
, [start=150, end=250): state=1
, [start=250, end=300): state=1
, [start=320, end=420): state=2
, [start=460, end=560): state=0
, ... A set of constraints is available to restrict the evolution of a state function. These constraints allow you to specify:
IloAlwaysEqual
). IloAlwaysConstant
). IloAlwaysNoState
). [vmin, vmax]
(IloAlwaysIn
). 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 |
---|
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.
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.