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