23 #ifndef AlpsSubTreePool_h_
24 #define AlpsSubTreePool_h_
56 return std::make_pair( static_cast<AlpsKnowledge *>
95 std::vector<AlpsSubTree* >::iterator pos1, pos2;
97 pos1 = subTreeVec.begin();
98 pos2 = subTreeVec.end();
100 for (; pos1 != pos2; ++pos1) {
101 (*pos1)->calculateQuality();
102 if ((*pos1)->getQuality() < quality) {
103 quality = (*pos1)->getQuality();
virtual ~AlpsSubTreePool()
const std::vector< T > & getContainer() const
Return a const reference to the container.
void push(T x)
Add a element to the heap.
bool hasKnowledge() const
Check whether there is a subtree in the subtree pool.
void setComparison(AlpsSearchStrategy< AlpsSubTree * > &compare)
Set comparison function and resort heap.
void setComparison(AlpsSearchStrategy< T > &c)
Set comparison function and resort heap.
void pop()
Remove the top element from the heap.
bool empty() const
Return true for an empty vector.
This class contains the data pertaining to a particular subtree in the search tree.
The subtree pool is used to store subtrees.
AlpsSubTreePool & operator=(const AlpsSubTreePool &)
std::pair< AlpsKnowledge *, double > getKnowledge() const
Get a subtree from subtree pool, doesn't remove it from the pool.
size_t size() const
Return the size of the vector.
double getQuality() const
Get the quality of this subtree.
int getNumKnowledges() const
Query the number of subtrees in the pool.
void popKnowledge()
Remove a subtree from the pool.
double getBestQuality()
Get the quality of the best subtree.
AlpsPriorityQueue< AlpsSubTree * > subTreeList_
The abstract base class of any user-defined class that Alps has to know about in order to encode/deco...
void deleteGuts()
Delete the subtrees in the pool.
void addKnowledge(AlpsKnowledge *subTree, double priority)
Add a subtree to the subtree pool.
void clear()
Remove all elements from the vector.
T top() const
Return the top element of the heap.
const AlpsPriorityQueue< AlpsSubTree * > & getSubTreeList() const
Return the container of subtrees.