Overview | Group | Tree | Graph | Index | Concepts |
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:
IlcAnyTimetableCursor, IlcAnyTimetableIterator, IlcIntTimetable, IlcStateResource
Constructor and Destructor Summary | |
---|---|
public | IlcAnyTimetable(IlcSchedule, const IlcAnySet states, IlcInt timeMin, IlcInt timeMax, IlcInt period=1) |
Method Summary | |
---|---|
public IlcInt | getDomainTimeMax() const |
public IlcInt | getDomainTimeMin() const |
public IlcManager | getManager() const |
public const char * | getName() const |
public IlcAny | getObject() const |
public IlcInt | getPeriod() const |
public IlcInt | getTimeMax() const |
public IlcInt | getTimeMin() const |
public IlcAny | getValue(IlcInt time) const |
public IlcInt | getValueTimeMax() const |
public IlcInt | getValueTimeMin() const |
public IlcBool | isAlwaysPossible(IlcAny state, IlcInt timeMin, IlcInt timeMax) const |
public IlcBool | isAlwaysRequired(IlcAny state, IlcInt timeMin, IlcInt timeMax) const |
public IlcBool | isBound(IlcInt time) const |
public IlcBool | isEverPossible(IlcAny state, IlcInt timeMin, IlcInt timeMax) const |
public IlcBool | isEverRequired(IlcAny state, IlcInt timeMin, IlcInt timeMax) const |
public IlcBool | isPossible(IlcAny state, IlcInt time) const |
public IlcBool | isRequired(IlcAny state, IlcInt time) const |
public void | removePossibleStates(IlcInt timeMin, IlcInt timeMax, const IlcAnySet states) |
public void | removeState(IlcInt timeMin, IlcInt timeMax, IlcAny state) |
public void | setName(const char * name) |
public void | setObject(IlcAny object) |
public void | setPossibleStates(IlcInt timeMin, IlcInt timeMax, const IlcAnySet states) |
public void | setState(IlcInt timeMin, IlcInt timeMax, IlcAny state) |
public void | whenDomainInterval(const IlcDemon c) const |
public void | whenValueInterval(const IlcDemon c) const |
Constructor and Destructor Detail |
---|
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:
timeMax - timeMin
is not strictly positive;
period
is not strictly positive;
timeMax - timeMin
is not an integer multiple of period
.Method Detail |
---|
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.
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.
This member function returns the manager (a handle) of the invoking timetable.
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.
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.
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())
.
This member function returns the time horizon of the invoking timetable.
This member function returns the time origin of the invoking timetable.
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
.
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.
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.
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
.
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
.
This member function returns IlcTrue
if the invoking
timetable is bound to a value at time
. Otherwise, it returns
IlcFalse
.
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
.
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
.
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
.
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
.
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.
This member function states that the invoking timetable must not be in
the given state
at any time in the interval [timeMin
timeMax)
.
This member function sets the name of the invoking timetable to a copy of
the given name
.
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.
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.
This member function states that the invoking timetable must be in the
given state
at all times in the interval [timeMin,
timeMax)
.
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.
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.