Overview | Group | Tree | Graph | Deprecated | Index | Concepts |
A cumul function expression is an expression whose value in a solution is a function from the set of integers to the set of non-negative integers. A cumul function expression represents the sum of individual contributions of intervals. A panel of elementary cumul function expressions is available to describe the individual contribution of an interval variable (or a fixed interval) to a cumul function expression:
IloPulse(a, 5)
represents a pulse function of height
5
. This function is equal to 0
before
the start of interval variable a
, to 5
between the start and the end of interval variable a
and to 0
after the end of interval variable a
.
Several variants of pulse functions are available depending on the
fact the interval is variable or fixed and whether the height is
specified as a fixed integer or as a range of possible integer
values.IloStepAtStart(a, 3)
represents a step function
of height 3
. This function is equal to
0
before the start of interval variable
a
and to 3
after the start of interval
variable a
. Several variants of step functions are
available depending on which end-point of the interval variable
is considered (start or end) and whether the height is specified as
a fixed integer or as a range of possible integer values.A cumul function expression is defined as the sum of the above elementary functions or their opposite. Several constraints over cumul function expressions are provided. These constraints allow the restriction of the possible values of the function over the complete horizon or over some fixed or variable interval:
f
is a cumul function expression and max
a non-negative integer, the constraint f <= max
states that function f
must be lower than
max
everywhere.f
is a cumul function expression and min
a non-negative integer, the constraint min <= f
states that function f
must be greater than
min
everywhere.f
is a cumul function expression,
a
an interval variable and [min,max]
a
range of non-negative integers, the constraint
IloAlwaysIn(env,f,a,vmin,vmax)
states that whenever
interval variable a
is present, the value of function
f
between the start and the end of interval
a
must belong to range [vmin,vmax]
. Variants
of this constraint are available to constrain a cumul
function expression over a fixed interval.For more information on cumul function expressions, see the Cumul functions in CP Optimizer.
Method Summary | |
---|---|
public IloCumulFunctionExprI * | getImpl() const |
public | IloCumulFunctionExpr() |
public | IloCumulFunctionExpr(IloCumulFunctionExprI * impl) |
public | IloCumulFunctionExpr(const IloEnv env, const char * name=0) |
public IloCumulFunctionExpr & | operator+=(const IloCumulFunctionExpr f) |
public IloCumulFunctionExpr & | operator-=(const IloCumulFunctionExpr f) |
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 constant cumul function expression
everywhere equal to 0
that the user can modify
subsequently with the operators +=
and -=
in the
environment env
. By default, the name of the cumul
function expression is the empty string, but you can specify a
name
of your own choice.
This operator adds the cumul function expression
f
to the invoking cumul function expression.
This operator subtracts the cumul function expression
f
from the invoking cumul function expression.