Dip
0.92.4
|
This class holds one node of the search tree. More...
#include <AlpsTreeNode.h>
Public Member Functions | |
AlpsTreeNode () | |
virtual | ~AlpsTreeNode () |
bool | operator< (const AlpsTreeNode &compNode) |
AlpsNodeDesc * | modifyDesc () |
Access the desc so that can modify it. More... | |
AlpsNodeDesc * | getDesc () const |
void | setDesc (AlpsNodeDesc *desc) |
AlpsKnowledgeBroker * | getKnowledgeBroker () const |
Functions to access/set the knwoledge broker. More... | |
void | setKnowledgeBroker (AlpsKnowledgeBroker *kb) |
virtual AlpsTreeNode * | createNewTreeNode (AlpsNodeDesc *&desc) const =0 |
The purpose of this function is be able to create the children of a node after branching. More... | |
void | removeChild (AlpsTreeNode *&child) |
Remove the pointer to given child from the list of children. More... | |
void | addChild (AlpsTreeNode *&child) |
Add a child to the list of children for this node. More... | |
void | removeDescendants () |
Removes all the descendants of the node. More... | |
AlpsNodeStatus | getStatus () const |
Query/set the current status. More... | |
void | setStatus (const AlpsNodeStatus stat) |
Query/set the current status. More... | |
bool | isCandidate () const |
Query functions about specific stati. More... | |
bool | isEvaluated () const |
Query functions about specific stati. More... | |
bool | isPregnant () const |
Query functions about specific stati. More... | |
bool | isBranched () const |
Query functions about specific stati. More... | |
bool | isFathomed () const |
Query functions about specific stati. More... | |
bool | isDiscarded () const |
Query functions about specific stati. More... | |
bool | isActive () const |
Query/set node in-process indicator. More... | |
void | setActive (const bool yesno) |
Query/set node in-process indicator. More... | |
AlpsNodeIndex_t | getIndex () const |
Query/set node identifier (unique within subtree). More... | |
void | setIndex (const AlpsNodeIndex_t index) |
Query/set node identifier (unique within subtree). More... | |
int | getDepth () const |
Query/set what depth the search tree node is at. More... | |
void | setDepth (const int depth) |
Query/set what depth the search tree node is at. More... | |
double | getSolEstimate () const |
Query/set the solution estimate of the node. More... | |
void | setSolEstimate (double est) |
Query/set the solution estimate of the node. More... | |
double | getQuality () const |
Query/set the quality of the node. More... | |
void | setQuality (double quality) |
Query/set the quality of the node. More... | |
int | getNumChildren () const |
Query/set what the number of children. More... | |
void | setNumChildren (const int numChildren) |
Query/set what the number of children. More... | |
void | modifyNumChildren (const int s) |
Query/set what the number of children. More... | |
AlpsTreeNode * | getChild (const int i) const |
Query/set pointer to the ith child. More... | |
void | setChild (const int i, AlpsTreeNode *node) |
Returns a const pointer to the ith child. More... | |
AlpsTreeNode * | getParent () const |
Get/set subtree. More... | |
void | setParent (AlpsTreeNode *parent) |
Get/set subtree. More... | |
AlpsNodeIndex_t | getParentIndex () const |
Get/set the index of the parent of the node. More... | |
void | setParentIndex (AlpsNodeIndex_t index) |
Get/set the index of the parent of the node. More... | |
int | getExplicit () const |
Get/set the indication of whether the node has full or differencing description. More... | |
void | setExplicit (int fp) |
Get/set the indication of whether the node has full or differencing description. More... | |
virtual void | convertToExplicit () |
Convert explicit description to difference, and vise-vesa. More... | |
virtual void | convertToRelative () |
Convert explicit description to difference, and vise-vesa. More... | |
int | getSentMark () const |
Various marks used in parallel code. More... | |
void | setSentMark (const int tf) |
Various marks used in parallel code. More... | |
![]() | |
AlpsKnowledge () | |
virtual | ~AlpsKnowledge () |
KnowledgeType | getType () |
void | setType (KnowledgeType t) |
virtual AlpsEncoded * | encode () const |
This method should encode the content of the object and return a pointer to the encoded form. More... | |
virtual AlpsReturnStatus | encode (AlpsEncoded *encoded) |
Pack into a encode object. More... | |
virtual AlpsKnowledge * | decode (AlpsEncoded &encoded) const |
This method should decode and return a pointer to a brand new object, i.e., the method must create a new object on the heap from the decoded data instead of filling up the object for which the method was invoked. More... | |
AlpsEncoded * | getEncoded () const |
Get/set encoded. More... | |
void | setEncoded (AlpsEncoded *e) |
Protected Attributes | |
bool | active_ |
The subtree own this node. More... | |
AlpsNodeIndex_t | index_ |
The unique index of the tree node (across the whole search tree). More... | |
int | depth_ |
The depth of the node (in the whole tree – the root is at depth 0). More... | |
double | solEstimate_ |
The solution estimate. More... | |
double | quality_ |
The quality of this node. More... | |
AlpsTreeNode * | parent_ |
The parent of the tree node. More... | |
AlpsNodeIndex_t | parentIndex_ |
The index of parent of the tree node. More... | |
int | numChildren_ |
The number of children. More... | |
AlpsTreeNode ** | children_ |
int | explicit_ |
Indicate whether the node description is explicit(1) or relative(0). More... | |
AlpsNodeDesc * | desc_ |
The actual description of the tree node. More... | |
AlpsNodeStatus | status_ |
The current status of the node. More... | |
AlpsKnowledgeBroker * | knowledgeBroker_ |
A pointer to the knowledge broker of the process where this node is processed. More... | |
int | sentMark_ |
Various mark used in splitting and passing subtrees. More... | |
![]() | |
KnowledgeType | type_ |
Private Member Functions | |
AlpsTreeNode (const AlpsTreeNode &) | |
AlpsTreeNode & | operator= (const AlpsTreeNode &) |
This class holds one node of the search tree.
Note that the generic search procedure doesn't know anything about the nodes in the tree other than their index, lower bound, etc. Other application-specific data is contained in derived classes, but is not needed for the basic operation of the search tree.
Definition at line 50 of file AlpsTreeNode.h.
|
private |
|
inline |
Definition at line 110 of file AlpsTreeNode.h.
References AlpsKnowledgeTypeNode, and AlpsKnowledge::setType().
|
inlinevirtual |
Definition at line 132 of file AlpsTreeNode.h.
References children_, desc_, and numChildren_.
|
private |
|
inline |
Definition at line 147 of file AlpsTreeNode.h.
References getQuality(), and quality_.
|
inline |
Access the desc so that can modify it.
Definition at line 151 of file AlpsTreeNode.h.
References desc_.
|
inline |
Definition at line 152 of file AlpsTreeNode.h.
References desc_.
|
inline |
Definition at line 153 of file AlpsTreeNode.h.
References desc_.
|
inline |
Functions to access/set the knwoledge broker.
Definition at line 156 of file AlpsTreeNode.h.
References knowledgeBroker_.
Referenced by AbcTreeNode::AbcTreeNode(), and KnapTreeNode::KnapTreeNode().
|
inline |
Definition at line 158 of file AlpsTreeNode.h.
References knowledgeBroker_.
|
pure virtual |
The purpose of this function is be able to create the children of
a node after branching.
Implemented in KnapTreeNode, AbcTreeNode, AbcTreeNode, and AlpsDecompTreeNode.
|
inline |
Query/set the current status.
Definition at line 172 of file AlpsTreeNode.h.
Referenced by AlpsSubTree::getNumNodes().
|
inline |
|
inline |
Query functions about specific stati.
Definition at line 178 of file AlpsTreeNode.h.
|
inline |
Query functions about specific stati.
Definition at line 180 of file AlpsTreeNode.h.
References AlpsNodeStatusEvaluated, and status_.
|
inline |
Query functions about specific stati.
Definition at line 182 of file AlpsTreeNode.h.
References AlpsNodeStatusPregnant, and status_.
|
inline |
Query functions about specific stati.
Definition at line 184 of file AlpsTreeNode.h.
References AlpsNodeStatusBranched, and status_.
|
inline |
Query functions about specific stati.
Definition at line 186 of file AlpsTreeNode.h.
References AlpsNodeStatusFathomed, and status_.
|
inline |
Query functions about specific stati.
Definition at line 188 of file AlpsTreeNode.h.
References AlpsNodeStatusDiscarded, and status_.
|
inline |
Query/set node in-process indicator.
Definition at line 194 of file AlpsTreeNode.h.
|
inline |
Query/set node in-process indicator.
Definition at line 195 of file AlpsTreeNode.h.
References active_.
|
inline |
Query/set node identifier (unique within subtree).
Definition at line 200 of file AlpsTreeNode.h.
|
inline |
Query/set node identifier (unique within subtree).
Definition at line 201 of file AlpsTreeNode.h.
References index_.
|
inline |
Query/set what depth the search tree node is at.
Definition at line 206 of file AlpsTreeNode.h.
Referenced by AlpsNodeSelectionBreadth::compare(), and AlpsNodeSelectionDepth::compare().
|
inline |
Query/set what depth the search tree node is at.
Definition at line 207 of file AlpsTreeNode.h.
References depth_.
|
inline |
Query/set the solution estimate of the node.
Definition at line 212 of file AlpsTreeNode.h.
Referenced by AlpsNodeSelectionEstimate::compare(), and AlpsSubTree::getSolEstimate().
|
inline |
Query/set the solution estimate of the node.
Definition at line 213 of file AlpsTreeNode.h.
References solEstimate_.
|
inline |
Query/set the quality of the node.
Definition at line 218 of file AlpsTreeNode.h.
Referenced by AlpsNodeSelectionBest::compare(), AlpsNodeSelectionHybrid::compare(), AlpsNodePool::getBestKnowledgeValue(), AlpsNodePool::getBestNode(), AlpsNodePool::getKnowledge(), TotalWorkload::operator()(), operator<(), and AlpsSubTree::reset().
|
inline |
Query/set the quality of the node.
Definition at line 219 of file AlpsTreeNode.h.
References quality_.
|
inline |
Query/set what the number of children.
Definition at line 224 of file AlpsTreeNode.h.
|
inline |
Query/set what the number of children.
Definition at line 225 of file AlpsTreeNode.h.
References children_, and numChildren_.
|
inline |
Query/set what the number of children.
Definition at line 236 of file AlpsTreeNode.h.
References numChildren_.
|
inline |
Query/set pointer to the ith child.
Definition at line 247 of file AlpsTreeNode.h.
|
inline |
Returns a const pointer to the ith child.
Definition at line 254 of file AlpsTreeNode.h.
References children_.
void AlpsTreeNode::removeChild | ( | AlpsTreeNode *& | child | ) |
Remove the pointer to given child from the list of children.
This method deletes the child as well. An error is thrown if the argument is not a pointer to a child.
void AlpsTreeNode::addChild | ( | AlpsTreeNode *& | child | ) |
Add a child to the list of children for this node.
void AlpsTreeNode::removeDescendants | ( | ) |
Removes all the descendants of the node.
We might want to do this in some cases where we are cutting out a subtree and replacing it with another one.
|
inline |
|
inline |
Get/set subtree.
Get/set the parent of the node
Definition at line 278 of file AlpsTreeNode.h.
References parent_.
|
inline |
Get/set the index of the parent of the node.
Used in decode subtree.
Definition at line 283 of file AlpsTreeNode.h.
|
inline |
Get/set the index of the parent of the node.
Used in decode subtree.
Definition at line 284 of file AlpsTreeNode.h.
References parentIndex_.
|
inline |
Get/set the indication of whether the node has full or differencing
description.
Definition at line 291 of file AlpsTreeNode.h.
|
inline |
Get/set the indication of whether the node has full or differencing
description.
Definition at line 292 of file AlpsTreeNode.h.
References explicit_.
|
inlinevirtual |
Convert explicit description to difference, and vise-vesa.
Definition at line 297 of file AlpsTreeNode.h.
|
inlinevirtual |
Convert explicit description to difference, and vise-vesa.
Definition at line 298 of file AlpsTreeNode.h.
|
inline |
Various marks used in parallel code.
Definition at line 303 of file AlpsTreeNode.h.
|
inline |
Various marks used in parallel code.
Definition at line 304 of file AlpsTreeNode.h.
References sentMark_.
|
protected |
The subtree own this node.
Whether the node is being worked on at the moment
Definition at line 60 of file AlpsTreeNode.h.
Referenced by setActive().
|
protected |
The unique index of the tree node (across the whole search tree).
Definition at line 63 of file AlpsTreeNode.h.
Referenced by setIndex().
|
protected |
The depth of the node (in the whole tree – the root is at depth 0).
Definition at line 66 of file AlpsTreeNode.h.
Referenced by setDepth().
|
protected |
The solution estimate.
The smaller the better.
Definition at line 69 of file AlpsTreeNode.h.
Referenced by setSolEstimate().
|
protected |
The quality of this node.
The smaller the better.
Definition at line 72 of file AlpsTreeNode.h.
Referenced by operator<(), AbcTreeNode::setObjValue(), and setQuality().
|
protected |
The parent of the tree node.
Definition at line 75 of file AlpsTreeNode.h.
Referenced by setParent().
|
protected |
The index of parent of the tree node.
Used in decoding sub tree.
Definition at line 78 of file AlpsTreeNode.h.
Referenced by setParentIndex().
|
protected |
The number of children.
Definition at line 81 of file AlpsTreeNode.h.
Referenced by modifyNumChildren(), setNumChildren(), and ~AlpsTreeNode().
|
protected |
Definition at line 87 of file AlpsTreeNode.h.
Referenced by setChild(), setNumChildren(), and ~AlpsTreeNode().
|
protected |
Indicate whether the node description is explicit(1) or relative(0).
Default is relative.
Definition at line 92 of file AlpsTreeNode.h.
Referenced by setExplicit().
|
protected |
The actual description of the tree node.
Definition at line 95 of file AlpsTreeNode.h.
Referenced by AbcTreeNode::AbcTreeNode(), getDesc(), KnapTreeNode::KnapTreeNode(), modifyDesc(), setDesc(), and ~AlpsTreeNode().
|
protected |
The current status of the node.
Definition at line 98 of file AlpsTreeNode.h.
Referenced by isBranched(), isDiscarded(), isEvaluated(), isFathomed(), isPregnant(), and setStatus().
|
protected |
A pointer to the knowledge broker of the process where this node is
processed.
Definition at line 103 of file AlpsTreeNode.h.
Referenced by getKnowledgeBroker(), and setKnowledgeBroker().
|
protected |
Various mark used in splitting and passing subtrees.
Definition at line 107 of file AlpsTreeNode.h.
Referenced by setSentMark().