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 More... | |
bool | hasKnowledge () const |
return true if there are any solution stored in the solution pool More... | |
std::pair< AlpsKnowledge *, double > | getKnowledge () const |
Get a solution from solution pool, doesn't remove it from the pool. More... | |
void | popKnowledge () |
Remove a solution from the pool. More... | |
void | addKnowledge (AlpsKnowledge *sol, double priority) |
Append the solution to the end of the vector of solutions. More... | |
int | getMaxNumKnowledges () const |
query the maximum number of solutions More... | |
void | setMaxNumKnowledges (int maxsols) |
reset the maximum number of solutions More... | |
std::pair< AlpsKnowledge *, double > | getBestKnowledge () const |
Return the best solution. More... | |
void | getAllKnowledges (std::vector< std::pair< AlpsKnowledge *, double > > &sols) const |
Return all the solutions of the solution pool in the provided argument vector. More... | |
void | clean () |
Delete all the solutions in pool. More... | |
![]() | |
AlpsKnowledgePool () | |
virtual | ~AlpsKnowledgePool () |
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.
|
private |
|
inline |
Definition at line 57 of file AlpsSolutionPool.h.
|
inlinevirtual |
Definition at line 58 of file AlpsSolutionPool.h.
|
private |
|
inlinevirtual |
query the current number of solutions
Implements AlpsKnowledgePool.
Definition at line 66 of file AlpsSolutionPool.h.
|
inlinevirtual |
return true if there are any solution stored in the solution pool
Reimplemented from AlpsKnowledgePool.
Definition at line 71 of file AlpsSolutionPool.h.
|
inlinevirtual |
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.
|
inlinevirtual |
Remove a solution from the pool.
Reimplemented from AlpsKnowledgePool.
Definition at line 87 of file AlpsSolutionPool.h.
|
inlinevirtual |
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.
|
inlinevirtual |
query the maximum number of solutions
Reimplemented from AlpsKnowledgePool.
Definition at line 121 of file AlpsSolutionPool.h.
|
inlinevirtual |
reset the maximum number of solutions
Reimplemented from AlpsKnowledgePool.
Definition at line 136 of file AlpsSolutionPool.h.
|
inlinevirtual |
Return the best solution.
The callee must not delete the returned pointer!
Reimplemented from AlpsKnowledgePool.
Definition at line 155 of file AlpsSolutionPool.h.
|
inlinevirtual |
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.
|
inline |
Delete all the solutions in pool.
Definition at line 183 of file AlpsSolutionPool.h.
|
private |
Definition at line 42 of file AlpsSolutionPool.h.
|
private |
Definition at line 43 of file AlpsSolutionPool.h.