Go to the documentation of this file.
27 #ifndef AlpsTreeNode_h_
28 #define AlpsTreeNode_h_
34 #include "CoinError.hpp"
35 #include "CoinSort.hpp"
81 #if defined(ALPS_MAX_CHILD_NUM) // *FIXME* : Do we want ifdefs?
114 #if defined(ALPS_MAX_CHILD_NUM)
128 #if ! defined(ALPS_MAX_CHILD_NUM)
216 #if ! defined(ALPS_MAX_CHILD_NUM)
325 virtual int process(
bool isRoot =
false,
bool rampUp =
false) = 0;
336 virtual std::vector< CoinTriple<AlpsNodeDesc*, AlpsNodeStatus, double> >
AlpsNodeStatus getStatus() const
void removeChild(AlpsTreeNode *&child)
Remove the pointer to given child from the list of children.
AlpsNodeDesc * getDesc() const
bool active_
The subtree own this node.
AlpsNodeIndex_t index_
The unique index of the tree node (across the whole search tree).
void setActive(const bool yesno)
AlpsNodeDesc * modifyDesc()
Access the desc so that can modify it.
int numChildren_
The number of children.
void setIndex(const AlpsNodeIndex_t index)
void setDesc(AlpsNodeDesc *desc)
AlpsNodeDesc * desc_
The actual description of the tree node.
int explicit_
Indicate whether the node description is explicit(1) or relative(0).
AlpsNodeStatus
The possible stati for the search nodes.
void modifyNumChildren(const int s)
AlpsKnowledge & operator=(AlpsKnowledge const &)
Disable copy assignment operator.
double quality_
The quality of this node.
void setChild(const int i, AlpsTreeNode *node)
int sentMark_
Various mark used in splitting and passing subtrees.
@ AlpsNodeStatusCandidate
@ AlpsNodeStatusEvaluated
bool isCandidate() const
Query functions about specific stati.
void setSolEstimate(double est)
void setQuality(double quality)
This class holds one node of the search tree.
void setStatus(const AlpsNodeStatus stat)
get status.
int depth_
The depth of the node (in the whole tree – the root is at depth 0).
double getQuality() const
Query/set the quality of the node.
@ AlpsNodeStatusDiscarded
AlpsNodeStatus status_
The current status of the node.
int getSentMark() const
Various marks used in parallel code.
AlpsNodeIndex_t getIndex() const
Query/set node identifier (unique within subtree).
This is an abstract base class for subproblem data to be stored in a tree node.
AlpsTreeNode * getParent() const
Get/set subtree.
AlpsNodeIndex_t getParentIndex() const
Get/set the index of the parent of the node.
AlpsTreeNode * getChild(const int i) const
Query/set pointer to the ith child.
AlpsNodeIndex_t parentIndex_
The index of parent of the tree node.
The abstract base class of Alps knowledges generated during the search.
AlpsTreeNode ** children_
The base class of knowledge broker class.
AlpsEncoded * encode() const
Encode the content of this into an AlpsEncoded object and return a pointer to it.
int getNumChildren() const
Query/set what the number of children.
int getDepth() const
Query/set what depth the search tree node is at.
void setSentMark(const int tf)
double getSolEstimate() const
Query/set the solution estimate of the node.
void setParentIndex(AlpsNodeIndex_t index)
void setNumChildren(const int numChildren)
void setParent(AlpsTreeNode *parent)
virtual void convertToRelative()
bool isActive() const
Query/set node in-process indicator.
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.
double solEstimate_
The solution estimate.
virtual AlpsTreeNode * createNewTreeNode(AlpsNodeDesc *&desc) const =0
The purpose of this function is be able to create the children of a node after branching.
virtual void convertToExplicit()
Convert explicit description to difference, and vise-vesa.
bool operator<(const AlpsTreeNode &compNode)
AlpsTreeNode * parent_
The parent of the tree node.
virtual AlpsReturnStatus decodeToSelf(AlpsEncoded &encoded)
Decode the given AlpsEncoded object into this.
void removeDescendants()
Removes all the descendants of the node.
int getExplicit() const
Get/set the indication of whether the node has full or differencing description.
void setDepth(const int depth)