Overview | Group | Tree | Graph | Index | Concepts |
Description |
Temporal Constraints Between Activities |
Temporal relations between resource constraints |
Precedence Constraints On Activities vs. Precedence Relations On Resource Constraints |
Scheduler allows the posting of two kinds of temporal relations in the scheduling environment: temporal constraints (IloPrecedenceConstraint
, IloTimeBoundConstraint
) between
activities of the environment, and temporal relations (precedence, sequence) between two resource constraints on the same resource.
Temporal constraints between activities are either instances of the class IloPrecedenceConstraint
or instances of the class IloTimeBoundConstraint
. Both classes are a
subclass of the IBM® ILOG® Concert Technology class
IloConstraint
.
Precedence Constraints
Precedence constraints are instances of the class IloPrecedenceConstraint
. They restrict the order of
activities. They constrain an activity to start or end before, at, or after the start or end time of another activity.
Precedence constraints are created through member functions of the class IloActivity
. Like all subclasses of
IloConstraint
, they must be
added to the model to be considered in the search for solutions.
Precedence constraints involve the concept of delay. Delay is an amount of time (constant or variable) that must elapse between the two variables involved in the precedence constraint. If the delay is negative, it indicates the
inverse of the maximal duration allowed to elapse between the two variables. In other words,
endpoint2
can occur before
endpoint1
, but the difference between them cannot exceed
-delay
. See the following figure.
Precedence constraints between activities can be enforced in different ways by the scheduling algorithm. The member function IloResource::setPrecedenceEnforcement
can be used to specify how much effort the scheduling algorithm must spend at enforcing precedence constraints between activities.
Time-Bound Constraints
Time-bound constraints are instances of the class IloTimeBoundConstraint
. They constrain an
activity to start or end before, at, or after a given time. They are created by a member function of IloActivity
. Like all subclasses of
IloConstraint
, they must be
added to the model to be considered in the search for solutions.
Scheduler allows representation of two types of temporal relations between resource constraints on the same resource: precedence relations and sequencing relations. Note that unlike temporal constraints between activities, temporal relations between resource constraints are not objects, but relations expressed with member functions of the class IloResourceConstraint
.
Before we describe in detail the different temporal relations between resource constraints, we need to introduce the concept of a contributing resource constraint.
In a model, a resource constraint
rct
is said to
surely contribute
if and only if it affects the availability of the resource. That is:
rct
has been directly added to the model (not through a metaconstraint), and
rct
is strictly greater than zero if the time extent of
rct
is
IloFromStartToEnd
, and
rct
is strictly greater than zero if
rct
is a capacity resource constraint.In a model, a resource constraint
rct
is said to
not possibly contribute
if and only if it is sure that
rct
will not affect the availability of the resource. That is:
rct
has been directly added to the model (not through a metaconstraint), or
rct
is
IloFromStartToEnd
, orrct
is a capacity resource constraint and the capacity required by
rct
is equal to zero.Precedence Relations
A precedence relation is defined between two resource constraints with the member function
setSuccessor()
.
rct1.setSuccessor(rct2)
states that if
rct1
and
rct2
surely contribute to the model, then the activity of
rct2
is constrained to execute after the activity of
rct1
on the resource (that is, the start time of the activity of
rct2
is greater than or equal to the end time of the activity of
rct1
).
Precedence relations between resource constraints can be enforced in different ways by the scheduling algorithm. The member function IloResource::setPrecedenceEnforcement
can be used to specify how much effort the scheduling algorithm must spend at enforcing precedence relations between resource constraints.
Sequencing Relations
Sequencing relations are expressed with the member functions IloResourceConstraint::setNext
, IloResourceConstraint::setSetup
, IloResourceConstraint::setNotSetup
, IloResourceConstraint::setNotNext
, IloResourceConstraint::setTeardown
and IloResourceConstraint::setNotTeardown
.
rct1.setNext(rct2)
states that if
rct1
and
rct2
surely contribute to the model, then no other resource constraint
rct
that surely contributes in the model can be executed between
rct1
and
rct2
.
rct1.setNotNext(rct2)
states that if
rct1
and
rct2
surely contribute to the model, then another resource constraint
rct
that surely contributes to the model must execute between
rct1
and
rct2
.
rct.setSetup()
states that if
rct
surely contributes to the model, then
rct
is the first resource constraint to execute on the resource.
rct.setNotSetup()
states that if
rct
surely contributes to the model, then
rct
is not the first resource constraint to execute on the resource.
rct.setTeardown()
states that if
rct
surely contributes to the model, then
rct
is the last resource constraint to execute on the resource.
rct.setNotTeardown()
states that if
rct
surely contributes to the model, then
rct
is not the last resource constraint to execute on the resource.
Sequencing relations between resource constraints can be enforced in different ways by the scheduling algorithm. The member function IloResourceParam::setSequenceEnforcement
can be used to specify how much effort the scheduling algorithm must spend at enforcing sequencing relations between resource constraints.
This section answers the question: Should one use precedence constraints between activities, or precedence relations between resource constraints? This question arises because at first glance, a precedence constraint
startsAfterEnd
between two activities and a precedence relation
setSuccessor
between two resource constraints look very similar.
There are in fact three essential differences.
rct1
and
rct2
can be seen as a metaconstraint (
rct1
does not contribute or
rct2
does not contribute or
act2.startsAfterEnd(act1)
). Precedence
constraints between activities constrain the start and end time of activities regardless of which resource the activities require.
IloConstraint
, the constraints
can be used in a metaconstraint. This is not possible for precedence relations between resource constraints.See Also
IloActivity, IloActivityConstraintsParam, IloPrecedenceConstraint, IloTimeBoundConstraint, IloResourceConstraint, IloResource, IloResourceParam.