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)
137 assert(numChildren_ == 0);
139 #if ! defined(ALPS_MAX_CHILD_NUM)
140 if (children_ != 0) {
163 { knowledgeBroker_ = kb; }
199 inline void setActive(
const bool yesno) { active_ = yesno; }
211 inline void setDepth(
const int depth) { depth_ = depth; }
223 inline void setQuality(
double quality) { quality_ = quality; }
230 numChildren_ = numChildren;
231 #if ! defined(ALPS_MAX_CHILD_NUM)
232 if (children_ != 0) {
259 { children_[i] = node; }
289 { parentIndex_ = index; }
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)
int getSentMark() const
Various marks used in parallel code.
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)
double getQuality() const
Query/set the quality of the node.
bool isCandidate() const
Query functions about specific stati.
AlpsNodeIndex_t getIndex() const
Query/set node identifier (unique within subtree).
AlpsNodeDesc * getDesc() const
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.
int getNumChildren() const
Query/set what the number of children.
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.
This data structure is to contain the packed form of an encodable knowledge.
void setDesc(AlpsNodeDesc *desc)
void setIndex(const AlpsNodeIndex_t index)
int numChildren_
The number of children.
A class to refer to the description of a search tree node.
AlpsKnowledgeBroker * getKnowledgeBroker() const
Functions to access/set the knwoledge broker.
double quality_
The quality of this node.
void setQuality(double quality)
int getDiving() const
If the this node is in a diving process.
void setParent(AlpsTreeNode *parent)
void setSolEstimate(double est)
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).
AlpsNodeStatus status_
The current status of the node.
virtual void convertToExplicit()
Convert explicit description to difference, and vise-vesa.
AlpsTreeNode ** children_
AlpsTreeNode * parent_
The parent of the tree node.
double getSolEstimate() const
Query/set the solution estimate of the node.
void setType(KnowledgeType t)
void setParentIndex(AlpsNodeIndex_t index)
bool diving_
When processing it, if it is in the diving processing.
int getDepth() const
Query/set what depth the search tree node is at.
AlpsNodeStatus getStatus() const
Query/set the current status.
AlpsTreeNode * getParent() const
Get/set subtree.
AlpsNodeIndex_t getParentIndex() const
Get/set the index of the parent of the node.
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.
AlpsTreeNode * getChild(const int i) const
Query/set pointer to the ith child.
void setSentMark(const int tf)
int getExplicit() const
Get/set the indication of whether the node has full or differencing description.
AlpsNodeDesc * desc_
The actual description of the tree node.
bool isActive() const
Query/set node in-process indicator.
void setNumChildren(const int numChildren)
void setDiving(const bool d)
void setActive(const bool yesno)