Alps  2.0.2
Private Attributes | List of all members
AlpsSolutionPool Class Reference

This class is a comtainer for the solutions found during the search. More...

#include <AlpsSolutionPool.h>

+ Inheritance diagram for AlpsSolutionPool:
+ Collaboration diagram for AlpsSolutionPool:

Public Member Functions

Constructor and Destructor.
 AlpsSolutionPool (int maxsols=1)
 
virtual ~AlpsSolutionPool ()
 
Querry methods
virtual int getNumKnowledges () const
 Query the current number of solutions. More...
 
virtual std::pair< AlpsKnowledge *, double > getKnowledge () const
 Check the first item in the pool. More...
 
virtual bool hasKnowledge () const
 Return true if there are any solution stored in the solution pool. More...
 
virtual int getMaxNumKnowledges () const
 query the maximum number of solutions. More...
 
virtual std::pair< AlpsKnowledge *, double > getBestKnowledge () const
 Return the best solution. More...
 
virtual void getAllKnowledges (std::vector< std::pair< AlpsKnowledge *, double > > &sols) const
 Return all the solutions of the solution pool in the provided argument vector. More...
 
Knowledge manipulation
virtual void addKnowledge (AlpsKnowledge *sol, double priority)
 Add a knowledge to pool. More...
 
virtual void popKnowledge ()
 Remove a solution from the pool. More...
 
- Public Member Functions inherited from AlpsKnowledgePool
 AlpsKnowledgePool (AlpsKnowledgePoolType type)
 Default constructor. More...
 
virtual ~AlpsKnowledgePool ()
 Destructor. More...
 

Private Attributes

std::multimap< double, AlpsSolution * > solutions_
 
int maxNumSolutions_
 

Other functions

virtual void setMaxNumKnowledges (int maxsols)
 Set maximum number of solutions. More...
 
void clean ()
 Delete all the solutions in pool. More...
 
 AlpsSolutionPool (const AlpsSolutionPool &)
 Disable copy constructor. More...
 
AlpsSolutionPooloperator= (const AlpsSolutionPool &)
 Disable copy assignment operator. More...
 

Detailed Description

This class is a comtainer for the solutions found during the search.

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

Definition at line 43 of file AlpsSolutionPool.h.

Constructor & Destructor Documentation

◆ AlpsSolutionPool() [1/2]

AlpsSolutionPool::AlpsSolutionPool ( int  maxsols = 1)

◆ ~AlpsSolutionPool()

virtual AlpsSolutionPool::~AlpsSolutionPool ( )
virtual

◆ AlpsSolutionPool() [2/2]

AlpsSolutionPool::AlpsSolutionPool ( const AlpsSolutionPool )
private

Disable copy constructor.

Member Function Documentation

◆ getNumKnowledges()

virtual int AlpsSolutionPool::getNumKnowledges ( ) const
virtual

Query the current number of solutions.

Implements AlpsKnowledgePool.

◆ getKnowledge()

virtual std::pair<AlpsKnowledge*, double> AlpsSolutionPool::getKnowledge ( ) const
virtual

Check the first item in the pool.

Implements AlpsKnowledgePool.

◆ hasKnowledge()

virtual bool AlpsSolutionPool::hasKnowledge ( ) const
virtual

Return true if there are any solution stored in the solution pool.

Implements AlpsKnowledgePool.

◆ getMaxNumKnowledges()

virtual int AlpsSolutionPool::getMaxNumKnowledges ( ) const
inlinevirtual

query the maximum number of solutions.

Implements AlpsKnowledgePool.

Definition at line 62 of file AlpsSolutionPool.h.

◆ getBestKnowledge()

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

Return the best solution.

The callee must not delete the returned pointer!

Implements AlpsKnowledgePool.

◆ getAllKnowledges()

virtual void AlpsSolutionPool::getAllKnowledges ( std::vector< std::pair< AlpsKnowledge *, double > > &  sols) const
virtual

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

The callee must not delete the returned pointers!

Implements AlpsKnowledgePool.

◆ addKnowledge()

virtual void AlpsSolutionPool::addKnowledge ( AlpsKnowledge nk,
double  priority 
)
virtual

Add a knowledge to pool.

Implements AlpsKnowledgePool.

◆ popKnowledge()

virtual void AlpsSolutionPool::popKnowledge ( )
virtual

Remove a solution from the pool.

Implements AlpsKnowledgePool.

◆ setMaxNumKnowledges()

virtual void AlpsSolutionPool::setMaxNumKnowledges ( int  maxsols)
virtual

Set maximum number of solutions.

Implements AlpsKnowledgePool.

◆ clean()

void AlpsSolutionPool::clean ( )

Delete all the solutions in pool.

◆ operator=()

AlpsSolutionPool& AlpsSolutionPool::operator= ( const AlpsSolutionPool )
private

Disable copy assignment operator.

Member Data Documentation

◆ solutions_

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

Definition at line 44 of file AlpsSolutionPool.h.

◆ maxNumSolutions_

int AlpsSolutionPool::maxNumSolutions_
private

Definition at line 45 of file AlpsSolutionPool.h.


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