23 #ifndef AlpsTreeNode_h_
24 #define AlpsTreeNode_h_
83 #if defined(ALPS_MAX_CHILD_NUM)
85 AlpsTreeNode* children_[ALPS_MAX_CHILD_NUM];
120 #if defined(ALPS_MAX_CHILD_NUM)
135 #if ! defined(ALPS_MAX_CHILD_NUM)
227 #if ! defined(ALPS_MAX_CHILD_NUM)
336 virtual int process(
bool isRoot =
false,
bool rampUp =
false) = 0;
347 virtual std::vector< CoinTriple<AlpsNodeDesc*, AlpsNodeStatus, double> >
AlpsNodeStatus
The possible stati for the search nodes.
@ AlpsNodeStatusDiscarded
@ AlpsNodeStatusCandidate
@ AlpsNodeStatusEvaluated
This data structure is to contain the packed form of an encodable knowledge.
The base class of knowledge broker class.
The abstract base class of any user-defined class that Alps has to know about in order to encode/deco...
void setType(KnowledgeType t)
A class to refer to the description of a search tree node.
This class contains the data pertaining to a particular subtree in the search tree.
This class holds one node of the search tree.
void addChild(AlpsTreeNode *&child)
Add a child to the list of children for this node.
AlpsNodeDesc * modifyDesc()
Access the desc so that can modify it.
void removeDescendants()
Removes all the descendants of the node.
double solEstimate_
The solution estimate.
AlpsTreeNode ** children_
int getNumChildren() const
Query/set what the number of children.
int sentMark_
Various mark used in splitting and passing subtrees.
void setParent(AlpsTreeNode *parent)
int getSentMark() const
Various marks used in parallel code.
AlpsNodeIndex_t getIndex() const
Query/set node identifier (unique within subtree).
AlpsNodeStatus status_
The current status of the node.
void setDesc(AlpsNodeDesc *desc)
void setKnowledgeBroker(AlpsKnowledgeBroker *kb)
AlpsNodeStatus getStatus() const
Query/set the current status.
void setStatus(const AlpsNodeStatus stat)
AlpsNodeIndex_t parentIndex_
The index of parent of the tree node.
AlpsKnowledgeBroker * getKnowledgeBroker() const
Functions to access/set the knwoledge broker.
int numChildren_
The number of children.
AlpsNodeIndex_t index_
The unique index of the tree node (across the whole search tree).
AlpsNodeIndex_t getParentIndex() const
Get/set the index of the parent of the node.
AlpsNodeDesc * desc_
The actual description of the tree node.
void setActive(const bool yesno)
AlpsTreeNode * getParent() const
Get/set subtree.
bool isCandidate() const
Query functions about specific stati.
void setChild(const int i, AlpsTreeNode *node)
void removeChild(AlpsTreeNode *&child)
Remove the pointer to given child from the list of children.
int depth_
The depth of the node (in the whole tree – the root is at depth 0).
AlpsTreeNode * parent_
The parent of the tree node.
double getQuality() const
Query/set the quality of the node.
void setSentMark(const int tf)
void setNumChildren(const int numChildren)
void setQuality(double quality)
double quality_
The quality of this node.
virtual AlpsTreeNode * createNewTreeNode(AlpsNodeDesc *&desc) const =0
The purpose of this function is be able to create the children of a node after branching.
int explicit_
Indicate whether the node description is explicit(1) or relative(0).
int getDepth() const
Query/set what depth the search tree node is at.
double getSolEstimate() const
Query/set the solution estimate of the node.
void setDepth(const int depth)
int getExplicit() const
Get/set the indication of whether the node has full or differencing description.
bool active_
The subtree own this node.
void setParentIndex(AlpsNodeIndex_t index)
virtual void convertToRelative()
void modifyNumChildren(const int s)
AlpsNodeDesc * getDesc() const
AlpsTreeNode * getChild(const int i) const
Query/set pointer to the ith child.
virtual void convertToExplicit()
Convert explicit description to difference, and vise-vesa.
void setSolEstimate(double est)
AlpsKnowledgeBroker * knowledgeBroker_
A pointer to the knowledge broker of the process where this node is processed.
bool isActive() const
Query/set node in-process indicator.
bool operator<(const AlpsTreeNode &compNode)
void setIndex(const AlpsNodeIndex_t index)