Overview | Group | Tree | Graph | Index | Concepts |
An instance of this class traverses the set of activities.
For more information, see Precedence Graph Constraints.
See Also:
IlcActivity, IlcActivityIteratorFilter, IlcSchedule
Constructor and Destructor Summary | |
---|---|
public | IlcActivityIterator(const IlcSchedule schedule) |
public | IlcActivityIterator(IlcActivity, IlcActivityIteratorFilter filter) |
Method Summary | |
---|---|
public IlcBool | ok() const |
public IlcActivity | operator*() const |
public IlcActivityIterator & | operator++() |
Constructor and Destructor Detail |
---|
This constructor creates an iterator to traverse all the activities of
schedule
during the search. If used before entering the search,
this iterator will traverse an empty list of activities.
When a schedule precedence graph is associated with the
schedule of an activity, this constructor creates an iterator to traverse
the subset of activities specified by the filter filter
. If the
schedule is not associated with a precedence graph, this constructor raises
an error.
Before entering the search, only the filter IlcSuccessors
is
permitted. It allows the definition of an iterator that traverses the subset
of activities act0
for which the successor relation
(act,act0)
has been added with the member function
act.setSuccessor(act0)
. Any attempt to use another filter
before entering the search will raise an error. In search, all the filters
are allowed.
For example, the following loop, during the search, displays the set of
activities that are direct successors of a given activity act
in the precedence graph of the schedule:
for (IlcActivityIterator ite(act, IlcDirectSuccessors); ite.ok(); ++ite) { solver.out() << *ite << endl; }
Method Detail |
---|
This member function returns IlcTrue
if the current position
of the iterator is a valid one. It returns IlcFalse
if all the
activities have been scanned by the iterator.
This operator returns the current instance of IlcActivity
, the one to which the invoking iterator points.
If the iterator is set past the end position, then this operator returns an
empty handle.
This left-increment operator shifts the current position of the iterator
to the next instance of IlcActivity
.