Overview | Group | Tree | Graph | Index | Concepts |
The class IlcActivity
is the class for managing activities.
Activities can be linked together by precedence constraints
(instances of the class IlcPrecedenceConstraint
). Activities can be linked to
resources by resource constraints (instances of the class
IlcResourceConstraint
). Activities can also
be constrained temporally by instances of the class IlcTimeBoundConstraint
.
Calendars, Processing Time, and Duration
In most of the cases, the four variables defining an activity
are linked through the following relation: start+duration==end.
Also, as the processing time corresponds to the nominal duration of the
activity, duration==processingTime. Nevertheless, when
calendars are defined, the activity duration can be greater than
the nominal one due to break suspensions or efficiency.
So the duration of an activity depends on the nominal duration and
its ability to deal with breaks, isBreakable, and with
efficiency, useEfficiency. Such abilities are defined
by the IlcActivity
constructor arguments
breakable
and useEfficiency
.
Notice that a breakable activity can only be suspended by breaks; it cannot be suspended to execute another activity.
For a given instance of a breakable activity, some breaks may be allowed to suspend the activity while others may not. A break is said to be disjunctive with respect to a breakable activity if the activity cannot be suspended by that break—that is, the activity must be processed either before the break or after it.
By default, only the breaks with a duration equal to zero are considered as disjunctive.
The notion of a start (end) break overlap variable allows expression of the fact that an activity can start (finish) the processing inside some special breaks—called possibly overlapped breaks—and allows posting of constraints on possible overlap duration.
Restrictions with the use of break overlap variables on activities:
mayBeSuspendedAtEnd
.
mayBeSuspendedAtStart
.In order to model more efficiently disjuntive behaviors and forbidden
dates, it is possible to use shift objects
IlcShiftObject
attached
to an IlcCalendar
. Shifts can be represented directly in
intention by the user or in extension using an IlcIntervalList
.
Using interval types, activity can ignore some breaks or shifts.
Detecting Inconsistencies
When changing the domain of a start time variable, an end time variable, a duration variable, or a processing time variable, Scheduler Engine will detect an inconsistency if a changed domain directly conflicts with temporal constraints and with the resource constraints of activities with fixed (instantiated) start and end times and processing time.
Scheduler Engine may or may not detect the inconsistency if the changed domain conflicts with the temporal and resource constraints associated with unscheduled activities, that is, activities for which the start and end times and/or the processing time are not instantiated yet.
Consuming Resources
An activity consumes a resource if some amount of the resource capacity must be made available for the execution of the activity and the capacity is non-recoverable, that is, the capacity is required from the beginning of the activity up to the end of time.
Producing and Consuming Reservoirs
An activity produces if some amount of the reservoir capacity is made available through the execution of the activity.
Time Extents
By default, an activity uses a resource from the activity's start time to
its end time. However, it is possible to specify that a resource is used
during a time range different from the default "start to end"
range. The enumeration IlcTimeExtent
is
defined for this purpose.
Alternative Resource Set
When the member functions IlcActivity::consumes
and
IlcActivity::requires
take the argument
IlcAltResSet
, all the resources in the set must be capacity
resources. When the member functions IlcActivity::produces
and IlcActivity::provides
take
the argument IlcAltResSet
, all the resources in the set must be
reservoirs.
Functional and Integral Constraints and External Variables
Functional and integral constraints are constraints of the form
y_rct=f(x_rct)
or
y_rct=sum{start_rct->end_rct}f(t).dt
that hold for every
resource constraints rct
on a given resource (see
Functional and Integral Constraints on Resources.
External variables are useful in case some variable x_rct
or
y_rct
above is not a variable already associated with the
resource constraint (start, end, processing time of the activity, capacity
demand, etc.). In that case, member functions on IlcActivity
allow setting a given Solver variable as as external variable of the activity
and use it in the functional/integral constraint (see the enumeration
IlcSchedVariable
).
Printing or Displaying Activities
The printed representation of an instance of the class
IlcActivity
consists of two parts: its name, followed by
information about the start time, end time, duration, and if appropriate,
the processing time of the activity.
This information is enclosed in brackets and for each of the four variables, consists of either a single value (if the start time, end time, or duration is precisely known) or a minimal value and a maximal value separated by two dots. The following examples represent activities that have not been suspended by breaks:
[2 -- 3 --> 5]
represents an activity which starts at 2
and ends at 5. The duration of this activity is 3.
[2 -- 3..5 --> 5..7]
represents an activity which starts
at 2 and ends sometime between 5 and 7. The duration of this activity is
between 3 and 5.
[2..4 -- 3 --> 5..7]
represents an activity of duration 3
which starts sometime between 2 and 4 and ends sometime between 5 and 7.
The following examples represent activities that have been suspended by breaks:
[2 -- (2) 3 --> 5]
represents an activity which starts at
2 and ends at 5. The processing time of this activity is 2. Its duration is
3. Such situation can appears with calendars when breaks or efficiency ar used.
For instance, a break of duration 1 is situated between 2 and 5,
or an efficiency function with value 2/3 between 2 and 5.
[5 -- (3..5) 3..6 --> 8..11]
represents an activity of
processing time between 3 and 5 and duration between 3 and 6; it starts at 5
and ends sometime between 8 and 11.
[10..30 -- (5) (5..15) --> 15..45]
represents an activity
of processing time 5 and duration between 5 and 15; it starts sometime
between 10 and 30 and ends sometime between 15 and 45.
For more information, see Calendars, Precedence Graph Constraints, and Functional and Integral Constraints on Resources.
See Also:
IlcActivityIterator, IlcPrecedenceConstraint, IlcResourceConstraint, IlcSchedule, IlcScheduleOrPostpone, IlcSchedVariable, IlcTimeBoundConstraint
Constructor Summary | |
---|---|
public | IlcActivity() |
public | IlcActivity(IlcActivityI * impl) |
public | IlcActivity(const IlcSchedule schedule, IlcInt processingTime, IlcBool breakable=IlcFalse, IlcBool mayBeSuspendedAtStart=IlcFalse, IlcBool mayBeSuspendedAtEnd=IlcFalse, IlcBool useEfficiency=IlcFalse) |
public | IlcActivity(const IlcSchedule schedule, IlcIntVar processingTimeVariable, IlcBool breakable=IlcFalse, IlcBool mayBeSuspendedAtStart=IlcFalse, IlcBool mayBeSuspendedAtEnd=IlcFalse, IlcBool useEfficiency=IlcFalse) |
public | IlcActivity(const IlcSchedule schedule, IlcIntVar startVariable, IlcIntVar endVariable, IlcIntVar processingTimeVariable, IlcBool breakable=IlcFalse, IlcBool mayBeSuspendedAtStart=IlcFalse, IlcBool mayBeSuspendedAtEnd=IlcFalse, IlcBool useEfficiency=IlcFalse) |
public | IlcActivity(const IlcSchedule schedule, IlcIntVar startVariable, IlcIntVar endVariable, IlcIntVar processingTimeVariable, IlcIntVar durationVariable, IlcBool mayBeSuspendedAtStart=IlcFalse, IlcBool mayBeSuspendedAtEnd=IlcFalse, IlcBool useEfficiency=IlcFalse) |
Method Summary | |
---|---|
public void | addDisjunctiveBreakType(IlcIntSet setOfTypes) |
public void | addDisjunctiveBreakType(IlcInt type) |
public void | addEndBreakOverlapType(IlcInt type) |
public void | addEndBreakOverlapType(IlcIntSet typeSet) |
public void | addIgnoredBreakType(IlcIntSet setOfTypes) |
public void | addIgnoredBreakType(IlcInt type) |
public void | addIgnoredShiftType(IlcIntSet setOfTypes) |
public void | addIgnoredShiftType(IlcInt type) |
public void | addStartBreakOverlapType(IlcInt type) |
public void | addStartBreakOverlapType(IlcIntSet typeSet) |
public IlcBool | canBeSuspendedAtEnd() const |
public IlcBool | canBeSuspendedAtStart() const |
public IlcAltResConstraint | consumes(IlcAltResSet set, IlcIntVar capacity) |
public IlcAltResConstraint | consumes(IlcAltResSet set, IlcInt capacity=1) |
public IlcResourceConstraint | consumes(IlcCapResource resource, IlcIntVar capacity) |
public IlcResourceConstraint | consumes(IlcCapResource resource, IlcInt capacity=1) |
public IlcConstraint | covers(IlcActivityArray actAr) |
public IlcTimeBoundConstraint | endsAfter(IlcIntVar time) |
public IlcTimeBoundConstraint | endsAfter(IlcInt time) |
public IlcPrecedenceConstraint | endsAfterEnd(IlcActivity act, IlcIntVar) |
public IlcPrecedenceConstraint | endsAfterEnd(IlcActivity act, IlcInt delay=0) |
public IlcPrecedenceConstraint | endsAfterStart(IlcActivity act, IlcIntVar) |
public IlcPrecedenceConstraint | endsAfterStart(IlcActivity act, IlcInt delay=0) |
public IlcTimeBoundConstraint | endsAt(IlcIntVar time) |
public IlcTimeBoundConstraint | endsAt(IlcInt time) |
public IlcPrecedenceConstraint | endsAtEnd(IlcActivity act, IlcIntVar) |
public IlcPrecedenceConstraint | endsAtEnd(IlcActivity act, IlcInt delay=0) |
public IlcPrecedenceConstraint | endsAtStart(IlcActivity act, IlcIntVar) |
public IlcPrecedenceConstraint | endsAtStart(IlcActivity act, IlcInt delay=0) |
public IlcTimeBoundConstraint | endsBefore(IlcIntVar time) |
public IlcTimeBoundConstraint | endsBefore(IlcInt time) |
public IlcInt | getDurationMax() const |
public IlcInt | getDurationMaxNormalBreaks() const |
public IlcInt | getDurationMin() const |
public IlcInt | getDurationMinNormalBreaks() const |
public IlcIntVar | getDurationVariable() const |
public IlcInt | getEndBreakOverlapMax() const |
public IlcInt | getEndBreakOverlapMin() const |
public IlcIntVar | getEndBreakOverlapVariable() const |
public IlcInt | getEndMax() const |
public IlcInt | getEndMin() const |
public IlcIntVar | getEndVariable() const |
public IlcInt | getExecutionDurationMin() const |
public IlcIntVar | getExternalVar() const |
public IlcInt | getExternalVarMax() const |
public IlcInt | getExternalVarMin() const |
public IlcActivityI * | getImpl() const |
public const char * | getName() const |
public IlcAny | getObject() const |
public IlcInt | getProcessingTimeMax() const |
public IlcInt | getProcessingTimeMin() const |
public IlcIntVar | getProcessingTimeVariable() const |
public IlcSchedule | getSchedule() const |
public IloSolver | getSolver() const |
public IloSolverI * | getSolverI() const |
public IlcInt | getStartBreakOverlapMax() const |
public IlcInt | getStartBreakOverlapMin() const |
public IlcIntVar | getStartBreakOverlapVariable() const |
public IlcInt | getStartMax() const |
public IlcInt | getStartMin() const |
public IlcIntVar | getStartVariable() const |
public IlcInt | getTransitionType() const |
public IlcBool | hasEndBreakOverlapVariable() const |
public IlcBool | hasStartBreakOverlapVariable() const |
public IlcBool | isBreakable() const |
public IlcBool | isDirectlySucceededBy(IlcActivity) const |
public IlcBool | isDisjunctiveBreakType(IlcInt type) const |
public IlcBool | isExternalVarBound() const |
public IlcBool | isIgnoredBreakType(IlcInt type) const |
public IlcBool | isIgnoredShiftType(IlcInt type) const |
public IlcBool | isPostponed() const |
public IlcBool | isPostponedBackward() const |
public IlcBool | isRanked() const |
public IlcBool | isSucceededBy(IlcActivity) const |
public IlcBool | operator!=(const IlcActivity & activity) const |
public void | operator=(const IlcActivity & h) |
public IlcBool | operator==(const IlcActivity & activity) const |
public void | postpone() |
public void | postponeBackward() |
public IlcAltResConstraint | produces(IlcAltResSet set, IlcIntVar capacity) |
public IlcAltResConstraint | produces(IlcAltResSet set, IlcInt capacity=1) |
public IlcResourceConstraint | produces(IlcContinuousReservoir resource, IlcIntVar capacity) |
public IlcResourceConstraint | produces(IlcContinuousReservoir resource, IlcInt capacity=1) |
public IlcResourceConstraint | produces(IlcReservoir resource, IlcIntVar capacity) |
public IlcResourceConstraint | produces(IlcReservoir resource, IlcInt capacity=1) |
public IlcAltResConstraint | provides(IlcAltResSet set, IlcIntVar capacity, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcFalse) |
public IlcAltResConstraint | provides(IlcAltResSet set, IlcInt capacity=1, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcFalse) |
public IlcResourceConstraint | provides(IlcReservoir resource, IlcIntVar capacity, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcFalse) |
public IlcResourceConstraint | provides(IlcReservoir resource, IlcInt capacity=1, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcFalse) |
public void | removeDisjunctiveBreakType(IlcIntSet setOfTypes) |
public void | removeDisjunctiveBreakType(IlcInt type) |
public void | removeEndBreakOverlapType(IlcInt type) |
public void | removeEndBreakOverlapType(IlcIntSet typeSet) |
public void | removeIgnoredBreakType(IlcIntSet setOfTypes) |
public void | removeIgnoredBreakType(IlcInt type) |
public void | removeIgnoredShiftType(IlcIntSet setOfTypes) |
public void | removeIgnoredShiftType(IlcInt type) |
public void | removeStartBreakOverlapType(IlcInt type) |
public void | removeStartBreakOverlapType(IlcIntSet typeSet) |
public IlcResourceConstraint | requires(IlcStateResource resource, IlcAnySetVar states, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcTrue) |
public IlcResourceConstraint | requires(IlcStateResource resource, IlcAnySet states, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcTrue) |
public IlcResourceConstraint | requires(IlcStateResource resource, IlcAnyVar state, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcTrue) |
public IlcResourceConstraint | requires(IlcStateResource resource, IlcAny state, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcTrue) |
public IlcAltResConstraint | requires(IlcAltResSet set, IlcIntVar capacity, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcTrue) |
public IlcAltResConstraint | requires(IlcAltResSet set, IlcInt capacity=1, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcTrue) |
public IlcResourceConstraint | requires(IlcCapResource resource, IlcIntVar capacity, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcTrue) |
public IlcResourceConstraint | requires(IlcCapResource resource, IlcInt capacity=1, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcTrue) |
public IlcResourceConstraint | requiresNot(IlcStateResource resource, IlcAnySetVar states, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcTrue) |
public IlcResourceConstraint | requiresNot(IlcStateResource resource, IlcAnySet states, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcTrue) |
public IlcResourceConstraint | requiresNot(IlcStateResource resource, IlcAnyVar state, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcTrue) |
public IlcResourceConstraint | requiresNot(IlcStateResource resource, IlcAny state, IlcTimeExtent extent=IlcFromStartToEnd, IlcBool outward=IlcTrue) |
public void | setDuration(IlcInt duration) |
public void | setDurationMax(IlcInt durationMax) |
public void | setDurationMaxNormalBreaks(IlcInt duration) |
public void | setDurationMin(IlcInt durationMin) |
public void | setDurationMinNormalBreaks(IlcInt duration) |
public void | setEndBreakOverlap(IlcInt overlap) |
public void | setEndBreakOverlapMax(IlcInt overlapMax) |
public void | setEndBreakOverlapMin(IlcInt overlapMin) |
public void | setEndBreakOverlapVariable(IlcIntVar overlapVariable) |
public void | setEndMax(IlcInt endMax) |
public void | setEndMin(IlcInt endMin) |
public void | setEndTime(IlcInt endTime) |
public void | setExecutionDurationMin(IlcInt) |
public void | setExternalValue(IlcInt) |
public void | setExternalVar(IlcIntVar) |
public void | setExternalVarMax(IlcInt) |
public void | setExternalVarMin(IlcInt) |
public void | setName(const char * name) const |
public void | setObject(IlcAny object) const |
public void | setProcessingTime(IlcInt processingTime) |
public void | setProcessingTimeMax(IlcInt processingTimeMax) |
public void | setProcessingTimeMin(IlcInt processingTimeMin) |
public void | setStartBreakOverlap(IlcInt overlap) |
public void | setStartBreakOverlapMax(IlcInt overlapMax) |
public void | setStartBreakOverlapMin(IlcInt overlapMin) |
public void | setStartBreakOverlapVariable(IlcIntVar overlapVariable) |
public void | setStartMax(IlcInt startMax) |
public void | setStartMin(IlcInt startMin) |
public void | setStartTime(IlcInt startTime) |
public void | setSuccessor(IlcActivity ct) |
public void | setTransitionType(IlcInt value) |
public IlcTimeBoundConstraint | startsAfter(IlcIntVar time) |
public IlcTimeBoundConstraint | startsAfter(IlcInt time) |
public IlcPrecedenceConstraint | startsAfterEnd(IlcActivity act, IlcIntVar) |
public IlcPrecedenceConstraint | startsAfterEnd(IlcActivity act, IlcInt delay=0) |
public IlcPrecedenceConstraint | startsAfterStart(IlcActivity act, IlcIntVar) |
public IlcPrecedenceConstraint | startsAfterStart(IlcActivity act, IlcInt delay=0) |
public IlcTimeBoundConstraint | startsAt(IlcIntVar time) |
public IlcTimeBoundConstraint | startsAt(IlcInt time) |
public IlcPrecedenceConstraint | startsAtEnd(IlcActivity act, IlcIntVar) |
public IlcPrecedenceConstraint | startsAtEnd(IlcActivity act, IlcInt delay=0) |
public IlcPrecedenceConstraint | startsAtStart(IlcActivity act, IlcIntVar) |
public IlcPrecedenceConstraint | startsAtStart(IlcActivity act, IlcInt delay=0) |
public IlcTimeBoundConstraint | startsBefore(IlcIntVar time) |
public IlcTimeBoundConstraint | startsBefore(IlcInt time) |
public void | unsetSuccessor(IlcActivity ct) |
public IlcBool | useEfficiency() const |
Constructor Detail |
---|
This constructor creates a new instance of IlcActivity
and
adds it to the activities managed in the given schedule
. The
new activity is constrained to execute sometime between the time origin and
the time horizon of the schedule. Its processing time is set to the given
processingTime
. If the value of the argument
breakable
is equal to IlcTrue
, then the created
activity is a breakable activity; that is, an activity that can be suspended
by breaks. Otherwise and by default, the activity is a non-breakable
activity. The arguments mayBeSuspendedAtStart
and
mayBeSuspendedAtEnd
are relevant for breakable activities only.
They tell whether the activity can be suspended at its start or end time.
If the value of the argument useEfficiency
is equal to IlcTrue
,
then the created activity is able to deal with efficiency functions
defined on required resources.
See
Calendars
for more information.
This constructor creates a new instance of IlcActivity
and
adds it to the activities managed in the given schedule
. The
new activity is constrained to execute sometime between the time origin and
the time horizon of the schedule. Its processing time variable is given by
the argument processingTimeVariable
. If the value of the
argument breakable
is equal to IlcTrue
, then the
created activity is a breakable activity, that is, an activity that can be
suspended by breaks. Otherwise and by default, the activity is a
non-breakable activity. The arguments mayBeSuspendedAtStart
and
mayBeSuspendedAtEnd
are relevant for breakable activities only.
They tell whether the activity can be suspended at its start or end time.
If the value of the argument useEfficiency
is equal to IlcTrue
,
then the created activity is able to deal with efficiency functions
defined on required resources.
See
Calendars
for more information.
This constructor creates a new instance of IlcActivity
and
adds it to the activities managed in the given schedule
. The
new activity is created with the start, end and processing time variables
given as arguments. If the value of the argument breakable
is
equal to IlcTrue
, then the created activity is a breakable
activity, that is, an activity that can be suspended by breaks. Otherwise
and by default, the activity is a non-breakable activity. The arguments
mayBeSuspendedAtStart
and mayBeSuspendedAtEnd
are
relevant for breakable activities only. They tell whether the activity can
be suspended at its start or end time.
If the value of the argument useEfficiency
is equal to IlcTrue
,
then the created activity is able to deal with efficiency functions
defined on required resources.
See
Calendars
for more information.
This constructor creates a new instance of IlcActivity
and
adds it to the activities managed in the given schedule
. The
new activity is breakable. Its start, end, processing time and duration
variables are given as arguments. The arguments
mayBeSuspendedAtStart
and mayBeSuspendedAtEnd
tell
whether the activity can be suspended at its start or end time.
If the value of the argument useEfficiency
is equal to IlcTrue
,
then the created activity is able to deal with efficiency functions
defined on required resources.
See
Calendars
for more information.
Method Detail |
---|
This member function adds the set of types setOfTypes
to the
set of disjunctive break types of the invoking activity. If a break type
belongs to the set of disjunctive break types of a breakable activity, the
activity must be completely processed either before or after that type of
break.
Initially, a breakable activity is created with an empty set of disjunctive break types.
This member function adds the type type
to the set of
disjunctive break types of the invoking activity. If a break type belongs to
the set of disjunctive break types of a breakable activity, the activity
must be completely processed either before or after that type of break.
Initially, a breakable activity is created with an empty set of disjunctive break types.
For each activity, a set of break types is given that defines which break
types can possibly be overlapped by the end of the activity. This member
function adds type
to this set of break types on the invoking
activity. By default, the set is empty.
This member function is available only outside the search. In particular, it cannot be called within a goal.
For each activity, a set of break types is given that defines which break
types can possibly be overlapped by the end of the activity. This member
function adds the types in typeSet
to this set of break types
on the invoking activity. By default, the set is empty.
This member function is available only outside the search. In particular, it cannot be called within a goal.
This member function adds the set of types setOfTypes
to the set
of ignored break types of the invoking activity. That is, the invoking activity
behaves as if breaks of type included in setOfTypes
never exist.
Initially, an activity is created with an empty set of ignored break types.
This member function adds the type type
to the set of
ignored break types of the invoking activity. That is, the invoking activity
behaves as if breaks of type type
never exist.
Initially, an activity is created with an empty set of ignored break types.
This member function adds the set of types setOfTypes
to the set
of ignored shift types of the invoking activity. That is, the invoking activity
behaves as if shifts of type included in setOfTypes
never exist.
Initially, an activity is created with an empty set of ignored shift types.
This member function adds the type type
to the set of
ignored shift types of the invoking activity. That is, the invoking activity
behaves as if shifts of type type
never exist.
Initially, an activity is created with an empty set of ignored shift types.
For each activity, a set of break types is given that defines which break
types can possibly be overlapped by the start of the activity. This member
function adds type
to this set of break types on the invoking
activity. By default, the set is empty.
This member function is available only outside the search. In particular, it cannot be called within a goal.
For each activity, a set of break types is given that defines which break
types can possibly be overlapped by the start of the activity. This member
function adds the types in typeSet
to this set of break types
on the invoking activity. By default, the set is empty.
This member function is available only outside the search. In particular, it cannot be called within a goal.
This member function returns IlcTrue
if the invoking activity can
be suspended at the end of the activity. Otherwise, it returns
IlcFalse
.
This member function returns IlcTrue
if the invoking activity can
be suspended at the start of the activity. Otherwise, it returns
IlcFalse
.
An activity consumes a resource if some amount of the resource capacity must be made
available for the execution of the activity and the capacity is non-recoverable after the
end of the activity. For example, an activity might consume a raw material in
manufacturing a product.
If the resource is discrete (class
IlcDiscreteResource
,
IlcReservoir
, or
IlcDiscreteEnergy
),
the activity requires the capacity at all times after the activity's
start time. The corresponding member function implies that the occupancy of the
resource by the activity is rounded inward toward the nearest valid time that corresponds
to a time step.
These two expressions are equivalent:
activity.consumes(reservoir, capacity);
and
activity.requires(reservoir, capacity, IlcAfterStart);
If the resource is a continuous reservoir
(class IlcContinuousReservoir
), the
consumption is continuous and linear from the start time to the end time of the invoking
activity.
Since the time step of a timetable for a continuous reservoir is 1, the returned resource
constraint has no inward/outward rounding mode. Its time extent is not defined as it does
not match any case of the enumeration IlcTimeExtent
.
If the invoking activity consumes a resource in set
, the consumption will be discrete if
the selected resource is an instance of
IlcDiscreteResource
,
IlcReservoir
, or
IlcDiscreteEnergy
.
It will be continuous if the selected resource is an instance of
IlcContinuousReservoir
.
An instance of IloSolver::SolverErrorException
is thrown if either the capacity
is a strictly negative integer or if the capacity is a constrained integer variable with a
strictly negative minimal value.
This member function creates a cover constraint. This constraint states that the start time of the invoking activity is equal to the earliest of the start times of the activities in the array given as argument, and that the end time of the invoking activity is equal to the latest of the end times of the activities in the array given as argument. In other words, the invoking activity exactly covers the activities in the array given as argument.
This member function states that the invoking activity must end after or at time
. More
formally, act.endsAfter(time)
means end(act) >= time
.
This member function states that the invoking activity ends after
the end of act
. In addition, at least the given delay must elapse between
the end of act
and the end of the invoking activity.
The member function can be invoked with a negative delay
, which means
that the invoking activity can end before the end of act
, but the difference
between the end time of act
and the end time of the invoking activity cannot
exceed -delay
.
More formally, act1.endsAfterEnd(act, delay)
means
end(act1) >= end(act) + delay
.
This member function states that the invoking activity ends
after the beginning of act
. In addition, at least the given delay
must elapse between the beginning of act
and the end of the invoking activity.
The member function can be invoked with a negative delay
, which means that
the invoking activity can end before the beginning of act
, but the difference
between the start time of act
and the end time of the invoking
activity cannot exceed -delay
.
More formally, act1.endsAfterStart(act, delay)
means
end(act1) >= start(act) + delay
.
This member function states that the invoking activity must end at time
. More formally,
act.endsAt(time)
means end(act) == time
.
This member function states that exactly the given delay must elapse between the end
of act
and the end of the invoking activity.
More formally, act1.endsAtEnd(act, delay)
means
end(act1) == end(act) + delay
.
This member function states that exactly the given delay must elapse between the
beginning of act
and the end of the invoking activity.
More formally, act1.endsAtStart(act, delay)
means
end(act1) == start(act) + delay
.
This member function states that the invoking activity must end before or at time
. More
formally, act.endsBefore(time)
means end(act) <= time
.
This member function returns the longest possible duration of the invoking activity.
This member function returns the threshold duration above which all
breaks are, by default, considered as disjunctive. The default value is
IlcIntMax
.
This member function returns the shortest possible duration of the invoking activity.
This member function returns the threshold duration under which all breaks are considered as disjunctive. By default, the value of this minimal duration is 1 so that only the breaks with null duration are considered as disjunctive.
This member function returns the Solver variable that represents the duration of the invoking activity.
This member function returns the maximal value of the end break overlap variable of the invoking activity.
This member function returns the minimal value of the end break overlap variable of the invoking activity.
This member function returns the end break overlap variable of the invoking activity.
This member function returns the latest possible end time of the invoking activity.
This member function returns the earliest possible end time of the invoking activity.
This member function returns the Solver variable that represents the end time of the invoking activity.
A breakable activity executes during a set of disjoint temporal intervals. These execution intervals are separated by intervals that correspond to the breaks that suspend the activity.
This member function returns the minimal duration for the execution intervals of the invoking activity.
The default minimal duration is 1. It can be redefined by calling the
member function IlcActivity::setExecutionDurationMin
.
This member function returns the external variable of the invoking
activity. Note that by default, the external variable of an activity is a
variable with a domain [IlcIntMin, IlcIntMax]
.
This member function returns the maximal value of the external variable of the invoking activity.
This member function returns the minimal value of the external variable of the invoking activity.
This member function returns the longest possible processing time for the invoking activity.
This member function returns the shortest possible processing time for the invoking activity.
This member function returns the Solver variable that represents the processing time for the invoking activity.
This member function returns the schedule to which the invoking activity
belongs. Each activity 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 maximal value of the start break overlap variable of the invoking activity.
This member function returns the minimal value of the start break overlap variable of the invoking activity.
This member function returns the start break overlap variable of the invoking activity.
This member function returns the latest possible start time of the invoking activity.
This member function returns the earliest possible start time of the invoking activity.
This member function returns the Solver variable that represents the start time of the invoking activity.
The transition type of an activity is an integer intended to define
transition time and cost from an indexed classification of activities. It is
used by transition tables (instances of the class IlcTransitionTable
).
This member function returns the transition type of the invoking activity. By default, the transition type is set to zero.
This member function returns IlcTrue
if the invoking
activity has an end break overlap variable. Otherwise, it returns
IlcFalse
.
An end break overlap variable is created on an activity as soon as one of
the following member functions has been called: IlcActivity::addEndBreakOverlapType
, IlcActivity::setEndBreakOverlapVariable
, IlcActivity::setEndBreakOverlapMax
, IlcActivity::setEndBreakOverlapMin
, or IlcActivity::setEndBreakOverlap
.
This member function returns IlcTrue
if the invoking
activity has a start break overlap variable. Otherwise, it returns
IlcFalse
.
A start break overlap variable is created on an activity as soon as one
of the following member functions has been called: IlcActivity::addStartBreakOverlapType
, IlcActivity::setStartBreakOverlapVariable
, IlcActivity::setStartBreakOverlapMax
, IlcActivity::setStartBreakOverlapMin
, or IlcActivity::setStartBreakOverlap
.
This member function returns IlcTrue
if the invoking
activity is a breakable activity.Otherwise, it returns
IlcFalse
.
This member function returns IlcTrue
if the invoking
activity is directly succeeded by the activity act
. Otherwise,
it returns IlcFalse
.
This member function should be used only in search and only when a precedence graph constraint has been created on the schedule.
This member function returns IlcTrue
if type
is
a disjunctive break type of the invoking activity.
This member function returns IlcTrue
if and only if the
external variable of the invoking activity is bound.
This member function returns IloTrue
if the type
type
belongs to the set of ignored break types of the
invoking activity. Otherwise, it returns IloFalse
.
This member function returns IloTrue
if the type
type
belongs to the set of ignored shift types of the
invoking activity. Otherwise, it returns IloFalse
.
This member function returns IlcTrue
if the earliest start
time of the invoking activity is equal to the earliest start time at the
moment of the most recent call to the member function postpone
.
Otherwise, it returns IlcFalse
.
This member function returns IlcTrue
if the latest end time
of the invoking activity is equal to the latest end time at the moment of
the most recent call to the member function IlcActivity::postponeBackward
. Otherwise, it returns
IlcFalse
.
This member function returns IlcTrue
if all the other
activities of the schedule are constrained to execute either before or after
the invoking activity. Otherwise, it returns IlcFalse
.
This member function should be used only in search and only when a precedence graph constraint has been created on the schedule.
Before entering the search, this function returns IlcTrue
if
and only if a successor relation has been added with the member function
IlcActivity::setSuccessor
.
In search, this member function returns IlcTrue
if the
invoking activity is succeeded by the activity act
. Otherwise,
it returns IlcFalse
.
This member function should be used only when a precedence graph constraint has been created on the schedule.
This operator returns IlcTrue
if and only if activity
does
not refer to the same
implementation object as the invoking activity.
This operator returns IlcTrue
if and only if activity
refers to the same
implementation object as the invoking activity.
This function insures that the invoking activity is treated as a postponed activity until the earliest start time changes.
This function insures that the invoking activity is treated as a backward postponed activity until the latest end time changes.
An activity produces if some amount of the reservoir capacity is made
available through the execution of the activity. This member function states that the
invoking activity produces the given capacity
of the given reservoir.
If the reservoir is discrete
(class IlcReservoir
),
this member function implies that the occupancy of the reservoir by the activity is rounded inward
toward the nearest valid time that corresponds to a time step.
These two expressions are equivalent:
activity.produces(reservoir, capacity); activity.provides(reservoir, capacity, IlcAfterEnd);
If the reservoir is continuous
(class IlcContinuousReservoir
),
the production process is continuous and linear from the start time
to the end time of the invoking activity. Since the time step of a
timetable for a continuous reservoir is 1, the returned resource
constraint has no inward/outward rounding mode. Its time extent is not defined,
since it does not match any case of the enumeration
IlcTimeExtent
.
If the invoking activity produces for a reservoir in set
, the production will be
discrete if the selected reservoir is an instance of
IlcReservoir
.
It will be continuous if the selected reservoir is an instance of
IlcContinuousReservoir
).
An instance of IloSolver::SolverErrorException
is thrown if either of the following conditions occurs:
capacity
is a strictly negative integer, or capacity
is a constrained integer variable with a
strictly negative minimal value.This member function states that the invoking activity provides the given capacity
of
the given reservoir.
By default, the activity provides the reservoir from the beginning to the end of its
execution. However, the optional argument extent
is available to represent cases in
which the activity provides the reservoir over a different time extent, as explained in
IlcTimeExtent
.
The argument outward
is important only when one of the timetables of the reservoir has
a time step greater than 1 (one). In that case, outward
defines whether the occupancy of
the reservoir by the activity should be rounded outward or inward towards the nearest
valid time that corresponds to a step (apply on discrete or unary resources and
reservoirs).
An instance of IloSolver::SolverErrorException
is thrown if any of the following conditions
occurs.
capacity
is a strictly negative integercapacity
is a constrained integer variable with a strictly negative minimal value
The set of alternative resources can contain a continuous reservoir if extent
is
IlcNever
, IlcAlways
, IlcAfterStart
or IlcAfterEnd
.
If the time extent is
IlcNever
, the activity does not provide any capacity. If the time extent is IlcAlways
,
the capacity is provided at any time. If the time extent is IlcAfterStart
or
IlcAfterEnd
, the capacity is not provided before the start of the activity, is totally
provided after its end and linearly provided between its start and its end. For any other
time extent, an instance of IloSolver::SolverErrorException
is thrown.
This member function removes the set of types setOfTypes
from the set of disjunctive break types of the invoking activity. If a break
type belongs to the set of disjunctive break types of a breakable activity,
the activity must be completely processed either before or after that type
of break.
This member function is available only outside the search. In particular, it cannot be called from within a goal.
This member function removes the type type
from the set of
disjunctive break types of the invoking activity. If a break type belongs to
the set of disjunctive break types of a breakable activity, the activity
must be completely processed either before or after that type of break.
This member function is available only outside the search. In particular, it cannot be called from within a goal.
For each activity, a set of break types is given that defines which break
types can possibly be overlapped by the end of the activity. This member
function removes type
from this set of break types on the
invoking activity.
This member function is available only outside the search. In particular, it cannot be called from within a goal.
For each activity, a set of break types is given that defines which break
types can possibly be overlapped by the end of the activity. This member
function removes all the types of typeSet
from this set of
break types on the invoking activity.
This member function is available only outside the search. In particular, it cannot be called from within a goal.
This member function removes the set of types setOfTypes
from the
set of ignored break types of the invoking activity.
This member function removes the type type
from the set of
ignored break types of the invoking activity.
This member function removes the set of types setOfTypes
from the
set of ignored shift types of the invoking activity.
This member function removes the type type
from the set of
ignored shift types of the invoking activity.
For each activity, a set of break types is given that defines which break
types can possibly be overlapped by the start of the activity. This member
function removes type
from this set of break types on the
invoking activity.
This member function is available only outside the search. In particular, it cannot be called from within a goal.
For each activity, a set of break types is given that defines which break
types can possibly be overlapped by the start of the activity. This member
function removes all the types of typeSet
from this set of
break types on the invoking activity.
This member function is available only outside the search. In particular, it cannot be called from within a goal.
This member function states that the invoking activity requires the given resource in
the given state or states.
By default, the activity requires resource
from the beginning to the end of its
execution. However, the optional argument extent
is available to represent cases in
which the activity requires the resource over a different time extent, as explained in
IlcTimeExtent
.
The argument outward
is important only when one of the timetables of resource has a
time step greater than 1 (one). In that case, outward
defines whether the occupancy of
the resource by the activity should be rounded outward or inward towards the nearest
valid time that corresponds to a step.
This member function states that the invoking activity requires the given capacity
of
the given resource
. For example, an activity might require the presence of a worker on
a shift.
By default, the activity
requires the resource
from the beginning to the end of its
execution. However, the optional argument extent
is available to represent cases in
which the activity
requires the resource
over a different time extent, as explained in
IlcTimeExtent
.
The argument outward
is important only when one of the timetables of resource has a
time step greater than 1 (one). In that case, outward
defines whether the occupancy of
the resource by the activity should be rounded outward or inward towards the nearest
valid time that corresponds to a step.
When the given resource is an instance of IlcDiscreteEnergy
,
it means that the
given capacity is required for each unit of time in the given time extent.
An instance of IloSolver::SolverErrorException
is thrown when any of the
following conditions occurs:
capacity
is a strictly negative integercapacity
is a constrained integer variable with a strictly negative minimal valueThe member function must not be called if resource
is a continuous reservoir.
However, the set of alternative resources can contain a continuous reservoir if the
IlcTimeExtent
extent is
IlcNever
, IlcAlways
, IlcAfterStart
or IlcAfterEnd
.
If the time extent is
IlcNever
, the activity does not require any capacity. If the
time extent is IlcAlways
,
the capacity is required at any time. If the time extent is IlcAfterStart
or
IlcAfterEnd
, the capacity is not required before the start of the activity, is totally
required after its end and linearly required between its start and its end. For any other
time extent, an instance of IloSolver::SolverErrorException
is thrown.
Example
In the following example, activity
requires 2 units of the discrete resource
resource
. As 0 is considered a possible duration for the activity, nothing occurs when
the maximal capacity of the resource is set to 1 over the interval [0 10).
When the earliest end time of the activity becomes 5, Scheduler Engine automatically
deduces (by constraint propagation) that the activity cannot start before 5. Indeed, if
the activity starts before 5 (say, at t with t < 5), then the activity requires the
resource at least from t to 5. However, this situation is impossible since the resource
is not available in sufficient quantity. Hence, the activity cannot start before 5.
Similarly, when the minimal duration of the activity is set to 1, the earliest start time
of the activity automatically becomes 10.
/// Must be during search (e.g., inside a goal) /// IloSolver solver = getSolver(); IlcScheduler schedule(solver, 0, 24); IlcDiscreteResource resource(schedule, 3); IlcIntVar processingTime(solver,0, 24); IlcActivity activity(schedule, processingTime); solver.add(activity.requires(resource, 2)); solver.out() << activity << endl; resource.setCapacityMax(0, 10, 1); solver.out() << activity << endl; activity.setEndMin(5); solver.out() << activity << endl; activity.setProcessingTimeMin(1); solver.out() << activity << endl;
The output of that program looks like the following.
[0..24 -- 0..24 --> 0..24] [0..24 -- 0..24 --> 0..24] [5..24 -- 0..19 --> 5..24] [10..23 -- 1..14 --> 11..24]
This member function states that the invoking activity requires the given resource
in
any state that does not belong to the given state
or set of states
.
The state or states
may change during execution, but must never belong to the given state
or set of
states
.
By default, the activity requires the resource
from the beginning to the end of its
execution. However, the optional argument extent
is available to represent cases in
which the activity requires the resource over a different time extent, as explained in
IlcTimeExtent
.
The argument outward
is important only when one of the timetables of resource
has a
time step greater than 1 (one). In that case, outward
defines whether the occupancy of
the resource
by the activity should be rounded outward or inward towards the nearest
valid time that corresponds to a step.
This member function sets the duration of the invoking activity to
duration
.
Detecting Inconsistencies
When changing the domain of a start time variable, an end time variable, a duration variable, or a processing time variable, Scheduler Engine will detect an inconsistency if a changed domain directly conflicts with temporal constraints and with the resource constraints of activities with fixed (instantiated) start and end times and processing time.
Scheduler Engine may or may not detect the inconsistency if the changed domain conflicts with the temporal and resource constraints associated with unscheduled activities, that is, activities for which the start and end times and/or the processing time are not instantiated yet.
This member function states that the duration of the invoking activity
can be at most durationMax
. An inconsistency may be detected as
documented
in IlcActivity::setDuration.
This member function states that the invoking activity must be completely
processed either before or after any break whose duration is strictly
greater than duration
.
Increasing this maximal duration has no effect in search.
This member function states that the duration of the invoking activity
must be at least durationMin
. An inconsistency may be detected as documented
in IlcActivity::setDuration.
This member function states that the invoking activity must be completely
processed either before or after any break whose duration is strictly lower
than duration
.
By default, the value of this minimal duration for a breakable activity is 1 so that only the breaks with null duration are considered as disjunctive.
Decreasing this minimal duration has no effect in search.
This member function sets overlap
as the value of the end
break overlap variable.
This member function sets overlapMax
as the new maximal
value of the end break overlap variable.
This member function sets overlapMin
as the new minimal
value of the end break overlap variable.
This member function sets overlapVariable
as the end break
overlap variable of the invoking activity.
For an activity that finishes in a possibly overlapped break:
The value is defined as 0 for an activity that does not finish in a possibly overlapped break. By default, the end break overlap variable of an activity with no possibly overlapped break is considered to be bound to 0.
This member function is available only outside the search. In particular, it cannot be called from within a goal.
This member function states that the invoking activity must not end after
endMax
. An inconsistency may be detected as documented
in IlcActivity::setDuration.
This member function states that the invoking activity must not end
before endMin
. An inconsistency may be detected as documented
in IlcActivity::setDuration.
This member function sets the end time of the invoking activity to
endTime
. An inconsistency may be detected as documented
in IlcActivity::setDuration.
A breakable activity executes during a set of disjoint temporal intervals. These execution intervals are separated by intervals that correspond to the breaks that suspend the activity.
This member function states that the duration of the temporal intervals during which the invoking breakable activity executes must all be greater or equal to the value provided. Note that this value must be a strictly positive integer. By default, breakable activities are created with a minimal duration for execution intervals of 1.
In search, trying to decrease the current minimal duration for execution intervals has no effect.
This member function sets the value of the external variable of the invoking activity.
This member function sets the external variable of the invoking activity. Before entering the search, this member function will override any previous specification of external variable. This function may be called only one time during the search if no external variable has been specified. Any attempt to call this member function during the search in a situation where some external variable has already been specified on the activity will raise an error.
This member function sets the maximal value of the external variable of the invoking activity.
This member function sets the minimal value of the external variable of the invoking activity.
This member function assigns processingTime
as the
processing time for the invoking activity. An inconsistency may be detected as documented
in IlcActivity::setDuration.
This member function states that the processing time of the invoking
activity can be at most processingTimeMax
. An inconsistency may
be detected as documented
in IlcActivity::setDuration.
This member function states that the processing time of the invoking
activity must be at least processingTimeMin
. An inconsistency
may be detected as documented
in IlcActivity::setDuration.
This member function sets overlap
as the value of the start
break overlap variable.
This member function sets overlapMax
as the new maximal
value of the start break overlap variable.
This member function sets overlapMin
as the new minimal
value of the start break overlap variable.
This member function sets overlapVar
as the start break
overlap variable of the invoking activity.
For an activity that starts in a possibly overlapped break:
The value is defined as 0 for an activity that does not start in a possibly overlapped break. By default, the start break overlap variable of an activity with no possibly overlapped break is considered to be bound to 0.
This member function is available only outside the search. In particular, it cannot be called from within a goal.
This member function states that the invoking activity must not start
after startMax
. An inconsistency may be detected as documented
in IlcActivity::setDuration.
This member function states that the invoking activity must not start
before startMin
. An inconsistency may be detected as documented
in IlcActivity::setDuration.
This member function sets the start time of the invoking activity to
startTime
. An inconsistency may be detected as documented by
in IlcActivity::setDuration.
This member function states that the invoking activity has the activity
ct
as successor on the precedence graph of the schedule. That
is, this member function adds an edge on the precedence graph.
This member function should be used only when a precedence graph constraint has been created on the schedule.
The transition type of an activity is an integer intended to define
transition time and cost from an indexed classification of activities. It is
used by transition tables (instances of the class IlcTransitionTable
).
This member function sets the transition type of the invoking activity to
value
.
This member function states that the invoking activity must start after or at time
. More
formally, act.startsAfter(time)
means start(act) >= time
.
This member function states that the invoking activity starts after the end of act
.
(In other words, act
precedes the invoking activity.) In addition, at least the
given delay
must elapse between the end of act
and the beginning of the
invoking activity.
The member function can be invoked with a negative delay
, which means that the
invoking activity can start before the end of act
, but the difference between
the end time of act
and the start time of the invoking activity cannot
exceed -delay
.
More formally, act1.startsAfterEnd(act, delay)
means
start(act1) >= end(act) + delay
.
This member function states that the invoking activity starts after the beginning of act
.
In addition, at least the given delay
must elapse between the beginning of act
and the
beginning of the invoking activity.
The member function can be invoked with a negative delay
, which means that
the invoking activity can start before the beginning of act
, but the difference between
the start time of act
and the start time of the invoking activity cannot exceed -delay
.
More formally, act1.startsAfterStart(act, delay)
means start(act1) >= start(act) + delay
.
This member function states that the invoking activity must start at time
. More formally,
act.startsAt(time)
means start(act) == time
.
This member function states that exactly the given delay must
elapse between the end of act
and the beginning of the invoking activity.
More formally, act1.startsAtEnd(act, delay)
means
start(act1) == end(act) + delay
.
This member function states that exactly the given delay must
elapse between the beginning of act
and the beginning of the invoking activity.
More formally, act1.startsAtStart(act, delay)
means
start(act1) == start(act) + delay
.
This member function states that the invoking activity must start before or at time
. More
formally, act.startsBefore(time)
means start(act) <= time
.
This member function removes a successor relation that had previously
been added on the graph with IlcActivity::setSuccessor
.
This member function should be used only before entering the search and only when a precedence graph constraint has been created on the schedule.
This member function returns IloTrue
if the processing time
of the invoking activity is computed using the efficiency function of resource calendars.
Otherwise, it returns IloFalse
.