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