Overview | Group | Tree | Graph | Deprecated | Index | Concepts |
An instance of this class is a constrained interval
sequence variable in the optimizer engine.
You retrieve an instance of IlcIntervalSequenceVar
from an instance of
IloIntervalSequenceVar
in the model by using the member function
IlcIntervalSequenceVar IlcCPEngine::getIntervalSequence(const
IloIntervalSequenceVar) const
.
The intent of this class is to sequence a set of intervals,
instances of IlcIntevalVariable
. The sequence is
a succession of intervals that is associated with a
chronology in a scheduling model. The underlying constrained data
structure associated with an interval sequence variable in the
optimizer engine is a Head-Tail Graph.
The members functions of this class give access to the presence status of an interval in the sequence, to which set (tail, head, not sequenced, head candidate or tail candidate) an interval belongs to, to the earliest and latest interval of the head and tail, and to the immediate neighbors of an interval in the head or tail. Modifiers set the presence of an interval, extend the head and tail or remove a head or tail candidate. The propagation is triggered by events on the presence of an interval in the sequence and on head and tail extension. These events are associated with the delta-domain. Member functions give access to some useful functions to constrain partial subsequences independently of any chronology.
For more information on interval variables and the search API for scheduling, see the concept Search API for scheduling in CP Optimizer.
Inner Enumeration | |
---|---|
IlcIntervalSequenceVar::Filter |
Filter for the subsets of a Head-Tail graph of an
instance of IlcIntervalSequenceVar .
|
Inner Class | |
---|---|
IlcIntervalSequenceVar::Iterator | The class of iterator for the Head-Tail graph of a sequence. |
Method Detail |
---|
This member function extends the head subsequence of the invoking
instance of IlcIntervalSequenceVar
with the argument
var
. If the interval
argument is not a head candidate, it is set as absent from the invoking
sequence. Otherwise, the argument interval is sequenced latest in the head and
an extend head event on the sequence is triggered by the optimizer engine.
If the interval argument and the latest in head interval of the invoking sequence are both present, the modifier is equivalent to stating that the interval is the immediate successor of the latest interval in the invoking sequence.
This member function extends the tail subsequence of the invoking
instance of IlcIntervalSequenceVar
with the argument var
. If the
interval argument is not a tail candidate, it is set as absent from the invoking
sequence. Otherwise, the argument interval is sequenced latest in the tail and an
extend tail event on the sequence is triggered by the optimizer engine.
If the interval argument and the latest in tail interval of the invoking sequence are both present, the modifier is equivalent to stating that the interval is the immediate successor of the latest interval in the invoking sequence.
This member function returns the instance of
IlcCPEngine
associated with the invoking
instance of IlcIntervalSequenceVar
.
This member function returns the instance of
IlcIntervalVar
whose presence has been fixed in
a presence event. That is, it is the delta-domain corresponding
with a whenPresence
event on the invoking instance
of IlcIntervalSequenceVar
. If the argument
interval is absent, it is not removed from the sequence subsets:
for example, it remains in the head subsequence if it was.
Note that this member function is only valid while executing the demons associated with the contribution event of the sequence. In any other context, this member function must not be used.
Here is an example of how to write a demon with such an event:
ILCDEMON1(MyPresenceEventDemon, IlcIntervalSequenceVar, seq) { IlcIntervalVar var = seq.getDeltaPresence(); IlcIntervalVar prev, next; if (var.isInHead()) { IlcIntervalSequenceVar::Iterator it(seq, IlcIntervalSequenceVar::Head, var); it--; if (it.ok()) prev = (*it); (it++)++; if (it.ok()) next = (*it); .. in head propagation for prev, next, and var... } else if (var.isInTail()) { .. do similar with in tail case .. } }
This member function returns the instance of IlcIntervalVar
which is the earliest interval in the head subsequence of the invoking
instance of IlcIntervalSequenceVar
. It is before any
other non-absent intervals of the sequence. If the head subsequence is empty,
this function returns an empty handle.
This member function returns the instance of IlcIntervalVar
which is the earliest interval in the tail subsequence of the invoking
instance of IlcIntervalSequenceVar
. Any
other non-absent interval of the sequence is before it. If the tail
subsequence is empty, this function returns an empty handle.
This member function returns the instance of
IlcIntervalVar
which was the earliest
newly in the head of the invoking instance of
IlcIntervalSequenceVar
for a head
extension event processed on the sequence by the
optimizer engine. In practice, the intervals which are
newly in the head in the extension event, the
domain-delta for the event, are the subsequence between this
interval and the interval returned by the member function
IlcIntervalSequenceVar::getLatestInHead()
.
Note: This member function is only valid while executing the demons associated with the ranked first event of the sequence. In any other context, this member function must not be used.
Here is a code sample of how to use this member function.
ILCDEMON1(MyHeadExtensionDemon, IlcIntervalSequenceVar, seq) { IlcIntervalVar prev = seq.getLatestInOldHead(); IlcIntervalVar next = seq.getEarliestNewInHead(); for(IlcIntervalSequenceVar::Iterator it(seq, IlcIntervalSequenceVar::Head, next); it.ok(); ++it) { IlcIntervalVar next = *it; if (prev.getImpl()) .. propagate between next and prev .. prev = next; } .. propagate on non sequenced from prev .. }
This member function returns the instance of
IlcIntervalVar
which was the earliest
newly in the tail of the invoking instance of
IlcIntervalSequenceVar
for a tail
extension event processed on the sequence by the
optimizer engine. The intervals which are
newly in the tail in the extension event, the domain-delta
for the event, are the subsequence between this
interval and the interval returned by the member function
IlcIntervalSequenceVar::getLatestInTail()
.
Note: This member function is only valid while executing the demons associated with a tail extension event of the sequence. In any other context, this member function must not be used.
Here is a code sample of how to use this member function.
ILCDEMON1(MyTailExtensionDemon, IlcIntervalSequenceVar, seq) { IlcIntervalVar next = seq.getLatestInOldTail(); IlcIntervalVar prev = seq.getEarliestNewInTail(); for(IlcIntervalSequenceVar::Iterator it(seq, IlcIntervalSequenceVar::Tail, prev); it.ok(); ++it) { IlcIntervalVar prev = *it; if (next.getImpl()) .. propagate between next and prev .. next = prev; } .. propagate on non sequenced to next .. }
This member function returns the instance of IlcIntervalVar
which is the lastest interval in the head subsequence of the invoking
instance of IlcIntervalSequenceVar
. Any
other interval in the head is before it, and it is before any
non-absent, not-in-head interval of the sequence. If the head subsequence
is empty, this function returns an empty handle.
This member function returns the instance of
IlcIntervalVar
which was the latest in the head
of the invoking instance of IlcIntervalSequenceVar
the last time a head extension event was processed on the
sequence by the optimizer engine. The
intervals which were in the head at the last head extension event,
the old domain for the event, are the subsequence
between the interval returned by the member function
IlcIntervalSequenceVar::getEarliestInHead()
and the the interval returned by this member function.
This subsequence is eventually empty; in such a case
this member function returns an empty handle.
Note: This member function is only valid while executing the demons associated with the extend head event of the sequence. In any other context, this member function must not be used.
This member function returns the instance of
IlcIntervalVar
which was the latest in the tail
of the invoking instance of IlcIntervalSequenceVar
the last time a tail extension event was processed on the
sequence by the optimizer engine. The
intervals which were in the tail at the last tail extension event,
the old domain for the event, comprise the subsequence
between the interval returned by the member function
IlcIntervalSequenceVar::getEarliestInTail()
and the interval returned by this member function.
This subsequence is eventually empty; in such a case
this member function return an empty handle
Note: This member function is only valid while executing the demons associated with the ranked first event of the sequence. In any other context, this member function must not be used.
This member function returns the instance of IlcIntervalVar
which is the latest interval in the tail subsequence of the invoking
instance of IlcIntervalSequenceVar
. It is before
any other interval in the tail, and any non-absent, not-in-tail interval
of the sequence is before it. If the tail subsequence
is empty, this function returns an empty handle.
This member function returns the instance of IlcIntervalVar
which is the latest present interval in the head subsequence of the
invoking instance of IlcIntervalSequenceVar
.
Any other present interval which is in the head is before it.
If the head subsequence is empty or if any interval in head
is not present, this function returns an empty handle.
The main usage of this interval is to compute the set of candidate head intervals of the invoking sequence. A candidate head interval is a non-sequenced interval that can be an immediate successor of one of the intervals in the subsequence from the "Latest Present In Head" to the "Latest In Head".
This member function returns the instance of IlcIntervalVar
which is the latest present interval in the tail subsequence of the
invoking instance of IlcIntervalSequenceVar
.
It is before any other present interval which is in the tail.
If the tail subsequence is empty or if any interval in the tail
is not present, this function returns an empty handle.
The main usage of this interval is to compute the set of candidate tail intervals of the invoking sequence. A candidate tail interval is a non-sequenced interval that can be an immediate predecessor of one of the intervals in the subsequence from the "Latest Present In Tail" to the "Latest In Tail".
This member function returns the instance of
IlcIntervalVar
which is the closest earlier neighbor of the argument
var
in the
head of the invoking instance of IlcIntervalSequenceVar
.
If var
is the earliest interval in the head of
the invoking sequence, this method returns an empty handle.
var
must be in the head and cannot be an empty handle.
This member function returns the instance of IlcIntervalVar
which is the the closest earlier neighbor of the argument
var
in the
tail of the invoking instance of IlcIntervalSequenceVar
.
If var
is the earliest interval in the tail of
the invoking sequence, this method returns an empty
handle. var
must be in the tail and cannot be an empty handle.
This member function returns the instance of IlcIntervalVar
which is the closest later neighbor of the argument
var
in the
head of the invoking instance of IlcIntervalSequenceVar
.
If var
is the latest interval in the head of
the invoking sequence, this method returns an empty handle. If
var
is an empty handle, it returns the earliest
interval in the head of the sequence. var
must be in head.
This member function returns the instance of IlcIntervalVar
which is the closest later neighbor of the argument
var
in the
tail of the invoking instance of IlcIntervalSequenceVar
.
If var
is the latest interval in the tail of
the invoking sequence, this method returns an empty handle. If
var
is an empty handle, it returns the earliest
interval in the tail of the sequence. var
must be in the tail.
This member function returns the type of the
interval variable var
, a
member of the invoking instance of IlcIntervalSequenceVar
.
For more information about the type of a interval in a sequence,
see the concept
Interval variable sequencing in CP Optimizer.
This member function returns IlcTrue
if the
argument var
,
a member of the invoking instance of IlcIntervalSequenceVar
,
is absent in the sequence. Note that the interval variable has been
or will be propagated to be absent by the optimizer engine.
Otherwise, it returns IlcFalse
.
If argument var
is an empty handle, this
member function returns IlcFalse
.
An absent interval in the sequence, but in the delta of a
presence event, is still traversed by an instance of
IlcIntervalSequenceVar::Iterator
on the sequence.
This member function returns IlcTrue
if interval variable pred
will be
sequenced before interval variable succ
in the invoking sequence.
This member function returns IlcTrue
if the
argument var
,
a member of the invoking instance of IlcIntervalSequenceVar
,
is a candidate for extending the head subsequence of the sequence.
In particular, the interval variable is not absent from the sequence.
Otherwise, it returns IlcFalse
.
This member function returns IlcTrue
if the
argument var
,
a member of the invoking instance of IlcIntervalSequenceVar
,
is a candidate for extending the tail subsequence of the sequence.
In particular, the interval variable is not absent from the sequence.
Otherwise, it returns IlcFalse
.
This member function returns IlcTrue
if
the interval variable arguments earlier
and
later
are in the head of the invoking instance of
IlcIntervalSequenceVar
and earlier
is strictly earlier than
later
.
Otherwise, it returns IlcFalse
.
Note that a null handle interval variable is earlier than any interval variable in the head of a sequence.
This member function returns IlcTrue
if
the interval variable arguments earlier
and
later
are in the tail of the invoking instance of
IlcIntervalSequenceVar
and earlier
is strictly earlier than
later
.
Otherwise, it returns IlcFalse
.
Note that a null handle interval variable is earlier than any interval variable in the tail of a sequence.
This member function returns IlcTrue
if interval variable a
will be sequenced first in the invoking sequence.
This member function returns IlcTrue
if the invoking instance of
IlcIntervalSequenceVar
is fixed. An interval sequence variable is
fixed if all interval variables of the sequence are present and sequenced, or absent.
Otherwise, it returns IlcFalse
.
This member function returns IlcTrue
if the
argument var
is a member of the invoking instance of
IlcIntervalSequenceVar
.
Otherwise, it returns IlcFalse
.
This member function returns IlcTrue
if the
argument var
,
a member of the invoking instance of IlcIntervalSequenceVar
,
is in the head subsequence of the sequence. Otherwise, it returns
IlcFalse
.
If argument var
is an empty handle, this
member function returns IlcTrue
.
This member function returns IlcTrue
if the
argument var
,
a member of the invoking instance of IlcIntervalSequenceVar
,
is in the tail subsequence of the sequence.
Otherwise, it returns IlcFalse
.
If argument var
is an empty handle, this
member function returns IlcTrue
.
This member function returns IlcTrue
if interval variable a
will be sequenced last in the invoking sequence.
This member function returns IlcTrue
if the
argument var
,
a member of the invoking instance of IlcIntervalSequenceVar
,
is present in the sequence. Note that the interval variable has been
or will be propagated to be present by the optimizer engine.
Otherwise, it returns IlcFalse
.
If argument var
is an empty handle, this
member function returns IlcTrue
.
This member function returns IlcTrue
if interval variable prev
will be sequenced
immediately before interval variable next
in the invoking sequence.
This member function returns IlcTrue
if the
argument var
,
a member of the invoking instance of IlcIntervalSequenceVar
,
is sequenced in the sequence. An interval variable is sequenced if it is either
in the head or tail subsequence or is absent in the sequence.
Otherwise, it returns IlcFalse
.
If argument var
is an empty handle, this
member function returns IlcTrue
.
This member function returns IlcTrue
if the invoking instance of
IlcIntervalSequenceVar
is sequenced. An interval sequence variable is
sequenced if all interval variables member of the sequence are sequenced or absent.
Otherwise, it returns IlcFalse
.
This member function sets the argument var
such that
it cannot locally extend the head subsequence of the invoking instance
of IlcIntervalSequenceVar
. If the interval argument does
not belong to the candidate head intervals of the invoking sequence,
the modifier is ignored.
If the interval argument and the latest in head interval are present
in the invoking sequence, this modifier is the opposite of the
IlcIntervalSequenceVar::extendHead
modifier.
This member function sets the argument var
such that it cannot
locally extend the tail subsequence of the invoking instance of IlcIntervalSequenceVar
.
If the interval argument does not belong to the candidate tail intervals of the
invoking sequence, the modifier is ignored.
If the interval argument and the latest in tail interval are present in the
invoking sequence, this modifier is the opposite of the
IlcIntervalSequenceVar::extendTail
modifier.
This member sets the interval variable
argument var
as absent in the invoking instance of
IlcIntervalSequenceVar
. When the
presence of the interval is fixed, a presence event on the
sequence is triggered by the optimizer engine. After
execution of the event by the propagation engine, the
absent interval is removed from the head, tail and not
sequenced interval sets of the invoking sequence.
Note that a null handle interval is a valid argument and is always present in the invoking sequence. In this case, as well for an already present interval, this member function raises a failure in propagation.
This member function sets the interval before
to be before
the interval after
in the invoking instance of
IlcIntervalSequenceVar
. At a solution, if
both intervals are present before
is ordered
before after
.
This modifier is intended to inform the head-tail graph of precedences between intervals in the invoking sequence.
This member sets the interval variable
argument var
as present in the invoking instance of
IlcIntervalSequenceVar
. When the
presence of the interval is fixed, a presence event on the
sequence is triggered by the optimizer engine.
Note that a null handle interval is a valid argument and is always present in the invoking sequence. In this case, as well for an already present interval, this member function does not change the sequence.
prev
is a
member of the invoking instance of
IlcIntervalSequenceVar
or an empty handle.next
is a
member of the invoking instance of
IlcIntervalSequenceVar
or an empty handle.This member function sets the interval prev
to be previous to the interval next
. At a solution:
prev
and next
are both present in the sequence,
next
is the immediate successor of
prev
in the sequence.prev
is an empty handle and next
is present in the
sequence, then next
is the first interval of the
sequence.prev
is present and next
is an empty handle, then
prev
is the last interval in the sequence.prev
and next
are empty handles, the sequence is empty.This modifier is intended to constrain partial subsequences in the invoking sequence. It is the way to link head and tail subsequences in the filtering algorithm of a constraint.
This member function returns a goal, an instance of
IlcGoal
, that is a choice point
(IlcOr
) labeled by
the integer argument
label
. The choice point tries to extend
the head subsequence of the invoking instance of
IlcIntervalSequenceVar
by the argument
var
, an instance of IlcIntervalVar
.
The sequence should not be sequenced and the interval
should be a candidate for the head (member function
IlcIntervalSequenceVar::isCandidateHead
).
Roughly speaking, the left branch of the choice point calls
IlcIntervalSequenceVar::extendHead
with the
interval as the argument and the right branch calls
IlcIntervalSequenceVar::removeCandidateHead
with the interval as the argument.
This goal is intended to build the sequence of intervals in a
chronological manner. The argument interval var
as well
as all of the intervals already in the head should have their presence
statuses fixed.
This member function returns a goal, an instance of
IlcGoal
that is a choice point
(IlcOr
) labeled by
the integer argument label
. The
choice point tries to extend the tail subsequence of the
invoking instance of IlcIntervalSequenceVar
by the
argument var
, an instance of IlcIntervalVar
.
The sequence should not be sequenced and the interval
should be a candidate for the tail (member function
IlcIntervalSequenceVar::isCandidateTail
).
Roughly speaking the left branch of the choice point calls
IlcIntervalSequenceVar::extendTail
with the
interval as the argument and the right branch calls
IlcIntervalSequenceVar::removeCandidateTail
with the interval as the argument.
This goal is intended to build the sequence of intervals
reverse chronologically. The argument interval var
as well as all
of theintervals already in the tail should have their presence statuses
fixed.
This member function creates a head extension event on the
invoking instance of IlcIntervalSequenceVar
. It
associates the argument d
with the extension of
the head subsequence of the sequence.
IlcIntervalSequenceVar::getEarliestNewInHead()
and the the interval returned by the member function
IlcIntervalSequenceVar::getLatestInHead()
. This
subsequence cannot be empty.IlcIntervalSequenceVar::getEarliestInHead()
and the the interval returned by the member function
IlcIntervalSequenceVar::getLatestInOldHead()
.
This subsequence is eventually empty.Since a constraint is also a demon, a constraint can also be passed as an argument to this member function. Whenever the invoking sequence has a head extension, the constraint will be propagated.
This member function can only be used during the posting of a constraint.
This member function creates a tail extension event on the
invoking instance of IlcIntervalSequenceVar
. It
associates the argument d
with the extension of
the tail subsequence of the sequence.
IlcIntervalSequenceVar::getEarliestNewInTail()
and the interval returned by the member function
IlcIntervalSequenceVar::getLatestInTail()
. This
subsequence cannot be empty.IlcIntervalSequenceVar::getEarliestInTail()
and the interval returned by the member function
IlcIntervalSequenceVar::getLatestInOldTail()
.
This subsequence is eventually empty.Since a constraint is also a demon, a constraint can also be passed as an argument to this member function. Whenever the invoking sequence has a tail extension, the constraint will be propagated.
This member function can only be used during the posting of a constraint.
This member function creates a not sequenced event on the
invoking instance of IlcIntervalSequenceVar
. It
associates the argument d
with a change of
the candidate head and candidate tail subset of the sequence.
In practice, after having updated the Head-Tail graph with the demons of propagation of presence, extend head and extend tail events, you may have still some reason to change the set of head or tail candidates. The rule to apply to the constraints is that if a candidate head (resp. tail) interval variable is certainly after another not sequenced interval variable, then it cannot belong to the candidate tail (resp. head) subset.
This kind of filtering algorithm is generally quadratic in number of non-sequenced intervals (unless there is some better knowledge from the constraint). This is why the demons associated with this event are triggered at low priority compared with other events on the sequence. The not sequenced event is propagated after reaching the fix point of the propagation of the invoking sequence for the presence and head/tail extension propagation.
This member function creates a presence event on the
invoking instance of IlcIntervalSequenceVar
. It
associates the argument demon
with the
presence change of an interval in the sequence. The interval whose
presence is fixed, the domain-delta of this event, is given
by calling the member function getDeltaPresence()
on the invoking sequence. If this interval is absent, it is
not yet removed from the sequence subsets: for example, it remains in head
if it was there. This allows to initialize an iterator, an instance of
IlcIntervalSequenceVar::Iterator
, thanks to the
newly absent interval in a propagation algorithm.
Since a constraint is also a demon, a constraint can also be passed as an argument to this member function. Whenever the invoking sequence has a interval contribution fixing, the constraint will be propagated.
This member function can only be used during the posting of a constraint.
Inner Enumeration Detail |
---|
IlcIntervalSequenceVar
.
This enumeration provides a mechanism to indicate on which
subset of the intervals of a sequence, an instance of
IlcIntervalSequenceVar
, an iterator instance of
IlcIntervalSequenceVar::Iterator
will traverse:
head, tail, not sequenced, candidate head, candidate tail.
See Also:
IlcIntervalSequenceVar, IlcIntervalSequenceVar::Iterator
Fields |
---|
Head | Used to iterate on the head subsequence of the sequence. |
Tail | Used to iterate on the tail subsequence of the sequence. |
NotSequenced | Used to iterate the non-sequenced intervals of the sequence, that is, neither in the head nor in the tail. |
CandidateHead | Used to iterate the intervals that are candidates to extend the head subsequence of the sequence. |
CandidateTail | Used to iterate the intervals that are candidates to extend the tail subsequence of the sequence. |