Overview | Group | Tree | Graph | Index | Concepts |
An instance of the class IloIntervalList
represents a list
of non-overlapping intervals. Each interval [timeMin, timeMax)
from the list is associated with a numerical type.
Note that if n is the number of intervals in the list, the
random access to a given interval (see the member functions IloIntervalList::addInterval
, IloIntervalList::contains
, and
IloIntervalList::removeInterval
) has a worst-case complexity
in O(log(n)).
Furthermore, when two consecutive intervals of the list have the same types, these intervals are merged so that the list is always represented with the minimal number of intervals.
See Also:
IloIntervalListCursor, IloUnion, IloDifference
Constructor Summary | |
---|---|
public | IloIntervalList(const IloEnv, IloNum, IloNum, const char *) |
public | IloIntervalList(const IloEnv, const IloNumArray, const IloNumArray, const char *) |
Method Summary | |
---|---|
public void | addInterval(IloNum, IloNum, IloNum) |
public void | addPeriodicInterval(IloNum, IloNum, IloNum, IloNum, IloNum) |
public IloBool | contains(const IloIntervalList) |
public void | dilate(IloNum) |
public void | empty() |
public IloNum | getDefinitionIntervalMax() |
public IloNum | getDefinitionIntervalMin() |
public IloBool | isEmpty() |
public IloBool | isKeptOpen() |
public void | keepOpen(IloBool) |
public void | removeInterval(IloNum, IloNum) |
public void | removeIntervalOnDuration(IloNum, IloNum) |
public void | removePeriodicInterval(IloNum, IloNum, IloNum, IloNum) |
public void | setDifference(const IloIntervalList) |
public void | setPeriodic(const IloIntervalList, IloNum, IloNum) |
public void | setUnion(const IloIntervalList) |
public void | shift(IloNum) |
Constructor Detail |
---|
This constructor creates a new instance of IloIntervalList
and adds it to the set of interval lists managed in the given environment.
The arguments min
and max
respectively represent
the origin and the horizon of the interval list. The new interval list does
not contain any intervals.
This constructor creates an interval list whose intervals are defined by
the two arrays times
and types
. More precisely, if
n
is the size of array times
, then the size of
array types
must be n-1
and the following
contiguous intervals are created on the interval list:
[times[i],times[i+1])
with type types[i]
for all
i
in [0, n-1]
.
Method Detail |
---|
This member function adds an interval of type type
to the
invoking interval list. The start time and end time of that newly added
interval are set to start
and end
. By default, the
type of the interval is 0
. Adding a new interval that overlaps
with an already existing interval of a different type will override the
existing type on the intersection.
This member function adds a set of intervals to the invoking interval
list. For every i >= 0
such that start + i * period
< end
, an interval of [start + i * period, start + duration
+ i * period)
is added. By default, the type of these intervals is
0
. Adding a new interval that overlaps with an already existing
interval of a different type will override the existing type on the
intersection.
This member function returns IloTrue
if and only if each
interval of intervals
is included in an interval of the
invoking interval list, regardless of interval type.
This member function multiplies by k
the scale of times for
the invoking interval list. k
must be a positive number.
This member function removes all the intervals from the invoking interval list.
This member function returns the right most point (horizon) of the definition interval of the invoking interval list.
This member function returns the left most point (origin) of the definition interval of the invoking interval list.
This member function returns IloTrue
if and only if the
invoking interval list is empty.
This member function returns IloTrue
if the interval list
must be kept open. Otherwise, it returns IloFalse
.
If the argument val
is equal to IloTrue
, this
member function states that the invoking interval list must be kept open
during the search for a solution to the problem. It means that additional
intervals may be added during the search. Otherwise, if the argument
val
is equal to IloFalse
, it states that all the
intervals of the invoking interval list will be defined in the model before
starting to solve the problem. By default, it is supposed that all the
intervals of the invoking interval list are defined in the model before
starting to solve the problem.
This member function removes all intervals on the invoking interval list
between start
and end
. If start is placed inside
an interval [start1, end1)
, that is, start1 < start
< end1
, this results in an interval [start1, start)
.
If end
is placed inside an interval [start2, end2)
this results in an interval [end, end2)
.
This member function removes all intervals on the invoking resource
between start
and start
+
duration
.
This member function removes intervals from the invoking interval list.
More precisely, for every i >= 0
such that start + i *
period < end
, this function removes all intervals between
start + i * period
and start + duration + i * period
.
This member function removes from the invoking interval list all the
intervals
contained in the interval list
intervals
. The definition interval of the invoking interval
list is not changed.
This member function initializes the invoking interval list as an
interval list that repeats the interval list intervals n
times
after x0
.
This member function sets the invoking interval list to be the union
between the current interval list and the interval list
intervals
. An instance of IloException
is thrown
if two intervals with different types overlap. The definition interval of
the invoking interval list is set to the union between the current
definition interval and the definition interval of
intervals
.
This member function shifts the intervals of the invoking interval list
from dx
to the right if dx > 0
or from
-dx
to the left if dx < 0
. It has no effect if
dx = 0
.