Go to the documentation of this file.
27 #ifndef AlpsSolutionPool_h_
28 #define AlpsSolutionPool_h_
58 virtual std::pair<AlpsKnowledge*, double>
getKnowledge()
const;
69 double> >& sols)
const;
94 #define AlpsSolutionInterface(ref) \
95 int getNumSolutions() const { \
96 (ref).getNumSolutions(); \
98 int getMaxNumSolutions() const { \
99 return (ref).getMaxNumSolutions(); \
101 void setMaxNumSolutions(int num) { \
102 (ref).setMaxNumSolutions(num); \
104 bool hasSolution() const { \
105 return (ref).hasSolution(); \
107 std::pair<const AlpsSolution*, double> getBestSolution() const { \
108 return (ref).getBestSolution(); \
110 void getAllSolutions \
111 (std::vector<std::pair<const AlpsSolution*, double> >& sols) { \
112 return (ref).getAllSolutions(sols); \
114 void addSolution(const AlpsSolution* sol, double priority) { \
115 (ref).addSolution(sol, priority); \
virtual void popKnowledge()
Remove a solution from the pool.
AlpsSolutionPool & operator=(const AlpsSolutionPool &)
Disable copy assignment operator.
virtual void getAllKnowledges(std::vector< std::pair< AlpsKnowledge *, double > > &sols) const
Return all the solutions of the solution pool in the provided argument vector.
virtual void setMaxNumKnowledges(int maxsols)
Set maximum number of solutions.
virtual void addKnowledge(AlpsKnowledge *sol, double priority)
Add a knowledge to pool.
This is an abstract base class, fixing an API for pool types of Alps, AlpsNodePool,...
virtual ~AlpsSolutionPool()
virtual std::pair< AlpsKnowledge *, double > getKnowledge() const
Check the first item in the pool.
AlpsSolutionPool(int maxsols=1)
The abstract base class of Alps knowledges generated during the search.
virtual bool hasKnowledge() const
Return true if there are any solution stored in the solution pool.
void clean()
Delete all the solutions in pool.
std::multimap< double, AlpsSolution * > solutions_
This class is a comtainer for the solutions found during the search.
virtual std::pair< AlpsKnowledge *, double > getBestKnowledge() const
Return the best solution.
virtual int getMaxNumKnowledges() const
query the maximum number of solutions.
virtual int getNumKnowledges() const
Query the current number of solutions.