Go to the documentation of this file.
23 #ifndef AlpsSubTreePool_h_
24 #define AlpsSubTreePool_h_
43 if (!subTreeList_.
empty()) {
69 subTreeList_.
push(st);
83 std::vector<AlpsSubTree* > treeVec = subTreeList_.
getContainer();
86 assert(subTreeList_.
size() == 0);
93 std::vector<AlpsSubTree* > subTreeVec = subTreeList_.
getContainer();
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()
void setComparison(AlpsSearchStrategy< AlpsSubTree * > &compare)
Set comparison function and resort heap.
T top() const
Return the top element of the heap.
void addKnowledge(AlpsKnowledge *subTree, double priority)
Add a subtree to the subtree pool.
void pop()
Remove the top element from the heap.
bool hasKnowledge() const
Check whether there is a subtree in the subtree pool.
double getQuality() const
Get the quality of this subtree.
double getBestQuality()
Get the quality of the best subtree.
The subtree pool is used to store subtrees.
std::pair< AlpsKnowledge *, double > getKnowledge() const
Get a subtree from subtree pool, doesn't remove it from the pool.
The abstract base class of any user-defined class that Alps has to know about in order to encode/deco...
void clear()
Remove all elements from the vector.
int getNumKnowledges() const
Query the number of subtrees in the pool.
void popKnowledge()
Remove a subtree from the pool.
void deleteGuts()
Delete the subtrees in the pool.
void push(T x)
Add a element to the heap.
const AlpsPriorityQueue< AlpsSubTree * > & getSubTreeList() const
Return the container of subtrees.
bool empty() const
Return true for an empty vector.
void setComparison(AlpsSearchStrategy< T > &c)
Set comparison function and resort heap.
This class contains the data pertaining to a particular subtree in the search tree.
size_t size() const
Return the size of the vector.
const std::vector< T > & getContainer() const
Return a const reference to the container.