Skip to main content
FRAMES NO FRAMES

Class IlcIntervalVar

Definition file: ilcp/cpext.h
Include file: <ilcp/cpext.h>
Map of IlcIntervalVarIlcIntervalVarIlcIntervalVar
The class for representing interval variables.

An instance of this class is a constrained interval variable in the CP Optimizer engine. An instance of IlcIntervalVar can be retrieved from a Concert Technology instance of IloIntervalVar by using the member function IlcIntervalVar IloCPEngine::getInterval(const IloIntervalVar) const.

The member functions of this class give access to the domain of an optimizer engine interval variable. The domain of an interval variable is comprised of the domains for start, end, length, and size as well as the Boolean range for the presence. The member functions give access to the delta-domains and events for constraint propagation implementations. These members functions are available only during the search process of the optimizer engine.

For more information on interval variables and the search API for scheduling, see the concept Search API for scheduling in CP Optimizer.

See Also:

Method Summary
public IlcCPEnginegetCPEngine() const
public IlcIntgetEndMax() const
public IlcIntgetEndMin() const
public IlcIntgetLengthMax() const
public IlcIntgetLengthMin() const
public IlcIntgetOldEndMax() const
public IlcIntgetOldEndMin() const
public IlcIntgetOldLengthMax() const
public IlcIntgetOldLengthMin() const
public IlcIntgetOldSizeMax() const
public IlcIntgetOldSizeMin() const
public IlcIntgetOldStartMax() const
public IlcIntgetOldStartMin() const
public IlcIntgetSizeMax() const
public IlcIntgetSizeMin() const
public IlcIntgetStartMax() const
public IlcIntgetStartMin() const
public IlcBoolhasDeltaInterval() const
public IlcBoolhasDeltaPresence() const
public IlcBoolhasDeltaSize() const
public IlcBoolisAbsent() const
public IlcBoolisFixed() const
public IlcBoolisOldAbsent() const
public IlcBoolisOldPresent() const
public IlcBoolisPresenceFixed() const
public IlcBoolisPresent() const
public IlcBoolisSizeFixed() const
public voidsetAbsent() const
public voidsetEnd(IlcInt value) const
public voidsetEndMax(IlcInt max) const
public voidsetEndMin(IlcInt min) const
public voidsetLength(IlcInt value) const
public voidsetLengthMax(IlcInt max) const
public voidsetLengthMin(IlcInt min) const
public voidsetPresent() const
public voidsetSize(IlcInt value) const
public voidsetSizeMax(IlcInt max) const
public voidsetSizeMin(IlcInt min) const
public voidsetStart(IlcInt value) const
public voidsetStartMax(IlcInt max) const
public voidsetStartMin(IlcInt min) const
public voidwhenIntervalDomain(const IlcDemon d) const
public voidwhenPresence(const IlcDemon d) const
public voidwhenSize(const IlcDemon d) const
Method Detail

getCPEngine

public IlcCPEngine getCPEngine() const

This member function returns the instance of IlcCPEngine associated with the invoking instance of IlcIntervalVar.


getEndMax

public IlcInt getEndMax() const

This member function returns the current maximum of the domain of the end of the invoking instance of IlcIntervalVar. If the interval is absent, the value returned by this member function is meaningless.


getEndMin

public IlcInt getEndMin() const

This member function returns the current minimum of the domain of the end of the invoking instance of IlcIntervalVar. If the interval is absent, the value returned by this member function is meaningless.


getLengthMax

public IlcInt getLengthMax() const

This member function returns the current maximum of the domain of the length of the invoking instance of IlcIntervalVar. If the interval is absent, the value returned by this member function is meaningless.


getLengthMin

public IlcInt getLengthMin() const

This member function returns the current minimum of the domain of the length of the invoking instance of IlcIntervalVar. If the interval is absent, the value returned by this member function is meaningless.


getOldEndMax

public IlcInt getOldEndMax() const

This member function returns the maximum of the domain of the end of the invoking instance of IlcIntervalVar the last time the interval was processed by the propagation algorithm of the optimizer engine. If the interval was absent at that time, the value returned by this member function is meaningless.

This function can only be used in a propagation function: that is at the execution of a demon (instance of IlcDemonI) or the virtual member propagate of a constraint (instance of IlcConstraintI).


getOldEndMin

public IlcInt getOldEndMin() const

This member function returns the minimum of the domain of the end of the invoking instance of IlcIntervalVar the last time the interval was processed by the propagation algorithm of the optimizer engine. If the interval was absent at that time, the value returned by this member function is meaningless.

This function can only be used in a propagation function: that is at the execution of a demon (instance of IlcDemonI) or the virtual member propagate of a constraint (instance of IlcConstraintI).


getOldLengthMax

public IlcInt getOldLengthMax() const

This member function returns the maximum of the domain of the length of the invoking instance of IlcIntervalVar the last time the interval was processed by the propagation algorithm of the optimizer engine. If the interval was absent at that time, the value returned by this member function is meaningless.

This function can only be used in a propagation function: that is at the execution of a demon (instance of IlcDemonI) or the virtual member propagate of a constraint (instance of IlcConstraintI).


getOldLengthMin

public IlcInt getOldLengthMin() const

This member function returns the minimum of the domain of the length of the invoking instance of IlcIntervalVar the last time the interval was processed by the propagation algorithm of the optimizer engine. If the interval was absent at that time, the value returned by this member function is meaningless.

This function can only be used in a propagation function: that is at the execution of a demon (instance of IlcDemonI) or the virtual member propagate of a constraint (instance of IlcConstraintI).


getOldSizeMax

public IlcInt getOldSizeMax() const

This member function returns the maximum of the domain of the size of the invoking instance of IlcIntervalVar the last time the interval was processed by the propagation algorithm of the optimizer engine. If the interval was absent at that time, the value returned by this member function is meaningless.

This function can only be used in a propagation function: that is at the execution of a demon (instance of IlcDemonI) or the virtual member propagate of a constraint (instance of IlcConstraintI).


getOldSizeMin

public IlcInt getOldSizeMin() const

This member function returns the minimum of the domain of the size of the invoking instance of IlcIntervalVar the last time the interval was processed by the propagation algorithm of the optimizer engine. If the interval was absent at that time, the value returned by this member function is meaningless.

This function can only be used in a propagation function: that is at the execution of a demon (instance of IlcDemonI or the virtual member propagate of a constraint (instance of IlcConstraintI.


getOldStartMax

public IlcInt getOldStartMax() const

This member function returns the maximum of the domain of the start of the invoking instance of IlcIntervalVar the last time the interval was processed by the propagation algorithm of the optimizer engine. If the interval was absent at that time, the value returned by this member function is meaningless.

This function can only be used in a propagation function: that is at the execution of a demon (instance of IlcDemonI) or the virtual member propagate of a constraint (instance of IlcConstraintI).


getOldStartMin

public IlcInt getOldStartMin() const

This member function returns the minimum of the domain of the start of the invoking instance of IlcIntervalVar the last time the interval was processed by the propagation algorithm of the optimizer engine. If the interval was absent at that time, the value returned by this member function is meaningless.

This function can only be used in a propagation function: that is at the execution of a demon (instance of IlcDemonI or the virtual member propagate of a constraint (instance of IlcConstraintI.


getSizeMax

public IlcInt getSizeMax() const

This member function returns the currnet maximum of the domain of the size of the invoking instance of IlcIntervalVar. If the interval is absent, the value returned by this member function is meaningless.


getSizeMin

public IlcInt getSizeMin() const

This member function returns the current minimum of the domain of the size of the invoking instance of IlcIntervalVar. If the interval is absent, the value returned by this member function is meaningless.


getStartMax

public IlcInt getStartMax() const

This member function returns the current maximum of the domain of the start of the invoking instance of IlcIntervalVar. If the interval is absent, the value returned by this member function is meaningless.


getStartMin

public IlcInt getStartMin() const

This member function returns the current minimum of the domain of the start of the invoking instance of IlcIntervalVar. If the interval is absent, the value returned by this member function is meaningless.


hasDeltaInterval

public IlcBool hasDeltaInterval() const

This member function returns IlcTrue if the integer range of the start, end, or length of the invoking instance of IlcIntervalVar has changed since the last time the interval was processed by the propagation algorithm of the optimizer engine. Otherwise, it returns IlcFalse.

This function can only be used in a propagation function: that is at the execution of a demon (instance of IlcDemonI) or the virtual member propagate of a constraint (instance of IlcConstraintI).

Note
The invoking instance of IlcIntervalVar can be absent yet still have a delta interval.

hasDeltaPresence

public IlcBool hasDeltaPresence() const

This member function returns IlcTrue if the presence value of the invoking instance of IlcIntervalVar has changed since the last time the interval was processed by the propagation algorithm of the optimizer engine. Otherwise, it returns IlcFalse.

This function can only be used in a propagation function: that is at the execution of a demon (instance of IlcDemonI) or the virtual member propagate of a constraint (instance of IlcConstraintI).

Note
If the function returns IlcTrue, the presence of the invoking instance of IlcIntervalVar is fixed.

hasDeltaSize

public IlcBool hasDeltaSize() const

This member function returns IlcTrue if the integer range of the size of the invoking instance of IlcIntervalVar has changed since the last time the interval was processed by the propagation algorithm of the optimizer engine. Otherwise, it returns IlcFalse.

This function can only be used in a propagation function: that is at the execution of a demon (instance of IlcDemonI) or the virtual member propagate of a constraint (instance of IlcConstraintI).

Note
The invoking instance of IlcIntervalVar can be absent and yet still have a delta size.

isAbsent

public IlcBool isAbsent() const

This member function returns IlcTrue if the invoking instance of IlcIntervalVar is absent. Otherwise, it returns IlcFalse. Note that an absent interval is fixed.


isFixed

public IlcBool isFixed() const

This member function returns IlcTrue if the invoking instance of IlcIntervalVar is fixed, that is, if the interval is absent or present and the start and end (and implicitly the length and size) integer ranges of the invoking instance of IlcIntervalVar are fixed. Otherwise, it returns IlcFalse.


isOldAbsent

public IlcBool isOldAbsent() const

This member function returns IlcTrue if the invoking instance of IlcIntervalVar was absent the last time the interval was processed by the propagation algorithm of the optimizer engine.

This function can only be used in a propagation function: that is at the execution of a demon (instance of IlcDemonI) or the virtual member propagate of a constraint (instance of IlcConstraintI).


isOldPresent

public IlcBool isOldPresent() const

This member function returns IlcTrue if the invoking instance of IlcIntervalVar was present the last time the interval was processed by the propagation algorithm of the optimizer engine.

This function can only be used in a propagation function: that is at the execution of a demon (instance of IlcDemonI) or the virtual member propagate of a constraint (instance of IlcConstraintI).


isPresenceFixed

public IlcBool isPresenceFixed() const

This member function returns IlcTrue if the presence of the invoking instance of IlcIntervalVar is fixed, that is, if the interval is present or absent. Otherwise, it returns IlcFalse.


isPresent

public IlcBool isPresent() const

This member function returns IlcTrue if the invoking instance of IlcIntervalVar is present. Otherwise, it returns IlcFalse.


isSizeFixed

public IlcBool isSizeFixed() const

This member function returns IlcTrue if the integer range of the size of the invoking instance of IlcIntervalVar is fixed or empty (empty indicates an absent interval). Otherwise, it returns IlcFalse.


setAbsent

public void setAbsent() const

This member function sets as absent the invoking instance of IlcIntervalVar, if not already absent. If the presence Boolean range becomes empty, such as if the interval is present, then a failure is raised from the optimizer engine. Otherwise, a presence domain event is created. The effects of this member function are reversible.


setEnd

public void setEnd(IlcInt value) const

This member function sets the value of the end range of the invoking instance of IlcIntervalVar to the integer argument value. If the interval is absent, no changes occur (due to the monotonicity of the CP Optimizer engine). If the end range becomes empty, the interval is set to be absent. Otherwise, an interval domain event is created. The effects of this member function are reversible.


setEndMax

public void setEndMax(IlcInt max) const

This member function sets the maximum of the end range of the invoking instance of IlcIntervalVar to the integer argument max. If max is greater than the current maximum of the end range or if the interval is absent, no changes occur (due to the monotonicity of the optimizer engine). If the end range becomes empty, the interval is set to be absent. Otherwise, an interval domain event is created. The effects of this member function are reversible.


setEndMin

public void setEndMin(IlcInt min) const

This member function sets the minimum of the end range of the invoking instance of IlcIntervalVar to the integer argument min. If min is less than the current minimum of the end range or if the interval is absent, no changes occur (due to the monotonicity of the optimizer engine). If the end range becomes empty, the interval is set to be absent. Otherwise, an interval domain event is created. The effects of this member function are reversible.


setLength

public void setLength(IlcInt value) const

This member function sets the value of the length range of the invoking instance of IlcIntervalVar to the integer argument value. If the interval is absent, no changes occur (due to the monotonicity of the optimizer engine). If the length range becomes empty, the interval is set to be absent. Otherwise, an interval domain event is created. The effects of this member function are reversible.


setLengthMax

public void setLengthMax(IlcInt max) const

This member function sets the maximum of the length range of the invoking instance of IlcIntervalVar to the integer argument max. If max is greater than the current maximum of the length range or if the interval is absent, no changes occur (due to the monotonicity of the optimizer engine). If the length range becomes empty, the interval is set to be absent. Otherwise, an interval domain event is created. The effects of this member function are reversible.


setLengthMin

public void setLengthMin(IlcInt min) const

This member function sets the minimum of the length range of the invoking instance of IlcIntervalVar to the integer argument min. If min is less than the current minimum of the length range or if the interval is absent, no changes occur (due to the monotonicity of the optimizer engine). If the length range becomes empty, the interval is set to be absent. Otherwise, an interval domain event is created. The effects of this member function are reversible.


setPresent

public void setPresent() const

This member function sets as present the invoking instance of IlcIntervalVar, if not already present. If the presence Boolean range becomes empty, such as if the interval is absent, then a failure is raised from the optimizer engine. Otherwise, a presence domain event is created. The effects of this member function are reversible.


setSize

public void setSize(IlcInt value) const

This member function sets the value of the size range of the invoking instance of IlcIntervalVar to the integer argument value. If the interval is absent, no changes occur (due to the monotonicity of the optimizer engine). If the size range becomes empty, the interval is set to be absent. Otherwise, a size domain event is created (or an interval domain event if the length and size are equal). The effects of this member function are reversible.


setSizeMax

public void setSizeMax(IlcInt max) const

This member function sets the maximum of the size range of the invoking instance of IlcIntervalVar to the integer argument max. If max is greater than the current maximum of the size range or if the interval is absent, no changes occur (due to the monotonicity of the optimizer engine). If the size range becomes empty, the interval is set to be absent. Otherwise, a size domain event is created (or an interval domain event the if length and size are equal). The effects of this member function are reversible.


setSizeMin

public void setSizeMin(IlcInt min) const

This member function sets the minimum of the size range of the invoking instance of IlcIntervalVar to the integer argument min. If min is less than the current minimum of the size range or if the interval is absent, no changes occur (due to the monotonicity of the optimizer engine). If the size range becomes empty, the interval is set to be absent. Otherwise, a size domain event is created (or an interval domain event if the length and size are equal). The effects of this member function are reversible.


setStart

public void setStart(IlcInt value) const

This member function sets the value of the start range of the invoking instance of IlcIntervalVar to the integer argument value. If the interval is absent, no changes occur (due to the monotonicity of the optimizer engine). If the start range becomes empty, the interval is set to be absent. Otherwise, an interval domain event is created. The effects of this member function are reversible.


setStartMax

public void setStartMax(IlcInt max) const

This member function sets the maximum of the start range of the invoking instance of IlcIntervalVar to the integer argument max. If max is greater than the current maximum of the start range or if the interval is absent, no changes occur (due to the monotonicity of the optimizer engine). If the start range becomes empty, the interval is set to be absent. Otherwise, an interval domain event is created. The effects of this member function are reversible.


setStartMin

public void setStartMin(IlcInt min) const

This member function sets the minimum of the start range of the invoking instance of IlcIntervalVar to the integer argument min. If min is less than the current minimum of the start range or if the interval is absent, no changes occur (due to the monotonicity of the optimizer engine). If the start range becomes empty, the interval is set to be absent. Otherwise, an interval domain event is created. The effects of this member function are reversible.


whenIntervalDomain

public void whenIntervalDomain(const IlcDemon d) const

This member function associates the demon d with the interval domain event on the invoking instance of IlcIntervalVar. Whenever the invoking interval has its start, end, or length integer ranges reduced, the demon will be executed.

Since a constraint is also a demon, a constraint can also be passed as an argument to this member function. Whenever the invoking interval has its start, end, or length integer ranges reduced, the constraint will be propagated.

This member function can only be used during the posting of a constraint.


whenPresence

public void whenPresence(const IlcDemon d) const

This member function associates the demon d with the presence domain event (when the interval becomes present or absent) of the invoking instance of IlcIntervalVar. Whenever the invoking interval variable has its presence fixed, the demon will be executed.

Since a constraint is also a demon, a constraint can also be passed as an argument to this member function. Whenever the invoking interval has its presence fixed, the constraint will be propagated.

This member function can only be used during the posting of a constraint.


whenSize

public void whenSize(const IlcDemon d) const

This member function associates the demon d with the size domain event on the invoking instance of IlcIntervalVar. Whenever the size integer range of the invoking interval variable reduced, the demon will be executed.

Since a constraint is also a demon, a constraint can also be passed as an argument to this member function. Whenever the invoking interval has its size integer range reduced, the constraint will be propagated.

This member function can only be used during the posting of a constraint.