FRAMES NO FRAMES

Class IlcAnyTimetable

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

An instance of the handle class IlcAnyTimetable represents a timetable in which the values are pointers to arbitrary objects (rather than integers). In the Scheduler Engine, these timetables are used to manage the states of resources.

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.

Two types of propagation events can be triggered when this kind of timetable is modified. An event of type domainInterval indicates that there are some times at which some modification of the domain occurred. An event of type valueInterval indicates that there are some times at which the value became bound. 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 and Destructor Summary
public IlcAnyTimetable(IlcSchedule, const IlcAnySet states, IlcInt timeMin, IlcInt timeMax, IlcInt period=1)
Method Summary
public IlcIntgetDomainTimeMax() const
public IlcIntgetDomainTimeMin() const
public IlcManagergetManager() const
public const char *getName() const
public IlcAnygetObject() const
public IlcIntgetPeriod() const
public IlcIntgetTimeMax() const
public IlcIntgetTimeMin() const
public IlcAnygetValue(IlcInt time) const
public IlcIntgetValueTimeMax() const
public IlcIntgetValueTimeMin() const
public IlcBoolisAlwaysPossible(IlcAny state, IlcInt timeMin, IlcInt timeMax) const
public IlcBoolisAlwaysRequired(IlcAny state, IlcInt timeMin, IlcInt timeMax) const
public IlcBoolisBound(IlcInt time) const
public IlcBoolisEverPossible(IlcAny state, IlcInt timeMin, IlcInt timeMax) const
public IlcBoolisEverRequired(IlcAny state, IlcInt timeMin, IlcInt timeMax) const
public IlcBoolisPossible(IlcAny state, IlcInt time) const
public IlcBoolisRequired(IlcAny state, IlcInt time) const
public voidremovePossibleStates(IlcInt timeMin, IlcInt timeMax, const IlcAnySet states)
public voidremoveState(IlcInt timeMin, IlcInt timeMax, IlcAny state)
public voidsetName(const char * name)
public voidsetObject(IlcAny object)
public voidsetPossibleStates(IlcInt timeMin, IlcInt timeMax, const IlcAnySet states)
public voidsetState(IlcInt timeMin, IlcInt timeMax, IlcAny state)
public voidwhenDomainInterval(const IlcDemon c) const
public voidwhenValueInterval(const IlcDemon c) const
Constructor and Destructor Detail

IlcAnyTimetable

public IlcAnyTimetable(IlcSchedule, const IlcAnySet states, IlcInt timeMin, IlcInt timeMax, IlcInt period=1)

This constructor creates a timetable to manage a set of states over the interval [timeMin, timeMax). The constructor adds that timetable to those managed by 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

getDomainTimeMax

public IlcInt getDomainTimeMax() const

When it is called during the execution of a demon associated with the invoking timetable by the member function IlcAnyTimetable::whenDomainInterval, this member function returns the time domainTimeMax, that is, the maximum of the interval [domainTimeMin, domainTimeMax) containing all the times at which the domain has changed. The return value of this member function is not meaningful outside the execution of such a demon.


getDomainTimeMin

public IlcInt getDomainTimeMin() const

When it is called during the execution of a demon associated with the invoking timetable by the member function IlcAnyTimetable::whenDomainInterval, this member function returns the time domainTimeMin, that is, the minimum of the interval [domainTimeMin, domainTimeMax) containing all the times at which the domain has changed. The return value of this member function is not meaningful outside the execution of such a demon.


getManager

public IlcManager getManager() const

This member function returns the manager (a handle) of the invoking timetable.


getName

public const char * getName() const

This member function returns a pointer to the name of the invoking timetable. If the invoking timetable has no name, then this function returns the empty string.


getObject

public IlcAny getObject() const

An instance of the class IlcAnyTimetable may be a data member of another "external" object. In such a case, it may be useful to find the external object from the instance of IlcAnyTimetable. The member function getObject accesses such an inverse link.

In fact, this member function returns a pointer to the external object associated with the invoking object, if there is such an association. It returns the null pointer 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()).


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 IlcAny getValue(IlcInt time) const

This member function returns the value at time of the invoking timetable. 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 IlcAnyTimetable::whenValueInterval, this member function returns the time valueTimeMax, that is, the maximum of the interval [valueTimeMin, valueTimeMax) containing all the times at which the value has been bound. The return value of this member function is not meaningful outside the execution of such a demon.


getValueTimeMin

public IlcInt getValueTimeMin() const

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


isAlwaysPossible

public IlcBool isAlwaysPossible(IlcAny state, IlcInt timeMin, IlcInt timeMax) const

This member function returns IlcTrue if it is possible for the invoking timetable to be in the given state over the entire interval [timeMin, timeMax). Otherwise, it returns IlcFalse.


isAlwaysRequired

public IlcBool isAlwaysRequired(IlcAny state, IlcInt timeMin, IlcInt timeMax) const

This member function returns IlcTrue if it is certain that the invoking timetable is in the given state over the entire interval [timeMin, timeMax). Otherwise, it returns IlcFalse.


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.


isEverPossible

public IlcBool isEverPossible(IlcAny state, IlcInt timeMin, IlcInt timeMax) const

This member function returns IlcTrue if it is possible that the invoking timetable is in the given state at some point in the interval [timeMin, timeMax). Otherwise, it returns IlcFalse.


isEverRequired

public IlcBool isEverRequired(IlcAny state, IlcInt timeMin, IlcInt timeMax) const

This member function returns IlcTrue if it is certain that the invoking timetable is in the given state at some point in the interval [timeMin, timeMax). Otherwise, it returns IlcFalse.


isPossible

public IlcBool isPossible(IlcAny state, IlcInt time) const

This member function returns IlcTrue if it is possible that the invoking timetable is in the given state at the given time. Otherwise, it returns IlcFalse.


isRequired

public IlcBool isRequired(IlcAny state, IlcInt time) const

This member function returns IlcTrue if it is certain that the invoking timetable is in the given state the time indicated by time. Otherwise, it returns IlcFalse.


removePossibleStates

public void removePossibleStates(IlcInt timeMin, IlcInt timeMax, const IlcAnySet states)

This member function states that the invoking timetable must not be in any of the given states at any time in the interval [timeMin, timeMax). The set of "impossible" states must be provided as an instance of IlcAnySet. That class is documented in the Solver Reference Manual.


removeState

public void removeState(IlcInt timeMin, IlcInt timeMax, IlcAny state)

This member function states that the invoking timetable must not be in the given state at any time in the interval [timeMin timeMax).


setName

public void setName(const char * name)

This member function sets the name of the invoking timetable to a copy of the given name.


setObject

public void setObject(IlcAny object)

It is possible to associate an object (other than the implementation object) with a handle by means of this member function. If the invoking handle has no associated object, then object becomes the associated object. If the invoking handle already has an associated object, an instance of IloSolver::SolverErrorException is thrown. The argument object must not be the null pointer; otherwise, an instance of IloSolver::SolverErrorException is thrown.


setPossibleStates

public void setPossibleStates(IlcInt timeMin, IlcInt timeMax, const IlcAnySet states)

This member function states that the invoking timetable must be in any of the given states at all times in the interval [timeMin, timeMax). The set of possible states must be provided as an instance of IlcAnySet. That class is documented in the Solver Reference Manual.


setState

public void setState(IlcInt timeMin, IlcInt timeMax, IlcAny state)

This member function states that the invoking timetable must be in the given state at all times in the interval [timeMin, timeMax).


whenDomainInterval

public void whenDomainInterval(const IlcDemon c) const

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

Since a constraint is also a demon, a constraint can also be passed as an argument to this member function. Whenever a domain propagation event or a series of such events occurs, the constraint is propagated.

A call to the demon signifies that there are some times at which the domain has changed. (The domain changes whenever a state is removed from the possible set of states.) The interval [domainTimeMin, domainTimeMax) is the least interval containing all these times.


whenValueInterval

public void whenValueInterval(const IlcDemon c) const

This member function associates the demon c with the valueInterval propagation event of the invoking timetable. Whenever a valueInterval propagation event occurs, the demon 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 is propagated.

A call to the demon signifies that there are some times at which the value has been bound. (A value is bound when its set of possible states is reduced to one state.) The interval [valueTimeMin, valueTimeMax) is the least interval containing all these times.