Go to the documentation of this file.
27 #ifndef AlpsSubTreePool_h_
28 #define AlpsSubTreePool_h_
56 virtual std::pair<AlpsKnowledge*, double>
getKnowledge()
const;
65 double> >& kls)
const;
85 void setComparison(AlpsSearchStrategy<AlpsSubTree*>& compare);
virtual ~AlpsSubTreePool()
Destructor.
virtual int getMaxNumKnowledges() const
Query the quantity limit of knowledges.
virtual void setMaxNumKnowledges(int num)
Set the quantity limit of knowledges that can be stored in the pool.
void setComparison(AlpsSearchStrategy< AlpsSubTree * > &compare)
Set comparison function and resort heap.
virtual void addKnowledge(AlpsKnowledge *subTree, double priority)
Add a subtree to the subtree pool.
virtual const AlpsPriorityQueue< AlpsSubTree * > & getSubTreeList() const
Return the container of subtrees.
void pop()
Remove the top element from the heap.
virtual void popKnowledge()
Remove a subtree from the pool.
This is an abstract base class, fixing an API for pool types of Alps, AlpsNodePool,...
double getBestQuality()
Get the quality of the best subtree.
The subtree pool is used to store subtrees.
virtual std::pair< AlpsKnowledge *, double > getBestKnowledge() const
Query the best knowledge in the pool.
The abstract base class of Alps knowledges generated during the search.
AlpsSubTreePool()
Default constructor.
AlpsPriorityQueue< AlpsSubTree * > subTreeList_
void deleteGuts()
Delete the subtrees in the pool.
bool empty() const
Return true for an empty vector.
virtual int getNumKnowledges() const
Query the number of subtrees in the pool.
virtual std::pair< AlpsKnowledge *, double > getKnowledge() const
Get a subtree from subtree pool, doesn't remove it from the pool.
AlpsSubTreePool & operator=(const AlpsSubTreePool &)
Disable copy assignment operator.
virtual bool hasKnowledge() const
Check whether there is a subtree in the subtree pool.
virtual void getAllKnowledges(std::vector< std::pair< AlpsKnowledge *, double > > &kls) const
Get a reference to all the knowledges in the pool.*/.