Overview | Group | Tree | Graph | Index | Concepts |
In the Scheduler Engine, a resource is represented by an instance of the
abstract class IlcResource
. Activities in a schedule may
require or provide resources, so there is a data member in the class
IlcResource
to distinguish between resources "to be
required" and those "to be provided" by activities. Each
resource belongs to a unique schedule, an instance of IlcSchedule
. The member function IlcResource::getSchedule
returns that unique schedule
whenever it is invoked on a resource.
There are several predefined subclasses of IlcResource
:
Closing a Resource
The member function close
specifies that all the activities
requiring the invoking resource are known; that is, they have been linked to
the resource. This information allows additional constraint propagation to
take place, for example, the propagation of minimal capacity constraints.
Propagating minimal capacity constraints is particularly useful in the case
of resource allocation problems for which some minimal amount of provided
capacity must be reached. With such information, indeed, the system can
eliminate situations in which minimal capacity amounts cannot be reached if
no other (not deduced) activity can execute to provide the resource.
An instance of IloSolver::SolverErrorException
is thrown
when a new resource constraint (see the IlcResourceConstraint
class) is posted on a closed
resource.
The member function IlcResource::close
is also crucial
for propagation affecting the IlcReservoir
and IlcContinuousReservoir
classes. If
IlcResource::close
is not called, new activities
providing or requiring capacity can still be added. This means that no
propagation can take place before the reservoir is closed.
For more information, see Calendars, Disjunctive Constraint, Durability, Timetable, Transition Times, Precedence Graph Constraints, and Functional and Integral Constraints on Resources.
See Also:
IlcAltResSet, IlcIntervalList, IlcCapResource, IlcResourceConstraint, IlcResourceIterator, IlcSchedule, IlcSchedVariable, IlcGranularFunction
Constructor Summary | |
---|---|
public | IlcResource() |
public | IlcResource(IlcResourceI * impl) |
Method Summary | |
---|---|
public void | close() |
public IlcCalendar | getCalendar() const |
public IlcConstraint | getDisjunctiveConstraint() const |
public IlcSchedule | getDurableSchedule() const |
public IlcResourceI * | getImpl() const |
public IlcResourceConstraint | getLastRankedFirstRC() const |
public IlcResourceConstraint | getLastRankedLastRC() const |
public IlcResourceConstraint | getLastSurelyContributingRankedFirstRC() const |
public IlcResourceConstraint | getLastSurelyContributingRankedLastRC() const |
public const char * | getName() const |
public IlcAny | getObject() const |
public IlcResourceConstraint | getOldLastRankedFirstRC() const |
public IlcResourceConstraint | getOldLastRankedLastRC() const |
public IlcConstraint | getPrecedenceGraphConstraint() const |
public IlcSchedule | getSchedule() const |
public IloSolver | getSolver() const |
public IloSolverI * | getSolverI() const |
public IlcConstraint | getTimetableConstraint() const |
public IlcInt | getTransitionTime(const IlcResourceConstraint ct1, const IlcResourceConstraint ct2) const |
public IlcBool | hasCalendar() const |
public IlcBool | hasDisjunctiveConstraint() const |
public IlcBool | hasLightPrecedenceGraphConstraint() const |
public IlcBool | hasPrecedenceGraphConstraint() const |
public IlcBool | hasPrecedenceInfo() const |
public IlcBool | hasRankInfo() const |
public IlcBool | hasTimetableConstraint() const |
public IlcBool | isCapacityResource() const |
public IlcBool | isClosed() const |
public IlcBool | isContinuousReservoir() const |
public IlcBool | isDiscreteEnergy() const |
public IlcBool | isDiscreteResource() const |
public IlcBool | isDurable() const |
public IlcBool | isReservoir() const |
public IlcBool | isStateResource() const |
public IlcBool | isTransitionTimeSuspended() const |
public IlcBool | isUnaryResource() const |
public IlcConstraint | makeFunctionalConstraint(IlcSchedVariable leftVariable, const IlcGranularFunction func, IlcSchedVariable rightVariable=IlcDurationVariable, IlcBool fste=IlcFalse) const |
public IlcConstraint | makeIntegralConstraint(IlcSchedVariable leftVariable, const IlcGranularFunction func, IlcBool ignoreSuspensionAtStartEnd=IlcTrue, IlcBool fste=IlcFalse) const |
public IlcConstraint | makeLightPrecedenceGraphConstraint() |
public IlcConstraint | makePrecedenceGraphConstraint() |
public IlcBool | operator!=(const IlcResource & resource) const |
public void | operator=(const IlcResource & h) |
public IlcBool | operator==(const IlcResource & resource) const |
public void | setCalendar(IlcCalendar cal) |
public void | setName(const char * name) const |
public void | setObject(IlcAny object) const |
public void | setTransitionTimeObject(IlcTransitionTimeObject ttobj) |
public void | setTransitionTimeSuspended(IlcBool suspended=IlcTrue) |
public void | whenContribution(const IlcResourceDemon d) |
public void | whenDirectPredecessors(const IlcResourceDemon d) |
public void | whenDirectSuccessors(const IlcResourceDemon d) |
public void | whenNext(const IlcResourceDemon d) |
public void | whenPossibleNext(const IlcResourceDemon d) |
public void | whenPossiblePrevious(const IlcResourceDemon d) |
public void | whenPredecessors(const IlcResourceDemon d) |
public void | whenPrevious(const IlcResourceDemon d) |
public void | whenRankedFirstRC(const IlcDemon demon) const |
public void | whenRankedLastRC(const IlcDemon demon) const |
public void | whenSuccessors(const IlcResourceDemon d) |
Inner Enumeration |
---|
IlcResource::RankFilter |
Inner Class |
---|
IlcResource::ResourceConstraintDeltaIterator |
IlcResource::ResourceConstraintIterator |
Constructor Detail |
---|
Method Detail |
---|
This member function closes the invoking resource. That is, it states that all the activities requiring or providing the invoking resource are known so constraint propagation can proceed.
This member function returns the calendar attached to the invoking resource, if such an object exists.
This member function returns the disjunctive constraint of the invoking resource.
This member function returns the durable schedule on which the invoking durable resource was constructed. It returns an empty handle if the invoking resource is not durable.
This member function returns the last resource constraint that was ranked first on the resource. If no resource constraint has been ranked first, it returns an empty handle.
This function should be used only if the ranking information is
available on the resource (see
IlcResource::hasRankInfo
).
This member function returns the last resource constraint that was ranked last on the resource. If no resource constraint has been ranked last, it returns an empty handle.
This function should be used only if the ranking information is
available on the resource (see
IlcResource::hasRankInfo
).
This member function returns the last resource constraint that was ranked first on the resource and surely affects the availability of the resource (strictly positive duration and capacity requirement). If no resource constraint meets these conditions, it returns an empty handle.
This function should be used only if the ranking information is
available on the resource (see
IlcResource::hasRankInfo
).
This member function returns the last resource constraint that was ranked last on the resource and surely affects the availability of the resource (strictly positive duration and capacity requirement). If no resource constraint meets these conditions, it returns an empty handle.
This function should be used only if the ranking information is
available on the resource (see
IlcResource::hasRankInfo
).
When called by the execution of a demon d
attached with the event
IlcResource::whenRankedFirstRC
this member
function returns the last resource
constraint that has been ranked first during the last triggering of
the event. If the event is triggered for the first time, this
function returns an empty handle. The delta iterator
IlcResource::ResourceConstraintDeltaIterator
with argument RankedFirst
allows iteration in chronological order (with respect to the
start/end time of activities) over all the resource constraints
between the one returned by getOldLastRankedFirstRC
(excluded)
and the one returned by IlcResource::getLastRankedFirstRC
(included).
When called outside the execution of a demon d
attached with the
event IlcResource::whenRankedFirstRC
this member function returns the last
resource constraint that was ranked first on the resource. That is,
it returns exactly the same value as the member function
IlcResource::getLastRankedFirstRC
.
This function should be used only if the ranking information is
available on the resource (see
IlcResource::hasRankInfo
).
When called by the execution of a demon d
attached with the event
IlcResource::whenRankedLastRC
this member
function returns the last resource
constraint that has been ranked last during the last triggering of
the event. If the event is triggered for the first time, this
function returns an empty handle. The delta iterator
IlcResource::ResourceConstraintDeltaIterator
with argument RankedLast
allows iteration in anti-chronological order (with respect to the
start/end time of activities) over all the resource constraints
between the one returned by getOldLastRankedLastRC
(excluded)
and the one returned by IlcResource::getLastRankedLastRC
(included).
When called outside the execution of a demon d
attached with the
event IlcResource::whenRankedLastRC
this
member function returns the last
resource constraint that was ranked last on the resource. That is,
it returns exactly the same value as the member function
IlcResource::getLastRankedLastRC
.
This function should be used only if the ranking information is
available on the resource (see
IlcResource::hasRankInfo
).
This member function returns the precedence graph constraint associated with the invoking resource.
This member function returns the schedule to which the invoking resource
belongs. Each resource belongs to a unique schedule, an instance of
IlcSchedule
.
This member function returns an instance of IloSolver
associated with the invoking object.
This member function returns a pointer to the implementation object of the solver where the invoking object was extracted.
This member function returns the timetable constraint of the invoking resource.
This member function returns the transition time between the two
activities corresponding to ct1
and ct2
. By
default, that is when no transition time object has been defined for the
resource, this function returns 0.
Transition times can be taken into account by the disjunctive constraint or by the type timetable constraint. See Transition Time in Scheduler Engine for more details.
This member function returns IlcTrue
if a calendar has
been attached to the invoking resource. Otherwise, it returns
IlcFalse
.
This member function returns IlcTrue
if the invoking
resource has a disjunctive constraint. Otherwise, it returns
IlcFalse
.
This member function returns IlcTrue
if and only if a light
precedence graph constraint has been created on the resource.
This member function returns IlcTrue
if the invoking
resource is associated with a precedence graph constraint. Otherwise, it
returns IlcFalse
.
This member function returns IlcTrue
if and only if some
precedence information is available on the resource. This is the case when
the resource has been associated with a precedence graph constraint or when the
resource is a unary resource with a sequence constraint.
When this member function returns IlcTrue
, all the
member functions allowed when IlcResource::hasRankInfo
returns
IlcTrue
are allowed, along with the following additional
functions:
IlcResource::whenDirectSuccessors
, IlcResource::whenDirectPredecessors
, IlcResource::whenSuccessors
, IlcResource::whenPredecessors
, IlcResource::whenPossiblePrevious
, IlcResource::whenPossibleNext
.IlcResourceConstraint::setNotNext
, IlcResourceConstraint::setNotSetup
, IlcResourceConstraint::setNotTeardown
, IlcResourceConstraint::isDirectlySucceededBy
, IlcResourceConstraint::isSucceededBy
, IlcResourceConstraint::hasAsPossibleNext
, IlcResourceConstraint::isPossibleSetup
, IlcResourceConstraint::isPossibleTeardown
. This member function returns IlcTrue
if and only if some rank
information is available on the resource. This is the case when the
resource is a unary resource and has been associated with a light
precedence graph constraint, a precedence graph constraint, a
disjunctive constraint or a sequence constraint, or when the
resource is a state resource with a precedence graph constraint or
a disjunctive constraint.
When this member function returns IlcTrue
, the following functions
can be used during the search:
IlcResource::getLastRankedFirstRC
, IlcResource::getLastRankedLastRC
, IlcResource::getOldLastRankedFirstRC
, IlcResource::getOldLastRankedLastRC
, IlcResource::getLastSurelyContributingRankedFirstRC
, IlcResource::getLastSurelyContributingRankedLastRC
, IlcResource::whenRankedFirstRC
, IlcResource::whenRankedLastRC
, IlcResource::whenPrevious
, IlcResource::whenNext
, IlcResource::whenContribution
.IlcUnaryResource::isRanked
, IlcUnaryResource::getSetupRC
, IlcUnaryResource::getTeardownRC
, IlcUnaryResource::hasSetupRC
, IlcUnaryResource::hasTeardownRC
.IlcResourceConstraint::rankFirst
, IlcResourceConstraint::rankLast
, IlcResourceConstraint::rankNotFirst
, IlcResourceConstraint::rankNotLast
, IlcResourceConstraint::setNext
, IlcResourceConstraint::setSetup
, IlcResourceConstraint::setTeardown
, IlcResourceConstraint::setSuccessor
, IlcResourceConstraint::isPossibleFirst
, IlcResourceConstraint::isPossibleLast
, IlcResourceConstraint::isRankedFirst
, IlcResourceConstraint::isRankedLast
, IlcResourceConstraint::isRanked
, IlcResourceConstraint::getNextRC
, IlcResourceConstraint::getPrevRC
, IlcResourceConstraint::hasAsNext
, IlcResourceConstraint::hasNextRC
, IlcResourceConstraint::hasPrevRC
, IlcResourceConstraint::isSetup
, IlcResourceConstraint::isTeardown
, IlcResourceConstraint::surelyContributes
, IlcResourceConstraint::possiblyContributes
.IlcTryRankFirst
, IlcTryRankLast
, IlcRank
, IlcRankBackward
.This member function returns IlcTrue
if the invoking
resource has a timetable constraint. Otherwise, it returns
IlcFalse
.
This member function distinguishes between the classes of resources
available in the Scheduler Engine. It returns IlcTrue
if the
invoking resource is an instance of the class IlcCapResource
. Otherwise, it returns
IlcFalse
.
This member function returns IlcTrue
if the invoking
resource is closed; that is, the resource no longer accepts new resource
constraints being declared for it. The member function returns
IlcFalse
if the invoking resource is still open.
This member function distinguishes among the classes of resources
available in the Scheduler Engine. It returns IlcTrue
if the
invoking resource is an instance of the class IlcContinuousReservoir
. Otherwise, it returns
IlcFalse
.
This member function distinguishes among the classes of resources
available in the Scheduler Engine. It returns IlcTrue
if the
invoking resource is an instance of the class IlcDiscreteEnergy
. Otherwise, it returns
IlcFalse
.
This member function distinguishes among the classes of resources
available in the Scheduler Engine. It returns IlcTrue
if the
invoking resource is an instance of the class IlcDiscreteResource
. Otherwise, it returns
IlcFalse
.
This member function returns IlcTrue
if the invoking
resource was constructed on a durable schedule. Otherwise, it returns
IlcFalse
.
This member function distinguishes among the classes of resources
available in the Scheduler Engine. It returns IlcTrue
if the
invoking resource is an instance of the class IlcReservoir
. Otherwise, it returns
IlcFalse
.
This member function distinguishes among the classes of resources
available in the Scheduler Engine. It returns IlcTrue
if the
invoking resource is an instance of the class IlcStateResource
. Otherwise, it returns
IlcFalse
.
This member function returns IlcTrue
if the transition time
on the invoking resource has been declared to be suspended by breaks.
This member function distinguishes among the classes of resources
available in the Scheduler Engine. It returns IlcTrue
if the
invoking resource is an instance of the class IlcUnaryResource
. Otherwise, it returns
IlcFalse
.
This member function creates a functional constraint from the function
func
on all the activities requiring the invoking resource. If
the time extent is IlcNever
or IlcAlways
, the
resource constraint will be ignored.
For each such activity, the integral of the function func
is
evaluated from the value of the variable designated by
rightVariable
, and set to be equal to the variable designated
by leftVariable
:
leftVariable = f(rightVariable)
The func
object must be closed, otherwise an error will be
raised. Whenever the processing time is used
(IloProcessingTimeVariable
), every activity executing on the
resource must be breakable, and the granular function func
must
take a value less than or equal to its granularity. Otherwise an error will
be raised when starting to solve the problem.
This member function creates an integral constraint from the
function func
on all the activities requiring the invoking resource.
If the time extent is
IlcNever
or
IlcAlways
,
the resource constraint will be ignored.
For each such activity, the integral of the function func
is computed
over the duration, divided by the granularity, and properly rounded (see
IlcGranularFunction
),
It is then set to be equal to the variable designated by leftVar
:
The leftVar argument should only be one of the following variable types:
IlcExternalVariable
,
IlcProcessingTimeVariable
,
IlcCapacityVariable
,
IlcEnergyVariable
.
The func
object must be closed, otherwise an error will be raised. Whenever the
processing time is used
(IlcProcessingTimeVariable
),
every activity
executing on the resource must be breakable, and the granular function func
must take a value less than or equal to its granularity. Otherwise an error
will be raised when starting to solve the problem.
The suspension of activities at the start or end
(see IlcActivity::canBeSuspendedAtStart
and
IlcActivity::canBeSuspendedAtEnd
)
is by default not taken into account. To take forbidden suspensions into account,
the argument ignoreSuspensionAtStartEnd
may be set to IlcFalse
. Then,
the resulting integral constraint will accordingly prevent activities
to start/end in intervals where the granular function func has zero values.
This member function allows the creation and return of a light precedence graph constraint on the invoking unary resource. That constraint has to be posted in order to be taken into account.
This member function creates and returns the precedence graph constraint associated with the invoking resource. That constraint has to be posted in order to be taken into account.
This operator returns IlcTrue
if and only if resource
does not refer to the same implementation object as the invoking resource.
This operator returns IlcTrue
if and only if resource
refers to
the same implementation object as the invoking resource.
This member function attaches the calendar cal
to
the invoking resource.
Outside the search, it is possible to attach a new calendar to a resource that already has a calendar attached. In that case the new attachment replaces the previous one.
During search, it is possible to attach a calendar only to a resource that does not have a previously attached calendar. In that case, the attachment is reversible. During search, any attempt to attach a new calendar to a resource that already has an attached calendar raises an error.
When two different calendars are attached respectively to a resource constraint and to its corresponding resource, only the one on the resource constraint is taken into account. That is, if some breaks are attached to the resource Res using the calendar Cal1 and some shifts are attached to a resource constraint Rct of Res using the calendar Cal2, then only shifts are taken into account on Rct (Cal2). In other words, breaks of cal1 are ignored (Cal1).
Notice that calendars can be shared between resources and resource constraints,
and that setCalendar
does not imply that a local copy of the calendar
is made; one should be aware of the fact that any change
to a shared calendar holds for all resources and resource constraints sharing the
calendar.
This member function allows setting ttobj
as the new
transition time function of the invoking resource. During the search, any
attempt to change the transition function of a resource will raise an
error.
This member function allows specifying whether or not the transition time on the invoking resource should be suspended by breaks. By default, the transition time of the resource is not suspended by breaks.
This member function associates the resource demon d
with
contribution events of resource constraints of the invoking resource. When the
contribution status of a resource constraint changes (from
possibly contributing to surely contributing or to not possibly
contributing), the demon d
is executed on that resource
constraint.
This member function should be used only in search and only
if some rank information is available on the resource (see member
function IlcResource::hasRankInfo
).
This member function associates the resource demon
d
with changes to the set of resource constraints that
are direct predecessors of a resource constraint of the invoking
resource. When the set of resource constraints that are direct
predecessors of a resource constraint changes because some new direct
predecessors have appeared, the demon d
is executed on
the resource constraint whose set of direct predecessors has
changed.
This member function should be used only in search and only
if some precedence information is available on the resource (see member
function IlcResource::hasPrecedenceInfo
).
This member function associates the resource demon
d
with changes to the set of resource constraints that
are direct successors of a resource constraint of the invoking
resource. When the set of resource constraints that are direct
successors of a resource constraint changes because some new direct
successors have appeared, the demon d
is executed on
the resource constraint whose set of direct successors has
changed.
This member function should be used only in search and only
if some precedence information is available on the resource (see member
function IlcResource::hasPrecedenceInfo
).
This member function associates the resource demon
d
with the next resource constraint of resource
constraints of the invoking resource. When the next resource
constraint of a resource constraint is known, the demon
d
is executed on the resource constraint whose next
resource constraints have become known. This next resource constraint can
then be accessed with the member function IlcResourceConstraint::getNextRC
. When the
setup resource constraints is known, the resource demon
d
is executed on an empty handle resource
constraint.
This member function should be used only in search and only
if some rank information is available on the resource (see member
function IlcResource::hasRankInfo
).
This member function associates the resource demon
d
with changes to the set of resource constraints that
are possibly next to a resource constraint of the invoking
resource. When the set of resource constraints that are possibly
next to a resource constraint changes because some resource
constraint that was possibly next is no longer possibly next, the
demon d
is executed on the resource constraint whose
set of possibly next resource constraints has changed. In case the
possible setup resource constraints change, the resource demon
d
is executed on an empty handle resource
constraint.
This member function should be used only in search and only
if some precedence information is available on the resource (see member
function IlcResource::hasPrecedenceInfo
).
This member function associates the resource demon
d
with changes to the set of resource constraints that
are possibly previous to a resource constraint of the invoking
resource. When the set of resource constraints that are possibly
previous to a resource constraint changes because some resource
constraint that was possibly previous is no longer possibly previous, the
demon d
is executed on the resource constraint whose
set of possibly previous resource constraints has changed. In case the
possible teardown resource constraints change, the resource demon
d
is executed on an empty handle resource
constraint.
This member function should be used only in search and only
if some precedence information is available on the resource (see member
function IlcResource::hasPrecedenceInfo
).
This member function associates the resource demon
d
with changes to the set of resource constraints that
are predecessors of a resource constraint of the invoking
resource. When the set of resource constraints that are
predecessors of a resource constraint changes because some new
predecessors have appeared, the demon d
is executed on
the resource constraint whose set of predecessors has
changed.
This member function should be used only in search and only
if some precedence information is available on the resource (see member
function IlcResource::hasPrecedenceInfo
).
This member function associates the resource demon
d
with the previous resource constraint of resource
constraints of the invoking resource. When the previous resource
constraint of a resource constraint is known, the demon
d
is executed on the resource constraint whose previous
resource constraints have become known. This previous resource constraint can
then be accessed with the member function IlcResourceConstraint::getPrevRC
. When the
teardown resource constraints is known, the resource demon
d
is executed on an empty handle resource
constraint.
This member function should be used only in search and only
if some rank information is available on the resource (see member
function IlcResource::hasRankInfo
).
This member function associates a demon with a change of the set of
resource constraints currently ranked first on the resource. When this set
changes because some resource constraint has just been ranked first, the
demon is executed. In the execution code of the demon, the delta iterator
IlcResource::ResourceConstraintDeltaIterator
is available to iterate over the freshly ranked first resource
constraints.
Since a constraint is also a demon, a constraint can be passed as an argument to this member function. When the change event is triggered, the constraint is posted and propagated.
This function should be used only if the ranking information is
available on the resource (see
IlcResource::hasRankInfo
).
This member function associates a demon with a change of the set of
resource constraints currently ranked last on the resource. When this set
changes because some resource constraint has just been ranked last, the
demon is executed. In the execution code of the demon, the delta iterator
IlcResource::ResourceConstraintDeltaIterator
is available to iterate over the freshly ranked last resource constraints.
Since a constraint is also a demon, a constraint can be passed as an argument to this member function. When the change event is triggered, the constraint is posted and propagated.
This function should be used only if the ranking information is
available on the resource (see
IlcResource::hasRankInfo
).
This member function associates the resource demon
d
with changes to the set of resource constraints that
are successors of a resource constraint of the invoking
resource. When the set of resource constraints that are
successors of a resource constraint changes because some new
successors have appeared, the demon d
is executed on
the resource constraint whose set of successors has
changed.
This member function should be used only in search and only
if some precedence information is available on the resource (see member
function IlcResource::hasPrecedenceInfo
).
Inner Enumeration Detail |
---|
This enumeration allows specifying a subset of resource constraints
to traverse with the iterators
IlcResource::ResourceConstraintIterator
, and
IlcResource::ResourceConstraintDeltaIterator
.
RankedFirst
indicates the subset of resource constraints that have
been ranked first on the resource.
RankedLast
indicates the subset of resource constraints that
have been ranked last on the resource.
NotRanked
indicates the subset of resource constraints that
have not yet been ranked first or last on the resource.
PossibleFirst
indicates the subset of resource constraints
that can possibly be ranked first on the resource. This is the set of
resource constraints that has not yet been ranked first nor ranked last,
nor otherwise determined to be unavailable to be ranked first.
PossibleLast
indicates the subset of resource constraints that can
possibly be ranked last on the resource. This is the set of resource
constraints that has not yet been ranked first nor ranked last, nor
otherwise determined to be unavailable to be ranked last.
See Also:
IlcResource::ResourceConstraintIterator, IlcResource::ResourceConstraintDeltaIterator
Fields |
---|
RankedFirst = 1 | |
RankedLast = 2 | |
Ranked = 3 | |
NotRanked = 4 | |
PossibleFirst = 8 | |
PossibleLast = 16 |