Overview | Group | Tree | Graph | Index | Concepts |
Instances of the class IlcResourceConstraint
are
resource constraints. This class inherits from the Solver
class IlcConstraint
, which is documented in the Solver
Reference Manual.
Instances of this class are created by these member functions:
IlcActivity::requires
IlcActivity::provides
IlcActivity::consumes
IlcActivity::produces
IlcActivity::requiresNot
For more information, see
Precedence Graph Constraints,
Sequence Constraint,
Metaconstraints,
and IlcConstraint
in the IBM ILOG Solver Reference Manual.
See Also:
IlcActivity, IlcResource, IlcResourceConstraintIterator, IlcTimeExtent, IlcTryRankFirst, IlcTryRankLast, IlcUnaryResource
Constructor Summary | |
---|---|
public | IlcResourceConstraint() |
public | IlcResourceConstraint(IlcResourceConstraintI * impl) |
Method Summary | |
---|---|
public IlcActivity | getActivity() const |
public IlcCalendar | getCalendar() const |
public IlcInt | getCapacity() const |
public IlcIntVar | getCapacityVariable() const |
public IlcResourceConstraintI * | getImpl() const |
public IlcResourceConstraint | getNextRC() const |
public IlcIntVar | getNextVar() const |
public IlcResourceConstraint | getPrevRC() const |
public IlcIntVar | getPrevVar() const |
public IlcResource | getResource() const |
public IlcInt | getSequenceIndex() const |
public IlcShape | getShape() const |
public IlcFloat | getSlope() const |
public IlcSlopeConstraintMode | getSlopeConstraintMode() const |
public IlcAny | getState() const |
public IlcAnySet | getStateSet() const |
public IlcAnySetVar | getStateSetVariable() const |
public IlcAnyVar | getStateVariable() const |
public IlcTimeExtent | getTimeExtent() const |
public IlcBool | hasAsNext(IlcResourceConstraint) const |
public IlcBool | hasAsPossibleNext(IlcResourceConstraint) const |
public IlcBool | hasCalendar() const |
public IlcBool | hasNextRC() const |
public IlcBool | hasPrevRC() const |
public IlcBool | hasShape() const |
public IlcBool | hasSlope() const |
public IlcBool | isCapacityConstraint() const |
public IlcBool | isDirectlySucceededBy(IlcResourceConstraint) const |
public IlcBool | isInwardConstraint() const |
public IlcBool | isNegativeConstraint() const |
public IlcBool | isNotVisited() const |
public IlcBool | isPossibleFirst() const |
public IlcBool | isPossibleLast() const |
public IlcBool | isPossibleSetup() const |
public IlcBool | isPossibleTeardown() const |
public IlcBool | isProvidingConstraint() const |
public IlcBool | isRanked() const |
public IlcBool | isRankedFirst() const |
public IlcBool | isRankedLast() const |
public IlcBool | isSetup() const |
public IlcBool | isStateConstraint() const |
public IlcBool | isStateSetConstraint() const |
public IlcBool | isSucceededBy(IlcResourceConstraint) const |
public IlcBool | isTeardown() const |
public IlcBool | isVariableResourceConstraint() const |
public IlcBool | isVirtualNode() const |
public IlcBool | isVisited() const |
public IlcVariableSlopeShape | makeVariableSlopeShape(IlcFloatVar slope) const |
public void | operator=(const IlcResourceConstraint & h) |
public IlcBool | possiblyContributes() const |
public void | rankFirst() |
public void | rankLast() |
public void | rankNotFirst() |
public void | rankNotLast() |
public void | removeShape() const |
public void | setCalendar(IlcCalendar cal) |
public void | setNext(IlcResourceConstraint ct) |
public void | setNotNext(IlcResourceConstraint ct) |
public void | setNotSetup() |
public void | setNotTeardown() |
public void | setNotVisited() |
public void | setSetup() |
public void | setSlope(IlcFloat slope, IlcSlopeConstraintMode mode=IlcRoundedCapacity) |
public void | setSuccessor(IlcResourceConstraint ct) |
public void | setTeardown() |
public void | setVisited() |
public IlcBool | surelyContributes() const |
public void | unsetNext() |
public void | unsetSetup() |
public void | unsetSuccessor(IlcResourceConstraint ct) |
public void | unsetTeardown() |
Constructor Detail |
---|
Method Detail |
---|
This member function returns the activity of the invoking resource constraint.
This member function returns the calendar attached to the invoking resource constraint, if such an object exists.
This member function returns the required or provided quantity of the invoking resource constraint.
This member function returns the variable representing the required or provided quantity of the invoking resource constraint.
This member function returns the resource constraint of the next activity
of the invoking resource constraint. The resource constraint must be of time
extent IlcFromStartToEnd
. This member
function should be called only if some rank information is available
on the resource (see member function IlcResource::hasRankInfo
).
This member function returns the next variable of the invoking resource constraint.
The resource constraint must be of time extent
IlcFromStartToEnd
.
The resource must be an instance of
IlcUnaryResource
, closed, and with
its sequence constraint created.
Let Nb
be the number of resource constraints of time extent
IlcFromStartToEnd
.
When the sequence constraint is posted, the
next variable is initialized to the following set.
If the value of the next variable is Nb + 1
, the resource
constraint is the last on the resource. If its value is -1, the
resource constraint is not visited, that is,
either the processing time or the required capacity is zero.
This member function returns the resource constraint of the previous
activity of the invoking resource constraint. The resource constraint must
be of time extent IlcFromStartToEnd
. This
member function should be called only if some rank information is
available on the resource (see member function IlcResource::hasRankInfo
).
This member function returns the previous variable of the invoking resource constraint.
The resource constraint must be of time extent
IlcFromStartToEnd
.
The resource must be an instance of
IlcUnaryResource
, closed, and with
its sequence constraint created.
Let Nb
be the number of resource constraints of time extent
IlcFromStartToEnd
.
When the sequence constraint is posted, the
previous variable is initialized to the following set.
If the value of the previous variable is 0 (zero), the resource constraint is the first on the resource. If its value is -1, the resource constraint is not visited, that is, either the processing time or the required capacity is zero.
This member function returns the resource of the invoking resource constraint.
This member function returns the unique index of the invoking resource constraint used by the sequence constraint attached to its resource.
The resource constraint must be of time extent IlcFromStartToEnd
. The resource must be an instance of
IlcUnaryResource
, closed, and with its
sequence constraint created.
To obtain the resource constraint from an index, use the accessor
IlcUnaryResource::getSequenceRC
.
This function returns the instance of IlcShape
associated with the resource constraint. An error will be raised if no
such shape has been created.
This member function returns the slope value of the slope constraint
created by the member function setSlope
. An instance of
IloSolver::SolverErrorException
is thrown if the invoking
resource constraint has no slope constraint or if its resource is not a
continuous reservoir.
This member function returns the rounding mode of the slope constraint
created by the member function IlcResourceConstraint::setSlope
. An
instance of IloSolver::SolverErrorException
is thrown if the
invoking resource constraint has no slope constraint or if its resource is
not a continuous reservoir.
This member function returns the required state of the invoking resource constraint.
This member function returns the required set of states of the invoking resource constraint.
This member function returns the variable representing the required set of states of the invoking resource constraint.
This member function returns the variable representing the required state of the invoking resource constraint.
This member function returns the time extent of the invoking resource constraint.
Before search, this function returns IlcTrue
if and only if
a next relation has been added with the member function IlcResourceConstraint::setNext(rct)
. In search, this member function returns
IlcTrue
if rct
is next to the invoking resource
constraint. Otherwise, it returns IlcFalse
. This member
function should be called only if some rank information is available
on the resource (see member function IlcResource::hasRankInfo
).
This member function returns IlcTrue
if it is possible that
rct
is next to the invoking resource constraint. Otherwise, it
returns IlcFalse
.
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 returns IloTrue
if a calendar
has been attached to the invoking resource constraint. Otherwise, it returns
IloFalse
.
This member function returns IlcTrue
if the immediately
following activity of the activity of the invoking resource constraint is
known. Otherwise it returns IlcFalse
.
The resource constraint must be of time extent IlcFromStartToEnd
. This member function should be called
only if some rank information is available on the resource (see member
function IlcResource::hasRankInfo
)
There is no possible next resource constraint if the invoking resource constraint does not contribute or is the teardown resource constraint.
This member function returns IlcTrue
if the immediately
preceding activity of the activity of the invoking resource constraint is
known. Otherwise it returns IlcFalse
.
The resource constraint must be of time extent IlcFromStartToEnd
. This member function should be called
only if some rank information is available on the resource (see member
function IlcResource::hasRankInfo
)
There is no possible previous resource constraint if the invoking resource constraint does not contribute or is the setup resource constraint.
This function returns IlcTrue
if a shape
has been associated with the resource constraint
This member function returns IlcTrue
if the resource of the
invoking resource constraint is a continuous reservoir and if a slope
constraint has been defined by the member function IlcResourceConstraint::setSlope
. Otherwise, it returns IlcFalse
.
This member function returns IlcTrue
if and only if the
invoking resource constraint indicates that a quantity (and thus not a
state) is required or provided.
This member function returns IlcTrue
if the invoking
resource constraint is directly succeeded by the resource constraint
rct
. Otherwise, it returns IlcFalse
.
This member function should be called only if some precedence information
is available on the resource (see member function IlcResource::hasPrecedenceInfo
).
This member function returns IlcTrue
if and only if the
occupancy of the resource by the invoking constraint is to be rounded inward
towards the nearest valid time that corresponds to a time step. This
rounding is important only when one of the timetables of the resource has a
time step greater than 1 (one).
This member function returns IlcTrue
if and only if the
invoking constraint was constructed by the member function IlcActivity::requiresNot
, or was extracted from an
IloResourceConstraint
that was constructed
by the member function IloActivity::requiresNot
This member function returns IlcTrue
if the activity of the
invoking resource constraint is not visited by the path defined by the
sequence constraint attached to its resource. Otherwise it returns
IlcFalse
. Not visited means that the processing time or the
required capacity is zero.
The resource constraint must be of time extent IlcFromStartToEnd
. The resource must be an instance of
IlcUnaryResource
, closed, and with its
sequence constraint created.
This member function returns IlcTrue
if the activity that
corresponds to the invoking resource constraint can be ranked first among
those that have not yet been ranked. Otherwise, it returns
IlcFalse
. In particular, it returns IlcFalse
if
the activity has already been ranked.
This member function should be used only if the resource that
corresponds to the invoking resource constraint is either a unary resource
(an instance of IlcUnaryResource
) or a state
resource (an instance of IlcStateResource
).
This function should be used only if the ranking information is
available on the resource (see
IlcResource::hasRankInfo
).
This member function returns IlcTrue
if the activity that
corresponds to the invoking resource constraint can be ranked last among
those that have not yet been ranked. Otherwise, it returns
IlcFalse
. In particular, it returns IlcFalse
if
the activity has already been ranked.
This member function should be used only if the resource that
corresponds to the invoking resource constraint is either a unary resource
(an instance of IlcUnaryResource
) or a state
resource (an instance of IlcStateResource
).
This function should be used only if the ranking information is
available on the resource (see
IlcResource::hasRankInfo
).
This member function returns IlcTrue
if it is possible that
the invoking resource constraint is a setup resource constraint. Otherwise,
it returns IlcFalse
.
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 returns IlcTrue
if it is possible that
the invoking resource constraint is a teardown resource constraint.
Otherwise, it returns IlcFalse
.
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 returns IlcTrue
if and only if the
invoking constraint was constructed by the member functions IlcActivity::provides
, or IlcActivity::produces
, or was extracted from an
IloResourceConstraint
that was constructed
by the member function IloActivity::requiresNot
.
This member function returns IlcTrue
if and only if the
invoking resource constraint has been ranked first or last on the resource; otherwise
it returns IlcFalse
.
This member function is available in search only. It should be used
only if the resource that corresponds to the invoking resource
constraint is either a unary resource (an instance of IlcUnaryResource
) or a state resource (an instance of
IlcStateResource
). This member function
is available in search only.
This function should be used only if the ranking information is
available on the resource (see
IlcResource::hasRankInfo
).
This member function returns IlcTrue
if and only if the
invoking resource constraint has been ranked first on the resource; otherwise
it returns IlcFalse
.
This member function is available in search only. It should be used
only if the resource that corresponds to the invoking resource
constraint is either a unary resource (an instance of IlcUnaryResource
) or a state resource (an instance of
IlcStateResource
). This member function
is available in search only.
This function should be used only if the ranking information is
available on the resource (see
IlcResource::hasRankInfo
).
This member function returns IlcTrue
if and only if the
invoking resource constraint has been ranked last on the resource; otherwise
it returns IlcFalse
.
This member function is available in search only. It should be used
only if the resource that corresponds to the invoking resource
constraint is either a unary resource (an instance of IlcUnaryResource
) or a state resource (an instance of
IlcStateResource
). This member function
is available in search only.
This function should be used only if the ranking information is
available on the resource (see
IlcResource::hasRankInfo
).
Before search, this function returns IlcTrue
if and only if
the invoking resource constraint has been constrained to be a setup resource
constraint with the member function IlcResourceConstraint::setSetup
.
In search, this member function returns IlcTrue
if the
invoking resource constraint is a setup resource constraint. Otherwise, it
returns IlcFalse
.
This member function should be called only if some rank information
is available on the resource (see member function IlcResource::hasRankInfo
).
This member function returns IlcTrue
if and only if the
invoking resource constraint indicates that a single state (and thus not a
quantity or one of a set of states) is required.
This member function returns IlcTrue
if and only if the
invoking resource constraint indicates that one of a set of states (and thus
not a quantity or a single state) is required.
Before search, this function returns IlcTrue
if and only if
a successor relation has been added with the member function IlcResourceConstraint::setSuccessor(rct)
.
In search, this member function returns IlcTrue
if the
invoking resource constraint is succeeded by the resource constraint
rct
. Otherwise, it returns IlcFalse
.
This member function should be called only if some precedence information
is available on the resource (see member function IlcResource::hasPrecedenceInfo
).
Before search, this function returns IlcTrue
if and only if
the invoking resource constraint has been constrained to be a teardown
resource constraint with the member function IlcResourceConstraint::setTeardown
.
In search, this member function returns IlcTrue
if the
invoking resource constraint is a teardown resource constraint. Otherwise,
it returns IlcFalse
.
This member function should be called only if some rank information
is available on the resource (see member function IlcResource::hasRankInfo
).
This member function returns IlcTrue
if and only if the
invoking resource constraint has a variable representing the required
quantity or state or provided quantity.
This member function returns true if and only if the resource
constraint requires a unary resource and represents the sequence
virtual node of this unary resource. The sequence virtual node of a
unary resource is an automatically created resource constraint that do not affect the
availability of the resource and that is used in the sequence goals
and selectors to represent the virtual initial (in case of a
chronological sequence goal like IlcSequence
)
or final (in case of an anti-chronological sequence goal like
IlcSequenceBackward
) resource
constraint in the sequence of resource constraints of the unary resource .
This member function returns IlcTrue
if the activity of the
invoking resource constraint is visited by the path defined by the sequence
constraint attached to its resource. Otherwise it returns
IlcFalse
. Visited means that the processing time is strictly
positive and the required capacity is one.
The resource constraint must be of time extent IlcFromStartToEnd
. The resource must be an instance of
IlcUnaryResource
, closed, and with its
sequence constraint created.
This function associates an instance of
IlcVariableSlopeShape
with the resource constraint. Shapes are only available on continuous
reservoirs. An exception will
be thrown if the minimal value of the slope variable is strictly negative.
See Also:
IlcShape, IlcVariableSlopeShape
This member function returns IlcTrue
if the invoking
resource constraint possibly affects the availability of the resource.
Otherwise, it returns IlcFalse
.
This member function states that the activity that corresponds to the
invoking resource constraint is the first activity to execute among
those that have not yet been ranked. This member function should be used
only if the resource that corresponds to the invoking resource
constraint is either a unary resource (an instance of IlcUnaryResource
) or a state resource (an instance of
IlcStateResource
).
The ranking has no effect on the start and end times of activities that do not truly require the resource, that is, activities for which the duration or the amount of required capacity can be 0 (zero). In other words, if the activity that corresponds to the invoking resource constraint truly requires its resource, then it is constrained to execute before any other unranked activity that truly requires the resource.
Any of the following cases will raise an error:
IlcResource::hasRankInfo
) is
associated with the resource of the invoking resource constraint;IlcFromStartToEnd
; (Indeed, it does not make sense
to rank the activity if the time extent is not IlcFromStartToEnd
;
rankFirst
or
rankLast
). This member function states that the activity that corresponds to the
invoking resource constraint is the last activity to execute among
those that have not yet been ranked. This member function should be used
only if the resource that corresponds to the invoking resource
constraint is either a unary resource (an instance of IlcUnaryResource
) or a state resource (an instance of
IlcStateResource
).
The ranking has no effect on the start and end times of activities that do not truly require the resource, that is, activities for which the duration or the amount of required capacity can be 0 (zero). In other words, if the activity that corresponds to the invoking resource constraint truly requires its resource, then it is constrained to execute after any other unranked activity that truly requires the resource.
Any of the following cases will raise an error:
IlcResource::hasRankInfo
) is
associated with the resource of the invoking resource constraint;IlcFromStartToEnd
; (Indeed, it does not make sense
to rank the activity if the time extent is not IlcFromStartToEnd
, a value of the enumeration
IlcTimeExtent
.)
rankFirst
or
rankLast
). This member function states that the activity that corresponds to the
invoking resource constraint is not the first activity to execute among
those that have not yet been ranked. This member function should be used
only if the resource that corresponds to the invoking resource
constraint is either a unary resource (an instance of IlcUnaryResource
) or a state resource (an instance of
IlcStateResource
).
Any of the following cases will raise an error:
IlcResource::hasRankInfo
) is
associated with the resource of the invoking resource constraint;IlcFromStartToEnd
. (Indeed, it does not make sense
to rank the activity if the time extent is not IlcFromStartToEnd
, a value of the enumeration
IlcTimeExtent
.)This member function states that the activity that corresponds to the
invoking resource constraint is not the last activity to execute among those
that have not yet been ranked. This member function should be used
only if the resource that corresponds to the invoking resource
constraint is either a unary resource (an instance of IlcUnaryResource
) or a state resource (an instance of
IlcStateResource
).
Any of the following cases will raise an error:
IlcResource::hasRankInfo
) is
associated with the resource of the invoking resource constraint;IlcFromStartToEnd
. (Indeed, it does not make sense
to rank the activity if the time extent is not IlcFromStartToEnd
, a value of the enumeration
IlcTimeExtent
.)This function remove the instance of IlcShape
associated with the resource constraint. This member function must be used
outside the search. An error will be raised if no such shape has been created.
This member function attaches the calendar cal
to
the invoking resource constraint.
Outside the search, it is possible to attach a new calendar to a resource constraint 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 constraint 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 constraint 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 states that ct
is next to the invoking
resource constraint. This means that there cannot exist any resource
constraint ct0 such that ct0 definitely affects the
availability of the resource and ct0 starts or finishes between the
end of the invoking resource constraint and the start of
ct
.
This member function should be called only on unary
resources and if some rank information is available on the resource
(see member function IlcResource::hasRankInfo
).
This member function states that ct
cannot be next to the
invoking resource constraint. This means that there must exist a resource
constraint ct0 such that ct0 definitely affects the
availability of the resource and ct0 starts or finishes between the
end of the invoking resource constraint and the start of
ct
.
This member function should be called only on unary
resources and only if some precedence information is available on the
resource (see member function IlcResource::hasPrecedenceInfo
).
This member function states that the invoking resource constraint cannot be a setup resource constraint which means that some resource constraint must necessarily be previous to it.
This member function should be used only if a precedence graph constraint or a sequence constraint has been created on the resource. It can be used before or during search.
This member function should be called only on unary
resources and if some precedence information is available on the resource
(see member function IlcResource::hasPrecedenceInfo
).
This member function states that the invoking resource constraint cannot be a teardown resource constraint which means that some other resource constraint rct must exist such that the invoking resource constraint is previous to rct.
This member function should be called only on unary
resources and if some precedence information is available on the resource
(see member function IlcResource::hasPrecedenceInfo
).
This member function sets the activity of the invoking resource constraint to "not visited" by the path defined by the sequence constraint attached to its resource. Not visited means that the processing time or the required capacity is zero.
The resource constraint must be of time extent IlcFromStartToEnd
. The resource must be an instance of
IlcUnaryResource
, closed, and with its
sequence constraint created.
This member function states that the invoking resource constraint is a setup resource constraint which means that no resource constraint can be previous to it.
This member function should be called only on unary
resources and only if some rank information is available on the resource
(see member function IlcResource::hasRankInfo
).
This member function creates a slope constraint for the invoking resource
constraint, that is the ratio between the capacity of the invoking resource
constraint and the duration of its activity is constrained to be
slope
, with a rounding mode defined by mode
. This
constraint is internally added to the solver.
The resource of the invoking resource constraint must be a continuous reservoir. The slope of a resource constraint cannot be modified in search but a slope can be set to a resource constraint with no slope defined yet.
This member function states that the invoking resource constraint has the
resource constraint ct
as successor on the precedence graph of
the resource. That is, this member function adds an edge on the precedence
graph.
This member function should be called only if some rank
information is available on the resource (see member function
IlcResource::hasRankInfo
).
This member function states that the invoking resource constraint is a teardown resource constraint which means that no resource constraint rct can exist such that the invoking resource constraint is previous to rct.
This member function should be called only on unary
resources and if some rank information is available on the resource
(see member function IlcResource::hasRankInfo
).
This member function sets the activity of the invoking resource constraint to "visited" by the path defined by the sequence constraint attached to its resource. Visited means that the processing time is strictly positive and the required capacity is one.
The resource constraint must be of time extent IlcFromStartToEnd
. The resource must be an instance of
IlcUnaryResource
, closed, and with its
sequence constraint created.
This member function returns IlcTrue
if the invoking
resource constraint definitely affects the availability of the resource.
Otherwise, it returns IlcFalse
.
This member function removes a next relation that was previously added on
the graph with IlcResourceConstraint::setNext
.
This member function should be used only before search and only
if some rank information is available on the resource (see member
function IlcResource::hasRankInfo
).
This member function removes the information that the invoking resource
constraint must be a setup resource constraint as stated by IlcResourceConstraint::setSetup
.
This member function should be used only before search and only
if some rank information is available on the resource (see member
function IlcResource::hasRankInfo
).
This member function removes a successor relation that was previously
added on the graph with IlcResourceConstraint::setSuccessor
.
This member function should be called only if some precedence
information is available on the resource (see member function
IlcResource::hasPrecedenceInfo
).
This member function removes the information that the invoking resource
constraint must be a teardown resource constraint as stated by
IlcResourceConstraint::setTeardown
.
This member function should be used only before search and only
if some rank information is available on the resource (see member
function IlcResource::hasRankInfo
).