In the solution pool we assume that the lower the priority value the more desirable the solution is. More...
#include <AlpsSolutionPool.h>
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_ |
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.
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.
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 69 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 78 of file AlpsSolutionPool.h.
void AlpsSolutionPool::popKnowledge | ( | ) | [inline, virtual] |
Remove a solution from the pool.
Reimplemented from AlpsKnowledgePool.
Definition at line 85 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 102 of file AlpsSolutionPool.h.
int AlpsSolutionPool::getMaxNumKnowledges | ( | ) | const [inline, virtual] |
query the maximum number of solutions
Reimplemented from AlpsKnowledgePool.
Definition at line 119 of file AlpsSolutionPool.h.
void AlpsSolutionPool::setMaxNumKnowledges | ( | int | maxsols | ) | [inline, virtual] |
reset the maximum number of solutions
Reimplemented from AlpsKnowledgePool.
Definition at line 134 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 153 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 171 of file AlpsSolutionPool.h.
void AlpsSolutionPool::clean | ( | ) | [inline] |
Delete all the solutions in pool.
Definition at line 181 of file AlpsSolutionPool.h.
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.