23 #ifndef AlpsNodePool_h_
24 #define AlpsNodePool_h_
49 if (!candidateList_.
empty()) {
59 const std::vector<AlpsTreeNode *>& pool=candidateList_.
getContainer();
61 int size =
static_cast<int> (pool.size());
64 for (k = 0; k < size; ++k) {
75 const std::vector<AlpsTreeNode *>& pool=candidateList_.
getContainer();
77 int size =
static_cast<int> (pool.size());
82 for (k = 0; k < size; ++k) {
97 return std::make_pair( static_cast<AlpsKnowledge *>
98 (candidateList_.
top()),
104 candidateList_.
pop();
114 candidateList_.
push(nn);
133 std::vector<AlpsTreeNode* > nodeVec = candidateList_.
getContainer();
135 candidateList_.
clear();
136 assert(candidateList_.
size() == 0);
143 candidateList_.
clear();
AlpsTreeNode * getBestNode() const
Get the "best" nodes in node pool.
size_t size() const
Return the size of the vector.
double getQuality() const
Query/set the quality of the node.
int getNumKnowledges() const
Query the number of nodes in the node pool.
double getBestKnowledgeValue() const
Get the "best value" of the nodes in node pool.
The abstract base class of any user-defined class that Alps has to know about in order to encode/deco...
void addKnowledge(AlpsKnowledge *node, double priority)
Remove the node with highest priority from the pool and the elite list.
void pop()
Remove the top element from the heap.
This class holds one node of the search tree.
const AlpsPriorityQueue< AlpsTreeNode * > & getCandidateList() const
Get a constant reference to the priority queue that stores nodes.
const std::vector< T > & getContainer() const
Return a const reference to the container.
void clear()
Remove all elements from the vector.
Node pool is used to store the nodes to be processed.
T top() const
Return the top element of the heap.
std::pair< AlpsKnowledge *, double > getKnowledge() const
Get the node with highest priority.
void push(T x)
Add a element to the heap.
bool hasKnowledge() const
Check whether there are still nodes in the node pool.
void deleteGuts()
Delete all the nodes in the pool and free memory.
void popKnowledge()
Remove the node with highest priority from the pool.
void setNodeSelection(AlpsSearchStrategy< AlpsTreeNode * > &compare)
Set strategy and resort heap.
bool empty() const
Return true for an empty vector.
void setComparison(AlpsSearchStrategy< T > &c)
Set comparison function and resort heap.
void clear()
Remove all the nodes in the pool (does not free memory).