Public Member Functions | Private Member Functions | Private Attributes | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for AlpsSolutionPool:
Collaboration graph
[legend]

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...
 
- Public Member Functions inherited from AlpsKnowledgePool
 AlpsKnowledgePool ()
 
virtual ~AlpsKnowledgePool ()
 

Private Member Functions

 AlpsSolutionPool (const AlpsSolutionPool &)
 
AlpsSolutionPooloperator= (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 ( )
inlinevirtual

Definition at line 58 of file AlpsSolutionPool.h.

Member Function Documentation

AlpsSolutionPool& AlpsSolutionPool::operator= ( const AlpsSolutionPool )
private
int AlpsSolutionPool::getNumKnowledges ( ) const
inlinevirtual

query the current number of solutions

Implements AlpsKnowledgePool.

Definition at line 66 of file AlpsSolutionPool.h.

bool AlpsSolutionPool::hasKnowledge ( ) const
inlinevirtual

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
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.

void AlpsSolutionPool::popKnowledge ( )
inlinevirtual

Remove a solution from the pool.

Reimplemented from AlpsKnowledgePool.

Definition at line 87 of file AlpsSolutionPool.h.

void AlpsSolutionPool::addKnowledge ( AlpsKnowledge sol,
double  priority 
)
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.

int AlpsSolutionPool::getMaxNumKnowledges ( ) const
inlinevirtual

query the maximum number of solutions

Reimplemented from AlpsKnowledgePool.

Definition at line 121 of file AlpsSolutionPool.h.

void AlpsSolutionPool::setMaxNumKnowledges ( int  maxsols)
inlinevirtual

reset the maximum number of solutions

Reimplemented from AlpsKnowledgePool.

Definition at line 136 of file AlpsSolutionPool.h.

std::pair<AlpsKnowledge*, double> AlpsSolutionPool::getBestKnowledge ( ) const
inlinevirtual

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
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.

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: