Go to the documentation of this file.
23 #ifndef AlpsNodePool_h_
24 #define AlpsNodePool_h_
54 if (!candidateList_.
empty()) {
61 (candidateList_.
size()); }
65 const std::vector<AlpsTreeNode *>& pool=candidateList_.
getContainer();
67 int size =
static_cast<int> (pool.size());
70 for (k = 0; k < size; ++k) {
81 const std::vector<AlpsTreeNode *>& pool=candidateList_.
getContainer();
83 int size =
static_cast<int> (pool.size());
95 for (k = 0; k < size; ++k) {
114 (candidateList_.
top()),
120 candidateList_.
pop();
130 candidateList_.
push(nn);
149 std::vector<AlpsTreeNode* > nodeVec = candidateList_.
getContainer();
151 candidateList_.
clear();
152 assert(candidateList_.
size() == 0);
159 candidateList_.
clear();
int getNumKnowledges() const
Query the number of nodes in the node pool.
@ AlpsSearchTypeBreadthFirst
AlpsNodePool(AlpsSearchType type)
@ AlpsSearchTypeBestFirst
void addKnowledge(AlpsKnowledge *node, double priority)
Remove the node with highest priority from the pool and the elite list.
void popKnowledge()
Remove the node with highest priority from the pool.
T top() const
Return the top element of the heap.
std::pair< AlpsKnowledge *, double > getKnowledge() const
Get the node with highest priority.
void clear()
Remove all the nodes in the pool (does not free memory).
AlpsSearchType
Search Strategies.
void pop()
Remove the top element from the heap.
double getBestKnowledgeValue() const
Get the "best value" of the nodes in node pool.
This class holds one node of the search tree.
bool hasKnowledge() const
Check whether there are still nodes in the node pool.
double getQuality() const
Query/set the quality of the node.
const AlpsPriorityQueue< AlpsTreeNode * > & getCandidateList() const
Get a constant reference to the priority queue that stores nodes.
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.
void setNodeSelection(AlpsSearchStrategy< AlpsTreeNode * > &compare)
Set strategy and resort heap.
Node pool is used to store the nodes to be processed.
void deleteGuts()
Delete all the nodes in the pool and free memory.
void push(T x)
Add a element to the heap.
AlpsTreeNode * getBestNode() const
Get the "best" nodes in node pool.
bool empty() const
Return true for an empty vector.
void setComparison(AlpsSearchStrategy< T > &c)
Set comparison function and resort heap.
size_t size() const
Return the size of the vector.
const std::vector< T > & getContainer() const
Return a const reference to the container.