FRAMES NO FRAMES

Class IlcIntTimetable

Definition file: ilsched/timetabh.h
Include file: <ilsched/ilsched.h>

An instance of the handle class IlcIntTimetable represents a capacity timetable. In Scheduler Engine, capacity timetables are used to manage the capacity of resources, both the capacity already used and the capacity remaining.

A timetable is defined over an interval, [timeMin, timeMax), where timeMin is the origin of the timetable and timeMax is its horizon. In addition to the origin and horizon, you may optionally indicate the period of the timetable. The period must be a positive integer, and furthermore, the size of the interval (that is, timeMax - timeMin) must be an integer multiple of the period. If a period is specified, then the values managed by the timetable can change only at times indicated by timeMin + i * period.

For each point in time in its interval, a capacity timetable retains a minimal and maximal integer value. The minimal value retained for a point in time indicates the capacity that has already been used; the difference between the minimal and maximal value indicates the remaining capacity at that time.

Member functions of this class let you consult or modify these minimal and maximal values. These values may change only monotonically; that is, minimal values cannot decrease, and maximal values cannot increase.

Two types of propagation events can be triggered when a capacity timetable is modified. An event of type rangeInterval indicates that there are some times at which some modification of minimal or maximal values occurred. An event of type valueInterval indicates that there are some times at which the minimal value became equal to the maximal value. In order to perform propagation, member functions allow you to associate demons with each type of event.

The information stored into a timetable is reversible. In particular, when modifiers are called, the state before their call will be saved by Solver.

For more information, see Timetable.

See Also:

Constructor Summary
public IlcIntTimetable()
public IlcIntTimetable(IlcCapTimetableI * impl)
public IlcIntTimetable(IlcSchedule, IlcInt timeMin, IlcInt timeMax, IlcInt period=1, IlcInt min=IlcIntMin, IlcInt max=IlcIntMax)
Method Summary
public IlcCapTimetableI *getImpl() const
public IlcIntgetMax(IlcInt time) const
public IlcIntgetMaxMax(IlcInt timeMin, IlcInt timeMax) const
public IlcIntgetMaxMin(IlcInt timeMin, IlcInt timeMax) const
public IlcIntgetMin(IlcInt time) const
public IlcIntgetMinMax(IlcInt timeMin, IlcInt timeMax) const
public IlcIntgetMinMin(IlcInt timeMin, IlcInt timeMax) const
public const char *getName() const
public IlcAnygetObject() const
public IlcIntgetPeriod() const
public IlcIntgetRangeTimeMax() const
public IlcIntgetRangeTimeMin() const
public IloSolvergetSolver() const
public IloSolverI *getSolverI() const
public IlcIntgetTimeMax() const
public IlcIntgetTimeMin() const
public IlcIntgetValue(IlcInt time) const
public IlcIntgetValueTimeMax() const
public IlcIntgetValueTimeMin() const
public IlcBoolisBound(IlcInt time) const
public voidoperator=(const IlcIntTimetable & h)
public voidsetMax(IlcInt timeMin, IlcInt timeMax, IlcInt max)
public voidsetMin(IlcInt timeMin, IlcInt timeMax, IlcInt min)
public voidsetName(const char * name) const
public voidsetObject(IlcAny object) const
public voidsetValue(IlcInt timeMin, IlcInt timeMax, IlcInt value)
public voidwhenRangeInterval(const IlcDemon c) const
public voidwhenValueInterval(const IlcDemon c) const
Constructor Detail

IlcIntTimetable

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

IlcIntTimetable

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

IlcIntTimetable

public IlcIntTimetable(IlcSchedule, IlcInt timeMin, IlcInt timeMax, IlcInt period=1, IlcInt min=IlcIntMin, IlcInt max=IlcIntMax)

This constructor creates a timetable to manage an integer quantity (the capacity) whose value at all times is bounded between min and max. The constructor adds that timetable to those managed by the schedule. The timetable starts at timeMin and extends to timeMax, divided into equal periods of size period.

An instance of IloSolver::SolverErrorException is thrown if any of the following conditions occur:


Method Detail

getImpl

public IlcCapTimetableI * getImpl() const
This constructor creates an object by copying another one. This constructor creates an object by copying another one. This member function returns a pointer to the implementation object of the invoking handle.

getMax

public IlcInt getMax(IlcInt time) const

This member function returns the maximum value at time of the invoking timetable. The difference between this maximum and the minimum value at time (returned by the member function IlcIntTimetable::getMin) indicates the remaining capacity at time.


getMaxMax

public IlcInt getMaxMax(IlcInt timeMin, IlcInt timeMax) const

This member function returns the largest of the maximal values of the integer quantity managed by the invoking timetable. Only those maximal values that correspond to times in the interval [timeMin timeMax) are considered. An error ("bad index interval") is raised if the invoking timetable does not cover the interval [timeMin, timeMax) or if timeMin is strictly greater than timeMax.


getMaxMin

public IlcInt getMaxMin(IlcInt timeMin, IlcInt timeMax) const

This member function returns the largest of the minimal values of the integer quantity managed by the invoking timetable. Only those minimal values that correspond to times in the interval [timeMin timeMax) are considered. An error ("bad index interval") is raised if the invoking timetable does not cover the interval [timeMin, timeMax) or if timeMin is strictly greater than timeMax.


getMin

public IlcInt getMin(IlcInt time) const

This member function returns the minimum value at time of the invoking timetable. This minimum value at time indicates the capacity that has already been used at time.


getMinMax

public IlcInt getMinMax(IlcInt timeMin, IlcInt timeMax) const

This member function returns the least of the maximal values of the integer quantity managed by the invoking timetable. Only those maximal values that correspond to times in the interval [timeMin timeMax) are considered. An error ("bad index interval") is raised if the invoking timetable does not cover the interval [timeMin, timeMax) or if timeMin is strictly greater than timeMax.


getMinMin

public IlcInt getMinMin(IlcInt timeMin, IlcInt timeMax) const

This member function returns the least of the minimal values of the integer quantity managed by the invoking timetable. Only those minimal values that correspond to times in the interval [timeMin timeMax) are considered. An error ("bad index interval") is raised if the invoking timetable does not cover the interval [timeMin, timeMax) or if timeMin is strictly greater than timeMax.


getName

public const char * getName() const
This member function returns the name of the invoking object.

getObject

public IlcAny getObject() const
This member function returns a pointer to the external object associated with the invoking object, if there is such an association. It returns 0 (zero) otherwise.

getPeriod

public IlcInt getPeriod() const

This member function returns the size of the periods of the invoking timetable. The meaning of this size is that the timetable may change only at times representing the beginning of periods, that is, times of the form (getTimeMin() + i * getPeriod()).


getRangeTimeMax

public IlcInt getRangeTimeMax() const

When it is called during the execution of a demon associated with a timetable by the member function IlcIntTimetable::whenRangeInterval, this member function returns the time rangeTimeMax, that is, the maximum of the interval [rangeTimeMin, rangeTimeMax) containing all the times at which a modification of the values occurred. The return value of this member function is not meaningful outside the execution of a demon associated with the timetable by the member function IlcIntTimetable::whenRangeInterval.


getRangeTimeMin

public IlcInt getRangeTimeMin() const

When it is called during the execution of a demon associated with a timetable by the member function IlcIntTimetable::whenRangeInterval, this member function returns the time rangeTimeMin, that is, the minimum of the interval [rangeTimeMin, rangeTimeMax) containing all the times at which a modification of the values occurred. The return value of this member function is not meaningful outside the execution of a demon associated with the timetable by the member function IlcIntTimetable::whenRangeInterval.


getSolver

public IloSolver getSolver() const

This member function returns an instance of IloSolver associated with the invoking object.


getSolverI

public IloSolverI * getSolverI() const

This member function returns a pointer to the implementation object of the solver where the invoking object was extracted.


getTimeMax

public IlcInt getTimeMax() const

This member function returns the time horizon of the invoking timetable.


getTimeMin

public IlcInt getTimeMin() const

This member function returns the time origin of the invoking timetable.


getValue

public IlcInt getValue(IlcInt time) const

This member function returns the value of the invoking timetable at time. An instance of IloSolver::SolverErrorException is thrown if the timetable is not bound at time.


getValueTimeMax

public IlcInt getValueTimeMax() const

When it is called during the execution of a demon associated with a timetable by the member function IlcIntTimetable::whenValueInterval, this member function returns the time valueTimeMax, that is, the maximum of the interval [valueTimeMin, valueTimeMax) containing all the times at which the minimal value has become equal to the maximal value. The return value of this member function is not meaningful outside the execution of a demon associated with the timetable by the member function IlcIntTimetable::whenValueInterval.


getValueTimeMin

public IlcInt getValueTimeMin() const

When it is called during the execution of a demon associated with a timetable by the member function IlcIntTimetable::whenValueInterval, this member function returns the time valueTimeMin, that is, the minimum of the interval [valueTimeMin, valueTimeMax) containing all the times at which the minimal value has become equal to the maximal value. The return value of this member function is not meaningful outside the execution of a demon associated with the timetable by the member function IlcIntTimetable::whenValueInterval.


isBound

public IlcBool isBound(IlcInt time) const

This member function returns IlcTrue if the invoking timetable is bound to a value at time. Otherwise, it returns IlcFalse.


operator=

public void operator=(const IlcIntTimetable & h)
This operator assigns an address to the handle pointer of the invoking object. That address is the location of the implementation object of the provided argument.

setMax

public void setMax(IlcInt timeMin, IlcInt timeMax, IlcInt max)

This member function allows you to modify the maximal values of the integer quantity managed by the invoking timetable. At every time t, the new maximal value becomes max, provided that max is less than the current maximal value of t. The maximal value of t remains unchanged if max is greater than the current maximal value of t. A failure is generated if there is some time t for which max is strictly less than the minimal value of t. The maximal values are modified only for the times belonging to the interval [timeMin, timeMax).

An instance of IloSolver::SolverErrorException is thrown (bad index interval) if the invoking timetable does not cover the interval [timeMin, timeMax) or if timeMin is strictly greater than timeMax.


setMin

public void setMin(IlcInt timeMin, IlcInt timeMax, IlcInt min)

This member function allows you to modify the minimal values of the integer quantity managed by the invoking timetable. At every time t, the new minimal value becomes min, provided that min is greater than the current minimal value in t. The minimal value in t remains unchanged if min is less than the current minimal value of t. A failure is generated if there is some time t for which min is strictly greater than the maximal value of t. The minimal values are modified only for the times belonging to the interval [timeMin, timeMax).

An instance of IloSolver::SolverErrorException is thrown (bad index interval) if the invoking timetable does not cover the interval [timeMin, timeMax) or if timeMin is strictly greater than timeMax.


setName

public void setName(const char * name) const
This member function sets the name of the invoking object to a copy of name. This assignment is a reversible action.

setObject

public void setObject(IlcAny object) const
This member function establishes a link between the invoking object and an external object of which the invoking object might be a data member.

setValue

public void setValue(IlcInt timeMin, IlcInt timeMax, IlcInt value)

This member function allows you to set the value of the integer quantity managed by the invoking timetable. Then for every value t on the interval [timeMin, timeMax), both the minimal and the maximal values in t become equal to value. A failure is generated if there is some time t for which value is strictly less than the current minimal value of t or strictly greater than the current maximal value of t.

An instance of IloSolver::SolverErrorException is thrown (bad index interval) if the given times timeMin and timeMax do not belong to the interval of the invoking timetable or if timeMin is strictly greater than timeMax.


whenRangeInterval

public void whenRangeInterval(const IlcDemon c) const

This member function associates the demon d with the rangeInterval propagation event of the invoking timetable. Whenever a rangeInterval propagation event occurs, demon d is executed.

Since a constraint is also a demon, a constraint can also be passed as an argument to this member function. Whenever a rangeInterval propagation event occurs, the constraint will be posted and propagated.

A call to the demon d signifies that there are some times at which a modification of the values occurred. The interval [rangeTimeMin, rangeTimeMax) is the least interval containing all these times.


whenValueInterval

public void whenValueInterval(const IlcDemon c) const

This member function associates the demon d with the valueInterval propagation event of the invoking timetable. Whenever a valueInterval propagation event occurs, the demon d is executed.

Since a constraint is also a demon, a constraint can also be passed as an argument to this member function. Whenever a valueInterval propagation event occurs, the constraint will be posted and propagated.

A call to the demon d signifies that there are some times at which the minimal value became equal to the maximal value. The interval [valueTimeMin, valueTimeMax) is the least interval containing all these times.