Overview | Group | Tree | Graph | Index | Concepts |
An instance of the class IlcStateResource
represents a
resource of infinite capacity, the state of which can vary over
time. Each activity may, throughout its execution, require a state resource
to be in a given state (or in any of a given set of states). Consequently,
two activities may not overlap if they require incompatible states during
their execution. Two methods—similar to those used for discrete and
unary resources—are available to take into account the constraints
concerning the requirement or the provision of a state resource.
For state resources, you can define transition times with the second method.
State
In the context of an instance of IlcStateResource
, a
state is defined as a pointer to any type of object (that is, a
pointer of type IlcAny
). The class IlcAnyTimetable
is used to represent the evolution
of the state of the resource over time.
Printing or Displaying State Resources
The printed representation of an instance of the class
IlcStateResource
consists of its name, followed by a list of
states. If there are more than 10 states, only the number of states is
displayed.
For example:
[0x1, 0x2, 0x3]
represents a state resource whose possible
states are the ones represented by the pointers 0x1
,
0x2
, and 0x3
.
[12 possible states]
represents a state resource whose
number of possible states is equal to 12.
If the Solver trace is active and the resource is not named, the string
"IlcStateResource"
is followed by the address of the
implementation object. The address will be enclosed in parentheses.
Special Considerations for State Resources: Limitations of Disjunctive Constraints
Throughout this explanation, we have assumed that each activity which requires a state resource requires it in the same state (either a constant or a Solver variable) from the beginning to the end of its execution.
In addition, an activity may require a state resource in any of a given set of states, and yet allow the state to change during the execution of the activity, provided that it remains in the given set. Similarly, an activity may simply require the state resource not to be in a given state (or in any of a given set of states) throughout its execution.
A disjunctive constraint cannot manage these cases as well as a timetable.
For example, assume three activities A, B, and C intersect in time. Assume the resource constraints are as follows:
In such a case, the disjunctive constraint fails to detect the incompatibility of the three constraints because any two of these constraints are fully compatible.
In contrast, the timetable mechanism perfectly detects the incompatibility because the variable representing the state of the resource at the time at which the three activities intersect can assume no value. A disjunctive constraint may still be useful in such a case, as a redundant constraint for activities requiring only a state, or to take transition times into account.
More precisely, there are two types of resource constraints that can be posted to insist that an activity requires a state resource:
IlcActivity::requires
means that the activity requires the
resource in a state or given set of states that cannot change during the
execution of the activity (the state or states may be a Solver variable, but
this variable has to be instantiated in a solution to the problem under
consideration).IlcActivity::requiresNot
means that the activity requires the
resource not to be in a given state or given set of states (which can be a
Solver variable); in other words, the state of the resource can change
during the execution of the activity, but must never be the given
state.As explained before, a disjunctive constraint deals perfectly with
constraints of the type requires
. A disjunctive constraint
deals imperfectly with constraints of the type
requiresNot
. Instead, a timetable is needed to deal with such
constraints.
For more information, see Ranking , Disjunctive Constraint, Timetable, and Transition Time in Scheduler Engine.
See Also:
IlcAnyTimetable, IlcResource, IlcResourceConstraint, IlcStateResourceIterator
Constructor Summary | |
---|---|
public | IlcStateResource() |
public | IlcStateResource(IlcStateResourceI * impl) |
public | IlcStateResource(IlcSchedule schedule, IlcAnySet states, IlcBool timeTable=IlcTrue) |
public | IlcStateResource(IlcSchedule schedule, IlcAnySet states, IlcTransitionTimeObject ttobj, IlcBool disjAndTimetable=IlcTrue) |
Method Summary | |
---|---|
public IlcStateResourceI * | getImpl() const |
public IlcAny | getState(IlcInt time) const |
public IlcAnyTimetable | getTimetable() const |
public IlcAnyTimetable | getTimetable(IlcInt time) const |
public IlcConstraint | getTypeTimetableConstraint() const |
public IlcBool | hasTypeTimetableConstraint() const |
public IlcBool | isAlwaysInUse(IlcInt timeMin, IlcInt timeMax) 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 | isEverInUse(IlcInt timeMin, IlcInt timeMax) const |
public IlcBool | isEverPossible(IlcAny state, IlcInt timeMin, IlcInt timeMax) const |
public IlcBool | isEverRequired(IlcAny state, IlcInt timeMin, IlcInt timeMax) const |
public IlcBool | isInUse(IlcInt time) const |
public IlcBool | isPossible(IlcAny state, IlcInt time) const |
public IlcBool | isRequired(IlcAny state, IlcInt time) const |
public IlcConstraint | makeDisjunctiveConstraint() |
public IlcConstraint | makeTimetableConstraint(IlcInt timeMin, IlcInt timeMax, IlcInt timeStep, IlcAnySet states) |
public IlcConstraint | makeTimetableConstraint(IlcInt timeStep=1) |
public IlcConstraint | makeTypeTimetableConstraint(IlcBool useBatch=IlcFalse) |
public void | operator=(const IlcStateResource & h) |
public void | removePossibleStates(IlcInt timeMin, IlcInt timeMax, IlcAnySet states) |
public void | removeState(IlcInt timeMin, IlcInt timeMax, IlcAny state) |
public void | setMustBeInUse(IlcInt timeMin, IlcInt timeMax) |
public void | setPossibleStates(IlcInt timeMin, IlcInt timeMax, IlcAnySet states) |
public void | setState(IlcInt timeMin, IlcInt timeMax, IlcAny state) |
Constructor Detail |
---|
This constructor creates a new instance of IlcStateResource
and adds it to the set of resources managed in the given
schedule
. The argument states
is the set of
pointers that can be accepted as possible states for the resource. The
argument timeTable
indicates whether the standard timetable
constraint manages the profile of possible states of the resource from the
time origin to the time horizon of the given schedule
; if so,
it allows this set of possible states to change at any point in time; that
is, it defines a time step of 1 (one).
This constructor creates a new instance of IlcStateResource
and adds it to the set of resources managed in the given
schedule
. The argument states
is the set of
pointers that can be accepted as possible states for the resource. The
argument ttobj
indicates which transition time function will be
used for the invoking resource. The argument disjAndTimetable
indicates whether both the standard timetable constraint and the
disjunctive constraint will be added to the solver.
Transition times are taken into account when the timetable or the disjunctive constraint are posted. Transition times are only propagated between two activities that are incompatible. As the disjunctive constraint defines incompatibility based on the resource demand of the activities and the type timetable constraint defines incompatibility based on the transition types of the activities, they do not propagate in the same manner. Please see Transition Time in Scheduler Engine and Type Timetable Constraint for more information.
If the argument ttobj
has not been built with an instance of
IlcTransitionTable
, the type timetable
constraint will be unable to take the transition times into account. Please
see
Type Timetable Constraint
for more information.
The standard timetable constraint manages the profile of possible states of the resource from the time origin to the time horizon of the given schedule; it allows this set of possible states to change at any point in time; that is, it defines a time step of 1 (one).
Method Detail |
---|
This member function returns the state of the invoking resource at
time
.
This member function returns the first (in chronological order) timetable
of the invoking resource. An instance of
IloSolver::SolverErrorException
is thrown if no timetable
exists for the invoking resource.
This member function returns the timetable which includes
time
. An instance of
IloSolver::SolverErrorException
is thrown if no timetable is
defined at time
.
This member function returns the type timetable constraint of the invoking resource.
This member function returns IlcTrue
if the invoking
resource has a type timetable constraint. Otherwise, it returns
IlcFalse
.
This member function returns IlcTrue
if the resource is
constantly in use over the interval [timeMin, timeMax)
; that is,
the resource is never idle in that interval. Otherwise, it returns
IlcFalse
.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover the complete interval
[timeMin, timeMax)
.
This member function returns IlcTrue
if and only if it is
possible that the invoking resource is in the given state
over the entire interval [timeMin, timeMax)
. Otherwise,
it returns IlcFalse
.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover the complete interval
[timeMin, timeMax)
.
This member function returns IlcTrue
if and only if it is
certain that the invoking resource is in the given state
over the entire interval [timeMin, timeMax)
. Otherwise,
it returns IlcFalse
.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover the complete interval
[timeMin, timeMax)
.
This member function returns IlcTrue
if and only if the
state of the invoking resource at the given time
is known.
Otherwise, it returns IlcFalse
.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover time
.
This member function returns IlcTrue
if the invoking
resource is ever in use over the interval [timeMin, timeMax)
;
that is, there is ever a time in the interval when the invoking resource is
not idle. Otherwise, the member function returns IlcFalse
.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover the complete interval
[timeMin, timeMax)
.
This member function returns IlcTrue
if and only if it is
possible that the invoking resource is in the given state
at some point in the interval [timeMin, timeMax)
.
Otherwise, it returns IlcFalse
.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover the complete interval
[timeMin, timeMax)
.
This member function returns IlcTrue
if and only if it is
certain that the invoking resource is in the given state
at
some point in the interval [timeMin, timeMax)
. Otherwise,
it returns IlcFalse
.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover the complete interval
[timeMin, timeMax)
.
This member function returns IlcTrue
if the invoking
resource is in use at the time indicated by time
; that is, the
resource is not idle at time
. Otherwise, it returns
IlcFalse
.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover time
.
This member function returns IlcTrue
if and only if it is
possible that the invoking resource is in the given state
at
the given time
. Otherwise, it returns
IlcFalse
.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover time
.
This member function returns IlcTrue
if and only if it is
certain that the invoking resource is in the given state
at the
given time
. Otherwise, it returns IlcFalse
.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover time
.
This member function creates and returns the global disjunctive constraint associated with the invoking resource. For more information see Disjunctive Constraint.
This member function creates and returns a new timetable constraint for
the invoking resource. The argument states
indicates the set of
possible states. From timeMin
to timeMax
, the
state of the resource is allowed to change only at times
timeMin + i * timeStep
. The state must remain constant over
each interval [t (t + timeStep))
with t = timeMin + i *
timeStep
and t
at least as great as timeMin
and strictly less than timeMax
.
An instance of IloSolver::SolverErrorException
is thrown if
any of the following conditions occur:
timeMin
is not strictly less than
timeMax
;
timeStep
is not strictly positive;
timeMax - timeMin
is not a multiple of
timeStep
;
states
contains an element that was not in the set of possible states
that was passed to the resource constructor;This member function creates and returns a new timetable constraint for
the invoking resource. The set of possible states is given by the set passed
to the IlcStateResource
constructor. From the time origin
timeMin
to the time horizon, the state of the resource is
allowed to change only at times timeMin + i * timeStep
. The
state must remain constant over each interval [t (t +
timeStep))
with t = timeMin + i * timeStep
and
t
at least as great as the time origin and less than the time
horizon.
An instance of IloSolver::SolverErrorException
is thrown if
any of the following conditions occur:
timeStep
is not strictly positive;
timeStep
; This member function attaches a type timetable constraint to the resource and returns it.
The type timetable constraint uses the transition time object that was passed to
the constructor of the invoking resource to propagate the transition times. This
transition time object needs to have been built with an instance of
IlcTransitionTable
.
An instance of IloSolver::SolverErrorException
is thrown if no transition time object was passed to the
constructor of the resource or if the transition time object was not
built with an instance of IlcTransitionTable
.
This member function states that the invoking resource must not be in any
of the given states
at any time in the interval [timeMin,
timeMax)
. The set of “impossible” states can be provided
as an instance of IlcAnySet
. That class is documented in the
IBM ILOG Solver Reference Manual.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover the complete interval
[timeMin, timeMax)
.
This member function states that the invoking resource must not be in the
given state
at any time in the interval [timeMin,
timeMax)
.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover the complete interval
[timeMin, timeMax)
.
This member function states that the invoking resource must be in use and
that it cannot be idle over the interval [timeMin, timeMax)
.
The resource must be closed to propagate.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover the complete interval
[timeMin, timeMax)
.
This member function states that the invoking resource must be in some of
the given states
at all times in the interval [timeMin,
timeMax)
. The set of possible states can be provided as an instance
of IlcAnySet
. That class is documented in the Solver
Reference Manual.
An instance of IloSolver::SolverErrorException
is thrown if
the timetables of the invoking resource do not cover the complete interval
[timeMin, timeMax)
.
This member function states that the invoking resource must be in the
given state
at all times in the interval [timeMin,
timeMax)
.
An instance of IloSolver::SolverErrorException
is thrown if
the timetable of the invoking resource does not cover the complete interval
[timeMin, timeMax)
.