Overview | Group | Tree | Graph | Index | Concepts |
Instances of the class IloResourceConstraint
are resource
constraints.
This class inherits from the IBM® ILOG® Concert Technology class
IloConstraint
. That class is documented in the IBM ILOG Concert
Technology Reference Manual.
Instances of this class are created by these member functions:
IloActivity::requires
IloActivity::provides
IloActivity::consumes
IloActivity::produces
IloActivity::requiresNot
The five elements of a resource constraint are an activity, an alternative resource set, a constant or variable demand, a time extent, and a rounding mode.
A resource constraint enforces the fact that on a certain time interval,
exactly one resource from a set of alternatives that make up an instance of
IloAltResSet
is used to process the
activity. The class IloActivity
offers a set
of member functions to create a resource constraint.
The demand type depends upon the resource. For example, a discrete capacity resource or a reservoir needs a positive numerical demand. The demand type for a state resource is a state or a set of states.
The time extent declares the period of time over which the availability of the resource is affected by the activity. Usually, the default value of the time extent is sufficient, since most activities will “require” a discrete capacity or a state resource from the start to the end of the activity. So in most cases, the time extent does not need to be declared. An activity can either produce or consume a reservoir.
The rounding mode tells the solver how to manage the use of the time buckets. Depending on the rounding mode, an activity that partially overlaps a time bucket is considered to either require the resource over the entire time bucket, or not require the resource during the time bucket at all.
Note that for resource constraints on continuous reservoirs, the time
extent and the rounding mode have no meaning and are not used. This is
because the time step of a timetable for a continuous reservoir is 1, so the
returned resource constraint has no inward/outward rounding mode. Its time
extent, which does not match any case of the enumeration IloTimeExtent
, is not defined either.
The alternative resource set specifies the set of resources from which one resource must be selected. If the resource constraint has only one possible resource, then it requires an alternative resource set with a single element.
In order to better model interaction between activities and resources, it is possible to attach a specific calendar on a resource constraint. In such a case, the calendar of the resource constraint will subsume the calendar possibly attached to the corresponding resource. That is, even if a calendar is defined on the resource, it is not taken into account when a calendar is specified on the resource constraint.
The member functions of the class IloResourceConstraint
allow retrieval of this data. In addition, the class
IloResourceConstraint
offers member functions to constrain the
relative position of activities on the resource.
For more information, see Temporal Relations.
See Also:
IloActivity, IloResource, IloTimeExtent, IloCapResource, IloActivityConstraintsParam, IloReservoir, IloStateResource, IloTransitionCost, IloTransitionTime, IloUnaryResource
Constructor Summary | |
---|---|
public | IloResourceConstraint() |
public | IloResourceConstraint(IloResourceConstraintI * impl) |
Method Summary | |
---|---|
public IloActivity | getActivity() const |
public IloAltResSet | getAltResSet() const |
public IloCalendar | getCalendar() const |
public IloNum | getCapacity() const |
public IloNum | getCapacityMax(const IloResource resource) const |
public IloNum | getCapacityMin(const IloResource resource) const |
public IloNumVar | getCapacityVariable() const |
public IloNum | getDurationMax(const IloResource resource) const |
public IloNum | getDurationMin(const IloResource resource) const |
public IloNum | getEndMax(const IloResource resource) const |
public IloNum | getEndMin(const IloResource resource) const |
public IloResourceConstraintI * | getImpl() const |
public IloResourceConstraint | getNext() const |
public IloNum | getProcessingTimeMax(const IloResource resource) const |
public IloNum | getProcessingTimeMin(const IloResource resource) const |
public IloResource | getResource() const |
public IloShape | getShape() const |
public IloNum | getStartMax(const IloResource resource) const |
public IloNum | getStartMin(const IloResource resource) const |
public IloAny | getState() const |
public IloAnySet | getStateSet() const |
public IloAnySetVar | getStateSetVariable() const |
public IloAnyVar | getStateVariable() const |
public IloTimeExtent | getTimeExtent() const |
public IloBool | hasAsNext(const IloResourceConstraint ct) const |
public IloBool | hasCalendar() const |
public IloBool | hasNext() const |
public IloBool | hasShape() const |
public IloBool | isCapacityConstraint() const |
public IloBool | isInwardConstraint() const |
public IloBool | isNegativeConstraint() const |
public IloBool | isProvidingConstraint() const |
public IloBool | isRejected(const IloResource resource) const |
public IloBool | isSelected(const IloResource resource) const |
public IloBool | isSetup() const |
public IloBool | isStateConstraint() const |
public IloBool | isStateSetConstraint() const |
public IloBool | isSucceededBy(const IloResourceConstraint ct) const |
public IloBool | isTeardown() const |
public IloBool | isVariableResourceConstraint() const |
public IloVariableSlopeShape | makeVariableSlopeShape(IloNumVar slope) const |
public void | removeShape() const |
public IloResourceSelectionConstraint | select(const IloResource resource) const |
public void | setCalendar(IloCalendar calendar) const |
public void | setCapacityMax(const IloResource resource, IloNum max) const |
public void | setCapacityMin(const IloResource resource, IloNum min) const |
public void | setDurationMax(const IloResource resource, IloNum max) const |
public void | setDurationMin(const IloResource resource, IloNum min) const |
public void | setEndMax(const IloResource resource, IloNum max) const |
public void | setEndMin(const IloResource resource, IloNum min) const |
public void | setNext(const IloResourceConstraint ct) const |
public void | setNotNext(const IloResourceConstraint ct) const |
public void | setNotSetup() const |
public void | setNotTeardown() const |
public void | setProcessingTimeMax(const IloResource resource, IloNum max) const |
public void | setProcessingTimeMin(const IloResource resource, IloNum min) const |
public void | setRejected(const IloResource resource) const |
public void | setSelected(const IloResource resource) const |
public void | setSetup() const |
public void | setStartMax(const IloResource resource, IloNum max) const |
public void | setStartMin(const IloResource resource, IloNum min) const |
public void | setSuccessor(const IloResourceConstraint ct) const |
public void | setTeardown() const |
public void | unsetNext(const IloResourceConstraint ct) const |
public void | unsetSelection(const IloResource resource) const |
public void | unsetSetup() const |
public void | unsetSuccessor(const IloResourceConstraint ct) const |
public void | unsetTeardown() const |
Constructor Detail |
---|
Method Detail |
---|
This member function returns the activity of the invoking resource constraint.
This member function returns the instance of IloAltResSet
associated with the invoking constraint. If the
resource constraint was constructed with a single resource, rather than an
IloAltResSet
, this function returns an
IloAltResSet
containing only that resource.
The alternative resource set, denoted ARS
here, is local to the
invoking resource constraint. That is, it is not shared with any other
resource constraint unless a new resource constraint is subsequently as
requiring ARS
.
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 maximal required or provided quantity of
the invoking resource constraint assuming resource
is the
selected resource.
This member function returns the minimal required or provided quantity of
the invoking resource constraint assuming resource
is the
selected resource.
This member function returns the variable representing the required or provided quantity of the invoking resource constraint.
This member function returns the longest duration of the activity of the
invoking resource constraint assuming resource
is the selected
resource.
This member function returns the shortest duration of the activity of the
invoking resource constraint assuming resource
is the selected
resource.
This member function returns the latest end time of the activity of the
invoking resource constraint assuming resource
is the selected
resource.
This member function returns the earliest end time of the activity of the
invoking resource constraint assuming resource
is the selected
resource.
This member function returns the next resource constraint that affects the availability of the resource after the invoking resource constraint.
This member function returns the longest processing time for the activity
of the invoking resource constraint assuming resource
is the
selected resource.
This member function returns the shortest processing time for the
activity of the invoking resource constraint assuming resource
is the selected resource.
This member function returns the resource of the invoking resource constraint. This method throws an exception if the invoking resource constraint has an alternative resource set that does not contain exactly one element.
This function returns the instance of IloShape
associated with the resource constraint.
This member function returns the latest start time of the activity of the
invoking resource constraint assuming resource
is the selected
resource.
This member function returns the earliest start time of the activity of
the invoking resource constraint assuming resource
is the
selected resource.
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.
This function returns IloTrue
if and only if a next relation
has been added with the member function IloResourceConstraint::setNext
.
This member function returns IloTrue
if a calendar
has been attached to the invoking resource constraint. Otherwise, it returns
IloFalse
.
This function returns IloTrue
if and only if there exists a
unique resource constraint, ct
, that has been constrained to be
next after the invoking resource constraint with the member function
IloResourceConstraint::setNext
.
This function returns IlcTrue
if a shape
has been associated with the resource constraint
This member function returns IloTrue
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 IloTrue
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 resource usage enforcement
intervals of the resource has a time step greater than 1 (one).
This member function returns IloTrue
if and only if the
invoking constraint was constructed by the member function IloActivity::requiresNot
This member function returns IloTrue
if and only if the
invoking constraint was constructed by one of these member
functions: IloActivity::provides
or
IloActivity::produces
.
This member function returns IloTrue
if
resource
cannot be selected for the activity associated with
the invoking resource constraint (see member function IloResourceConstraint::setRejected
). Otherwise, it returns
IloFalse
.
This member function returns IloTrue
if resource must be
selected by the invoking constraint (see member function IloResourceConstraint::setRejected
). Otherwise, it returns
IloFalse
.
This member function returns IloTrue
if and only if the
invoking resource constraint has been constrained to be a setup resource
constraint with the member function IloResourceConstraint::setSetup
.
This member function returns IloTrue
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 IloTrue
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.
This member function returns IloTrue if and only if a successor relation
has been added with the member function IloResourceConstraint::setSuccessor
.
This member function returns IloTrue
if and only if the
invoking resource constraint has been constrained to be a teardown resource
constraint with the member function IloResourceConstraint::setTeardown
.
This member function returns IloTrue
if and only if the
invoking resource constraint has a variable representing the required
quantity or state or provided quantity.
This function associates an instance of
IloVariableSlopeShape
with the resource constraint. Shapes are only available on continuous
reservoirs. If the resource constraint already has a shape,
that shape is discarded and replaced by the newly
created one. An exception will be thrown at
extraction time if the minimal value of the slope variable is strictly
negative.
See Also:
IloShape, IloVariableSlopeShape
This function removes the instance of IloShape
associated with the resource constraint.
This member function creates and returns a constraint that specifies that
resource
must be selected for the invoking resource
constraint.
The fact that a given resource r
must not be selected for a
resource constraint rct
can be expressed by the negation of
this constraint, as follows:
model.add(!rct.select(r))
This member function attaches the calendar calendar
to the invoking resource constraint. Notice that calendars can be shared between
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 (using IloCalendar
member functions with the calendar that comes from getCalendar
)
applies to all resource constraints sharing the calendar.
This member function states that if resource
is the selected
resource, then the maximal required or provided quantity of the invoking
resource constraint is max
.
This member function states that if resource
is the selected
resource, then the minimal required or provided quantity of the invoking
resource constraint is min
.
This member function states that if resource
is the selected
resource, the longest duration of the activity of the invoking resource
constraint is max
.
This member function states that if resource
is the selected
resource, then the shortest duration of the activity of the invoking
resource constraint is min
.
This member function states that if resource
is the selected
resource, then the latest end time of the activity of the invoking resource
constraint is max
.
This member function states that if resource
is the selected
resource, then the earliest end time of the activity of the invoking
resource constraint is min
.
This member function states that if the invoking resource constraint and
ct
affect the same resource, then ct
is next after
the invoking resource constraint. There cannot exist any other resource
constraint that affects the availability of the resource and starts or
finishes between the end of the invoking resource constraint and the start
of ct
.
At extraction time if there is an empty intersection between the
alternative resource set for the invoking resource constraint and the
alternative resource set for ct
, this function has no effect,
as the condition that the two resource constraints must affect the same
resource cannot be true.
This member function states that ct
is not next after the
invoking resource constraint. This means that if the invoking resource
constraint and ct
both affect the availability of the resource,
then there must be another resource constraint that affects the availability
of the resource and it starts or finishes between the end of the invoking
resource constraint and the start of ct
.
At extraction time if there is an empty intersection between the
alternative resource set for the invoking resource constraint and the
alternative resource set for ct
, this function has no effect,
as the condition that the two resource constraints must affect the same
resource cannot be true.
This member function states that the invoking resource constraint is not a setup resource constraint. This means that if the invoking resource constraint affects the availability of the resource, there must be a different resource constraint previous to it that also affects the availability of the resource.
This member function states that the invoking resource constraint is not a teardown resource constraint. This means that if the invoking resource affects the availability of the resource, then there must be a different resource constraint that also affects the availability of the resource and occurs after the invoking resource constraint.
This member function states that if resource
is the selected
resource, then the longest processing time for the activity of the invoking
resource constraint is max
.
This member function states that if resource
is the selected
resource, the shortest processing time for the activity of the invoking
resource constraint is max
.
This member function states that it is not possible for
resource
to be selected. If resource
is not a
member of the alternative resource set of the invoking resource constraint,
this method has no effect.
This member function states that resource
must be selected
for the activity associated with the invoking constraint. If
resource
is not a member of the alternative resource set of the
invoking resource constraint, this method will result in an inconsistent
model. Any attempt to solve such a model will fail.
This member function states that the invoking resource constraint is a setup resource constraint. This means that if the invoking resource constraint affects the availability of the resource, no other resource constraint that affects the availability of the resource can be previous to it.
This member function states that if resource
is the selected
resource, the latest start time of the activity of the invoking resource
constraint is max
.
This member function states that if resource
is the selected
resource, the earliest start time of the activity of the invoking resource
constraint is min
.
This member function states that the invoking resource constraint has the
resource constraint ct
as successor. This means that if the
invoking resource constraint and ct
both affect the
availability of the resource, then the activity of ct
is
constrained to execute after the activity of the invoking resource
constraint.
At extraction time if there is an empty intersection between the
alternative resource set for the invoking resource constraint and the
alternative resource set for ct
, this function has no effect,
as the condition that the two resource constraints must affect the same
resource cannot be true.
This member function states that the invoking resource constraint is a teardown resource constraint. This means that if the invoking resource constraint affects the availability of the resource, then no resource constraint can exist that affects the availability of the resource after the invoking resource constraint.
This member function removes all information regarding the next relation
between the invoking resource constraint and ct
. That is, the
information specified by both of the member functions IloResourceConstraint::setNext
and IloResourceConstraint::setNotNext
is removed from the model.
This member function states that resource
is a possible
resource for the activity associated with the invoking constraint, but not
necessarily the one selected. This member function removes the information
added to the model by the IloResourceConstraint::setSelected
and
IloResourceConstraint::setRejected
member functions.
This member function removes all setup information from the invoking
resource constraint. That is, this member function removes all information
added to the model by the member functions IloResourceConstraint::setSetup
and setNotSetup
.
This member function removes all information regarding the successor
relation between the invoking resource constraint and ct
. That
is, the information specified by the member function
setSuccessor(ct)
is removed from the model.
This member function removes all teardown information from the invoking
resource constraint. That is, this member function removes all information
added to the model by the member functions IloResourceConstraint::setTeardown
and setNotTeardown.