# AlpsSolutionPool Class Reference

In the solution pool we assume that the lower the priority value the more desirable the solution is. More...

`#include <AlpsSolutionPool.h>`

Inheritance diagram for AlpsSolutionPool:
[legend]
Collaboration diagram for AlpsSolutionPool:
[legend]

List of all members.

## Public Member Functions
| AlpsSolutionPool (int maxsols=1)
virtual | ~AlpsSolutionPool ()
int | getNumKnowledges () const
| query the current number of solutions
bool | hasKnowledge () const
| return true if there are any solution stored in the solution pool
std::pair< AlpsKnowledge *, double > | getKnowledge () const
| Get a solution from solution pool, doesn't remove it from the pool.
void | popKnowledge ()
| Remove a solution from the pool.
void | addKnowledge (AlpsKnowledge *sol, double priority)
| Append the solution to the end of the vector of solutions.
int | getMaxNumKnowledges () const
| query the maximum number of solutions
void | setMaxNumKnowledges (int maxsols)
| reset the maximum number of solutions
std::pair< AlpsKnowledge *, double > | getBestKnowledge () const
| Return the best solution.
void | getAllKnowledges (std::vector< std::pair< AlpsKnowledge *, double > > &sols) const
| Return all the solutions of the solution pool in the provided argument vector.
void | clean ()
| Delete all the solutions in pool.
## Private Member Functions
| AlpsSolutionPool (const AlpsSolutionPool &)
AlpsSolutionPool & | operator= (const AlpsSolutionPool &)
## Private Attributes
std::multimap< double, AlpsSolution * > | solutions_
int | maxNumSolutions_

## Detailed Description

In the solution pool we assume that the lower the priority value the more desirable the solution is.

Definition at line 33 of file AlpsSolutionPool.h.

## Constructor & Destructor Documentation

AlpsSolutionPool::AlpsSolutionPool | ( | const AlpsSolutionPool & |  | ) | `[private]`

AlpsSolutionPool::AlpsSolutionPool | ( | int | maxsols = `1` | ) | `[inline]`

Definition at line 57 of file AlpsSolutionPool.h.

virtual AlpsSolutionPool::~AlpsSolutionPool | ( |  | ) | `[inline, virtual]`

Definition at line 58 of file AlpsSolutionPool.h.

## Member Function Documentation

AlpsSolutionPool& AlpsSolutionPool::operator= | ( | const AlpsSolutionPool & |  | ) | `[private]`

Reimplemented from AlpsKnowledgePool.

int AlpsSolutionPool::getNumKnowledges | ( |  | ) | const`[inline, virtual]`

query the current number of solutions

Implements AlpsKnowledgePool.

Definition at line 66 of file AlpsSolutionPool.h.

bool AlpsSolutionPool::hasKnowledge | ( |  | ) | const`[inline, virtual]`

return true if there are any solution stored in the solution pool

Reimplemented from AlpsKnowledgePool.

Definition at line 71 of file AlpsSolutionPool.h.

std::pair<AlpsKnowledge*, double> AlpsSolutionPool::getKnowledge | ( |  | ) | const`[inline, virtual]`

Get a solution from solution pool, doesn't remove it from the pool.

It is implemented same as getBestKnowledge().

Implements AlpsKnowledgePool.

Definition at line 80 of file AlpsSolutionPool.h.

void AlpsSolutionPool::popKnowledge | ( |  | ) | `[inline, virtual]`

Remove a solution from the pool.

Reimplemented from AlpsKnowledgePool.

Definition at line 87 of file AlpsSolutionPool.h.

void AlpsSolutionPool::addKnowledge | ( | AlpsKnowledge * | sol,
|  | double | priority |
| ) |  |  | `[inline, virtual]`

Append the solution to the end of the vector of solutions.

The solution pool takes over the ownership of the solution

Implements AlpsKnowledgePool.

Definition at line 104 of file AlpsSolutionPool.h.

int AlpsSolutionPool::getMaxNumKnowledges | ( |  | ) | const`[inline, virtual]`

query the maximum number of solutions

Reimplemented from AlpsKnowledgePool.

Definition at line 121 of file AlpsSolutionPool.h.

void AlpsSolutionPool::setMaxNumKnowledges | ( | int | maxsols | ) | `[inline, virtual]`

reset the maximum number of solutions

Reimplemented from AlpsKnowledgePool.

Definition at line 136 of file AlpsSolutionPool.h.

std::pair<AlpsKnowledge*, double> AlpsSolutionPool::getBestKnowledge | ( |  | ) | const`[inline, virtual]`

Return the best solution.

The callee must not delete the returned pointer!

Reimplemented from AlpsKnowledgePool.

Definition at line 155 of file AlpsSolutionPool.h.

void AlpsSolutionPool::getAllKnowledges | ( | std::vector< std::pair< AlpsKnowledge *, double > > & | sols | ) | const`[inline, virtual]`

Return all the solutions of the solution pool in the provided argument vector.

The callee must not delete the returned pointers!

Reimplemented from AlpsKnowledgePool.

Definition at line 173 of file AlpsSolutionPool.h.

void AlpsSolutionPool::clean | ( |  | ) | `[inline]`

Delete all the solutions in pool.

Definition at line 183 of file AlpsSolutionPool.h.

## Member Data Documentation

std::multimap< double, AlpsSolution* > AlpsSolutionPool::solutions_`[private]`

Definition at line 42 of file AlpsSolutionPool.h.

int AlpsSolutionPool::maxNumSolutions_`[private]`

Definition at line 43 of file AlpsSolutionPool.h.

The documentation for this class was generated from the following file:

- /home/coin/svn-release/Bcps-0.93.11/Alps/src/AlpsSolutionPool.h