FRAMES NO FRAMES

Class IlcResource::ResourceConstraintIterator

Definition file: ilsched/schedule.h
Include file: <ilsched/ilsched.h>

An instance of this class traverses specific subsets of resource constraints on a given unary or state resource. More precisely, it allows traversing the following items:

See Also:

Constructor Summary
public ResourceConstraintIterator(const IlcResource resource, IlcResource::RankFilter filter)
public ResourceConstraintIterator(const IlcResource resource, IlcResource::RankFilter filter, const IlcResourceConstraint)
Method Summary
public IlcBoolok() const
public IlcResourceConstraintoperator*() const
public ResourceConstraintIterator &operator++()
public ResourceConstraintIterator &operator--()
Constructor Detail

ResourceConstraintIterator

public ResourceConstraintIterator(const IlcResource resource, IlcResource::RankFilter filter)

This constructor creates an iterator to traverse the subset of resource constraints specified by the filter on the unary or state resource given as the first argument. In case of a filter RankedFirst, the resource constraints are traversed in the chronological order (with respect to the start/end time of activities) with the ResourceConstraintIterator::operator++ member function. In case of a filter RankedLast, the resource constraints are traversed in the anti-chronological order with the operator++ member function.

This constructor should be used only if the ranking information is available on the resource (see IlcResource::hasRankInfo).


ResourceConstraintIterator

public ResourceConstraintIterator(const IlcResource resource, IlcResource::RankFilter filter, const IlcResourceConstraint)

This constructor creates an iterator to traverse the subset of resource constraints specified by the filter on the unary or state resource given as the first argument, and starting at the resource constraint rct given as argument. An exception will be thrown in case the ranked status of the resource constraint (ranked first or last, possible first or last) is not compatible with the filter.

This constructor should be used only if the ranking information is available on the resource (see IlcResource::hasRankInfo).

In case of a filter RankedFirst, the resource constraints are traversed in the chronological order (with respect to the start/end time of activities) with the ResourceConstraintIterator::operator++, member function. In case of a filter RankedLast, the resource constraints are traversed in the anti-chronological order with the operator++ member function.


Method Detail

ok

public IlcBool ok() const

This member function returns IloTrue if the current position of the iterator is a valid one. It returns IloFalse if the subset of resource constraints has been completely scanned by the iterator.


operator*

public IlcResourceConstraint operator*() const

This operator returns the current instance of IlcResourceConstraint, the one to which the invoking iterator points. If the iterator is set past the end position, then this operator returns an empty handle.


operator++

public ResourceConstraintIterator & operator++()

This left-increment operator shifts the current position of the iterator to the next instance of IlcResourceConstraint.


operator--

public ResourceConstraintIterator & operator--()

This left-increment operator shifts the current position of the iterator to the previous instance of IlcResourceConstraint.