Skip to main content
FRAMES NO FRAMES

Class IloIntervalVar

Definition file: ilconcert/ilosmodel.h
Map of IloIntervalVarIloIntervalVarIloIntervalVarIloExtractable
An instance of this class represents an interval variable in a model.

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 IloIntgetEndMax() const
public IloIntgetEndMin() const
public IloIntgetGranularity() const
public IloIntervalVarI *getImpl() const
public IloNumToNumStepFunctiongetIntensity() const
public IloIntgetLengthMax() const
public IloIntgetLengthMin() const
public IloIntgetSizeMax() const
public IloIntgetSizeMin() const
public IloIntgetStartMax() const
public IloIntgetStartMin() 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 IloBoolisAbsent() const
public IloBoolisPresent() const
public voidsetAbsent() const
public voidsetEndMax(IloInt max) const
public voidsetEndMin(IloInt min) const
public voidsetIntensity(IloNumToNumStepFunction f, IloInt g=100) const
public voidsetLengthMax(IloInt max) const
public voidsetLengthMin(IloInt min) const
public voidsetOptional() const
public voidsetPresent() const
public voidsetSizeMax(IloInt max) const
public voidsetSizeMin(IloInt min) const
public voidsetStartMax(IloInt max) const
public voidsetStartMin(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

IloIntervalVar

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

IloIntervalVar

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

IloIntervalVar

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

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.


IloIntervalVar

public IloIntervalVar(const IloEnv env, IloInt sz, const char * name=0)

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.


IloIntervalVar

public IloIntervalVar(const IloEnv env, IloInt szmin, IloInt szmax, IloBool opt=IloFalse, const IloNumToNumStepFunction f=0, const char * name=0)

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.


getEndMax

public IloInt getEndMax() const

This member function returns the maximal end value of the invoking interval variable.


getEndMin

public IloInt getEndMin() const

This member function returns the minimal end value of the invoking interval variable.


getGranularity

public IloInt getGranularity() const

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.


getImpl

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

getIntensity

public IloNumToNumStepFunction getIntensity() const

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.


getLengthMax

public IloInt getLengthMax() const

This member function returns the maximal length value of the invoking interval variable.


getLengthMin

public IloInt getLengthMin() const

This member function returns the minimal length value of the invoking interval variable.


getSizeMax

public IloInt getSizeMax() const

This member function returns the maximal size value of the invoking interval variable.


getSizeMin

public IloInt getSizeMin() const

This member function returns the minimal size value of the invoking interval variable.


getStartMax

public IloInt getStartMax() const

This member function returns the maximal start value of the invoking interval variable.


getStartMin

public IloInt getStartMin() const

This member function returns the minimal start value of the invoking interval variable.


isAbsent

public IloBool isAbsent() const

This member function returns true if and only if the invoking interval variable must be absent.


isPresent

public IloBool isPresent() const

This member function returns true if and only if the invoking interval variable must be present.


setAbsent

public void setAbsent() const

This member function specifies that the invoking interval variable must be absent.

Note
This member function notifies Concert Technology algorithms about the change of this interval variable.

setEndMax

public void setEndMax(IloInt max) const

This member function sets max as the maximal end value of the invoking interval variable. The value must be in the range [IloIntervalMin,IloIntervalMax].

Note
This member function notifies Concert Technology algorithms about this change of bound in the interval variable.

setEndMin

public void setEndMin(IloInt min) const

This member function sets min as the minimal end value of the invoking interval variable. The value must be in the range [IloIntervalMin,IloIntervalMax].

Note
This member function notifies Concert Technology algorithms about this change of bound in the interval variable.

setIntensity

public void setIntensity(IloNumToNumStepFunction f, IloInt g=100) const

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.

Note
This member function notifies Concert Technology algorithms about the change of this interval variable.

setLengthMax

public void setLengthMax(IloInt max) const

This member function sets max as the maximal length value of the invoking interval variable.

Note
This member function notifies Concert Technology algorithms about this change of bound in the interval variable.

setLengthMin

public void setLengthMin(IloInt min) const

This member function sets min as the minimal length value of the invoking interval variable.

Note
This member function notifies Concert Technology algorithms about this change of bound in the interval variable.

setOptional

public void setOptional() const

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.

Note
This member function notifies Concert Technology algorithms about the change of this interval variable.

setPresent

public void setPresent() const

This member function specifies that the invoking interval variable must be present.

Note
This member function notifies Concert Technology algorithms about the change of this interval variable.

setSizeMax

public void setSizeMax(IloInt max) const

This member function sets max as the maximal size value of the invoking interval variable.

Note
This member function notifies Concert Technology algorithms about this change of bound in the interval variable.

setSizeMin

public void setSizeMin(IloInt min) const

This member function sets min as the minimal size value of the invoking interval variable.

Note
This member function notifies Concert Technology algorithms about this change of bound in the interval variable.

setStartMax

public void setStartMax(IloInt max) const

This member function sets max as the maximal start value of the invoking interval variable. The value must be in the range [IloIntervalMin,IloIntervalMax].

Note
This member function notifies Concert Technology algorithms about this change of bound in the interval variable.

setStartMin

public void setStartMin(IloInt min) const

This member function sets min as the minimal start value of the invoking interval variable. The value must be in the range [IloIntervalMin,IloIntervalMax].

Note
This member function notifies Concert Technology algorithms about this change of bound in the interval variable.