Overview | Group | Tree | Graph | Index | Concepts |
Solution pools are bags of solutions which can be used:
For example, the following code uses the buffer
pool to store
intermediate solutions which
will be processed by the consumer
processor, then stored in
the result
pool:
IloSolutionPool buffer(env); IloSolutionPool result(env); IloPoolProc producer = ...; // a processor which generates solutions IloPoolProc consumer = ...; // a processor which transforms solutions IloPoolProc proc = producer >> buffer >> consumer >> result;
IloSolutionPool
. Thus,
selection of a solution from a pool can be performed without
specification of a visitor.
See Also:
IloPoolProc, operator>>, IloVisitor, IloSelector, IloSelectSolutions, IloReplaceSolutions, IloSolution
Constructor Summary | |
---|---|
public | IloSolutionPool(const IloAnyPool & obj) |
public | IloSolutionPool(IloEnv env, const char * name=0) |
Method Summary | |
---|---|
public void | add(IloSolution elt) const |
public void | addAll(IloSolutionPool pool) const |
public void | addListener(IloListener listener) const |
public void | copy(IloSolutionPool pool) const |
public void | end() |
public void | endSolutions() const |
public IloComparator< IloSolution > | getDefaultComparator() const |
public IloEnv | getEnv() const |
public IloInt | getSize() const |
public IloComparator< IloSolution > | getSortComparator() const |
public void | remove(IloInt index) const |
public void | remove(IloSolution elt) const |
public void | removeAll() const |
public void | removeAll(IloSolutionPool pool) const |
public void | removeListener(IloListener listener) const |
public void | setSortComparator(IloComparator< IloSolution > cmp) const |
public void | sort() const |
public void | sort(IloComparator< IloSolution > cmp) const |
Inner Class |
---|
IloSolutionPool::AddedEvent |
IloSolutionPool::EndEvent |
IloSolutionPool::Event |
IloSolutionPool::Iterator |
IloSolutionPool::RemovedEvent |
Constructor Detail |
---|
0
from an 1
.
Type checking is performed to make sure that obj
was
constructed as an 0
. If this was not the case an
exception is thrown (an instance of IloException
).
1
.
This constructor creates a pool for storing objects of type
1
on the environment env
.
Method Detail |
---|
This function adds an element elt
, an instance of
1
, to the pool.
1
contained
in the given pool to the invoking pool.
This function adds all the instances of 1
in the
pool pool
to the invoking pool.
This function adds a listener listener
to the pool.
According to the event type of the listener, the listener
will be called when the pool has an element added or deleted,
or when the pool itself is destroyed.
See Also:
This function copies elements from the pool pool
into the invoking pool. All elements previously in the invoking
pool will first be removed. After execution, both pools will
contain the same elements.
This function destroys the invoking pool, but not its contents.
0
.
This function destroys all items contained in this
0
.
This function returns the default object comparator which is
inherent to the type of pool. Normally, you would never call this
function directly. It is typically called from
getSortComparator
when no sorting comparator has been
set on the pool. For example, IloSolutionPool
delivers IloBestSolutionComparator
here.
See Also:
IloSolutionPool::setSortComparator, IloSolutionPool::getSortComparator, IloBestSolutionComparator
This function returns the environment passed in the constructor.
This function returns the number of elements in the pool.
This function returns the comparator previously set using
setSortComparator
. If no sorting comparator has been set,
then the comparator returned is that from
getDefaultComparator
.
1
located at the given index from the pool.
This function removes the instance of 1
located at the given index index
from the pool.
1
from the pool.
This function removes elt
, an instance of
1
, from the pool.
1
from the pool.
This function removes all the instances of 1
from the pool.
1
contained in the given pool.
This function removes all the instances of 1
contained in the pool pool
.
This function removes the listener listener
from
the invoking pool. After execution of this member function,
listener
will no longer be called when the pool is
modified or destroyed.
This function sets the comparator cmp
used for
comparing elements of the pool. The comparator set by this method
will be used by the pool for comparing elements, particularly
during the sorting of the pool, and in retrieving the best and
worst elements.
See Also:
IloSolutionPool::getSortComparator, IloSolutionPool::sort, IloComparator
getSortComparator
.
This function sorts the pool using the comparator returned
from getSortComparator
. After sorting, the indices of
the sorted elements are smaller for preferred elements. In other
words, the objects are ranked "best first".
See Also:
IloSolutionPool::getSortComparator
This function sorts the pool using the comparator
cmp
. After sorting, the indices of the sorted elements
are smaller for preferred elements. In other words, the objects
are ranked "best first".