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