| Overview | Group | Tree | Graph | Deprecated | Index | Concepts |

An interval variable is a decision variable whose value is an interval of integers. Thus, the value of an interval variable is characterized by two integers, one for the start of the interval and the other for the end of the interval. An important additional feature of interval variables is the fact that they can be optional: that is, one can decide not to consider them in the solution. When considered in the solution, the interval is said to be present, otherwise it is absent. When an interval is absent attributes like start and end are meaningless. Each constraint and expression on an interval variable specifies how it handles absent intervals.
The length of an interval variable is defined as its end value minus its start value. The size of an interval variable is a non-negative integer characteristic of an interval variable, and related to the start and end of the interval variable through an intensity function. When an intensity function is specified, the size is equal to the integral of the intensity function between the start and the end of the interval. By default, when no intensity function is specified, the intensity is assumed to be the constant unit function, and thus the size and length of of the interval are equivalent.
For more information on interval variables, see the concept Interval variables in CP Optimizer.
| Method Summary | |
|---|---|
public IloInt | getEndMax() const |
public IloInt | getEndMin() const |
public IloInt | getGranularity() const |
public IloIntervalVarI * | getImpl() const |
public IloNumToNumStepFunction | getIntensity() const |
public IloInt | getLengthMax() const |
public IloInt | getLengthMin() const |
public IloInt | getSizeMax() const |
public IloInt | getSizeMin() const |
public IloInt | getStartMax() const |
public IloInt | getStartMin() const |
public | IloIntervalVar() |
public | IloIntervalVar(IloIntervalVarI * impl) |
public | IloIntervalVar(const IloEnv env, const char * name=0) |
public | IloIntervalVar(const IloEnv env, IloInt sz, const char * name=0) |
public | IloIntervalVar(const IloEnv env, IloInt szmin, IloInt szmax, IloBool opt=IloFalse, const IloNumToNumStepFunction f=0, const char * name=0) |
public IloBool | isAbsent() const |
public IloBool | isPresent() const |
public void | setAbsent() const |
public void | setEndMax(IloInt max) const |
public void | setEndMin(IloInt min) const |
public void | setIntensity(IloNumToNumStepFunction f, IloInt g=100) const |
public void | setLengthMax(IloInt max) const |
public void | setLengthMin(IloInt min) const |
public void | setOptional() const |
public void | setPresent() const |
public void | setSizeMax(IloInt max) const |
public void | setSizeMin(IloInt min) const |
public void | setStartMax(IloInt max) const |
public void | setStartMin(IloInt min) const |
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 interval variable and makes it
part of the environment env. The start, end and
size of the new interval variable range from 0 to the constant
IloIntervalMax. The created interval variable is
present; if you need an optional interval variable, you need to
use the member function setOptional. As no
intensity function is specified, the size of the interval
variable will be equal to its length. By default, its name is the
empty string, but you can specify a name of your own
choice.
This constructor creates an interval variable and makes it
part of the environment env. The start and end of
the new interval variable range from 0 to the constant
IloIntervalMax. The size of the new interval
variable is fixed and equal to sz. The created
interval variable is present; if you need an optional interval
variable, you need to use the member function
setOptional. As no intensity function is specified,
the size of the interval variable will be equal to its length. By
default, its name is the empty string, but you can specify a
name of your own choice.
This constructor creates an interval variable and makes it
part of the environment env. The start and end of
the new interval variable range from 0 to the constant
IloIntervalMax. The size of the new interval
variable ranges from szmin to szmax. By
default, the created interval variable is present but it can be
made optional by passing a true value (IloTrue) for opt.
By default, no intensity function is specified, so the size of the
interval variable will be equal to its length but you can specify
an intensity function f. This intensity
function is an integer step function expressed as a percentage (and
so must bounded in the range [0,100]). By default, its name is the
empty string, but you can specify a name of your own choice.
This member function returns the maximal end value of the invoking interval variable.
This member function returns the minimal end value of the invoking interval variable.
This member function returns the granularity of the intensity function of the invoking interval variable. Note that by default, the granularity is 100 so the intensity function is expressed as a percentage.
This member function returns the intensity function of the invoking interval variable. If an intensity function was not specified for the interval variable, it returns an empty handle.
This member function returns the maximal length value of the invoking interval variable.
This member function returns the minimal length value of the invoking interval variable.
This member function returns the maximal size value of the invoking interval variable.
This member function returns the minimal size value of the invoking interval variable.
This member function returns the maximal start value of the invoking interval variable.
This member function returns the minimal start value of the invoking interval variable.
This member function returns true if and only if the invoking interval variable must be absent.
This member function returns true if and only if the invoking interval variable must be present.
This member function specifies that the invoking interval variable must be absent.
This member function sets max as the maximal end
value of the invoking interval variable. The value must be in the
range [IloIntervalMin,IloIntervalMax].
This member function sets min as the minimal end
value of the invoking interval variable. The value must be in the
range [IloIntervalMin,IloIntervalMax].
This member function specifies an intensity function
f and an optional granularity g for the invoking
interval variable. If the granularity is not specified,
a granularity of 100 is assumed, and the intensity function
should be expressed as a percentage.
This member function sets max as the maximal length
value of the invoking interval variable.
This member function sets min as the minimal length
value of the invoking interval variable.
This member function specifies that the invoking interval variable is optional; that is, the presence status of the interval is a decision variable of the problem.
This member function specifies that the invoking interval variable must be present.
This member function sets max as the maximal size
value of the invoking interval variable.
This member function sets min as the minimal size
value of the invoking interval variable.
This member function sets max as the maximal start
value of the invoking interval variable. The value must be in the
range [IloIntervalMin,IloIntervalMax].
This member function sets min as the minimal start
value of the invoking interval variable. The value must be in the
range [IloIntervalMin,IloIntervalMax].