Alps  2.0.2
Public Member Functions | Protected Attributes | List of all members
AlpsTreeNode Class Referenceabstract

This class holds one node of the search tree. More...

#include <AlpsTreeNode.h>

+ Inheritance diagram for AlpsTreeNode:
+ Collaboration diagram for AlpsTreeNode:

Public Member Functions

 AlpsTreeNode ()
 
virtual ~AlpsTreeNode ()
 
bool operator< (const AlpsTreeNode &compNode)
 
AlpsNodeDescmodifyDesc ()
 Access the desc so that can modify it. More...
 
AlpsNodeDescgetDesc () const
 
void setDesc (AlpsNodeDesc *desc)
 
virtual AlpsTreeNodecreateNewTreeNode (AlpsNodeDesc *&desc) const =0
 The purpose of this function is be able to create the children of a node after branching. More...
 
void removeChild (AlpsTreeNode *&child)
 Remove the pointer to given child from the list of children. More...
 
void addChild (AlpsTreeNode *&child)
 Add a child to the list of children for this node. More...
 
void removeDescendants ()
 Removes all the descendants of the node. More...
 
Query/set the current status.

set status.

AlpsNodeStatus getStatus () const
 
void setStatus (const AlpsNodeStatus stat)
 get status. More...
 
bool isCandidate () const
 Query functions about specific stati. More...
 
bool isEvaluated () const
 
bool isPregnant () const
 
bool isBranched () const
 
bool isFathomed () const
 
bool isDiscarded () const
 
bool isActive () const
 Query/set node in-process indicator. More...
 
void setActive (const bool yesno)
 
AlpsNodeIndex_t getIndex () const
 Query/set node identifier (unique within subtree). More...
 
void setIndex (const AlpsNodeIndex_t index)
 
int getDepth () const
 Query/set what depth the search tree node is at. More...
 
void setDepth (const int depth)
 
double getSolEstimate () const
 Query/set the solution estimate of the node. More...
 
void setSolEstimate (double est)
 
double getQuality () const
 Query/set the quality of the node. More...
 
void setQuality (double quality)
 
int getNumChildren () const
 Query/set what the number of children. More...
 
void setNumChildren (const int numChildren)
 
void modifyNumChildren (const int s)
 
AlpsTreeNodegetChild (const int i) const
 Query/set pointer to the ith child. More...
 
void setChild (const int i, AlpsTreeNode *node)
 
AlpsTreeNodegetParent () const
 Get/set subtree. More...
 
void setParent (AlpsTreeNode *parent)
 
AlpsNodeIndex_t getParentIndex () const
 Get/set the index of the parent of the node. More...
 
void setParentIndex (AlpsNodeIndex_t index)
 
int getExplicit () const
 Get/set the indication of whether the node has full or differencing description. More...
 
void setExplicit (int fp)
 
virtual void convertToExplicit ()
 Convert explicit description to difference, and vise-vesa. More...
 
virtual void convertToRelative ()
 
int getSentMark () const
 Various marks used in parallel code. More...
 
void setSentMark (const int tf)
 
- Public Member Functions inherited from AlpsKnowledge
 AlpsKnowledge ()
 Default constructor. More...
 
 AlpsKnowledge (AlpsKnowledgeType type)
 
 AlpsKnowledge (AlpsKnowledgeType type, AlpsKnowledgeBroker *broker)
 
virtual ~AlpsKnowledge ()
 Destructor. More...
 
AlpsKnowledgeType getType () const
 Get knowledge type. More...
 
void setType (AlpsKnowledgeType t)
 Set knowledge type. More...
 
AlpsKnowledgeBrokerbroker ()
 Get pointer to the knowledge broker. More...
 
const AlpsKnowledgeBrokerbroker () const
 Get pointer to the knowledge broker. More...
 
void setBroker (AlpsKnowledgeBroker *broker)
 Set knowledge broker. More...
 
AlpsEncodedencode () const
 Encode the content of this into an AlpsEncoded object and return a pointer to it. More...
 
virtual AlpsReturnStatus encode (AlpsEncoded *encoded) const
 Encode the content of this into the given AlpsEncoded object. More...
 
virtual AlpsKnowledgedecode (AlpsEncoded &encoded) const =0
 Decode the given AlpsEncoded object into a new AlpsKnowledge object and return a pointer to it. More...
 
virtual AlpsReturnStatus decodeToSelf (AlpsEncoded &encoded)
 Decode the given AlpsEncoded object into this. More...
 

Protected Attributes

bool active_
 The subtree own this node. More...
 
AlpsNodeIndex_t index_
 The unique index of the tree node (across the whole search tree). More...
 
int depth_
 The depth of the node (in the whole tree – the root is at depth 0). More...
 
double solEstimate_
 The solution estimate. More...
 
double quality_
 The quality of this node. More...
 
AlpsTreeNodeparent_
 The parent of the tree node. More...
 
AlpsNodeIndex_t parentIndex_
 The index of parent of the tree node. More...
 
int numChildren_
 The number of children. More...
 
AlpsTreeNode ** children_
 
int explicit_
 Indicate whether the node description is explicit(1) or relative(0). More...
 
AlpsNodeDescdesc_
 The actual description of the tree node. More...
 
AlpsNodeStatus status_
 The current status of the node. More...
 
int sentMark_
 Various mark used in splitting and passing subtrees. More...
 

Additional Inherited Members

- Public Attributes inherited from AlpsKnowledge
AlpsKnowledgeBrokerbroker_
 

Detailed Description

This class holds one node of the search tree.

Note that the generic search procedure doesn't know anything about the nodes in the tree other than their index, lower bound, etc. Other application-specific data is contained in derived classes, but is not needed for the basic operation of the search tree.

Definition at line 52 of file AlpsTreeNode.h.

Constructor & Destructor Documentation

◆ AlpsTreeNode()

AlpsTreeNode::AlpsTreeNode ( )
inline

Definition at line 103 of file AlpsTreeNode.h.

◆ ~AlpsTreeNode()

virtual AlpsTreeNode::~AlpsTreeNode ( )
inlinevirtual

Definition at line 125 of file AlpsTreeNode.h.

Member Function Documentation

◆ operator<()

bool AlpsTreeNode::operator< ( const AlpsTreeNode compNode)
inline

Definition at line 140 of file AlpsTreeNode.h.

◆ modifyDesc()

AlpsNodeDesc* AlpsTreeNode::modifyDesc ( )
inline

Access the desc so that can modify it.

Definition at line 144 of file AlpsTreeNode.h.

◆ getDesc()

AlpsNodeDesc* AlpsTreeNode::getDesc ( ) const
inline

Definition at line 145 of file AlpsTreeNode.h.

◆ setDesc()

void AlpsTreeNode::setDesc ( AlpsNodeDesc desc)
inline

Definition at line 146 of file AlpsTreeNode.h.

◆ createNewTreeNode()

virtual AlpsTreeNode* AlpsTreeNode::createNewTreeNode ( AlpsNodeDesc *&  desc) const
pure virtual

The purpose of this function is be able to create the children of a node after branching.

Implemented in AbcTreeNode, AbcTreeNode, AbcTreeNode, and KnapTreeNode.

◆ getStatus()

AlpsNodeStatus AlpsTreeNode::getStatus ( ) const
inline

Definition at line 160 of file AlpsTreeNode.h.

◆ setStatus()

void AlpsTreeNode::setStatus ( const AlpsNodeStatus  stat)
inline

get status.

Definition at line 162 of file AlpsTreeNode.h.

◆ isCandidate()

bool AlpsTreeNode::isCandidate ( ) const
inline

Query functions about specific stati.

Definition at line 167 of file AlpsTreeNode.h.

◆ isEvaluated()

bool AlpsTreeNode::isEvaluated ( ) const
inline

Definition at line 169 of file AlpsTreeNode.h.

◆ isPregnant()

bool AlpsTreeNode::isPregnant ( ) const
inline

Definition at line 171 of file AlpsTreeNode.h.

◆ isBranched()

bool AlpsTreeNode::isBranched ( ) const
inline

Definition at line 173 of file AlpsTreeNode.h.

◆ isFathomed()

bool AlpsTreeNode::isFathomed ( ) const
inline

Definition at line 175 of file AlpsTreeNode.h.

◆ isDiscarded()

bool AlpsTreeNode::isDiscarded ( ) const
inline

Definition at line 177 of file AlpsTreeNode.h.

◆ isActive()

bool AlpsTreeNode::isActive ( ) const
inline

Query/set node in-process indicator.

Definition at line 183 of file AlpsTreeNode.h.

◆ setActive()

void AlpsTreeNode::setActive ( const bool  yesno)
inline

Definition at line 184 of file AlpsTreeNode.h.

◆ getIndex()

AlpsNodeIndex_t AlpsTreeNode::getIndex ( ) const
inline

Query/set node identifier (unique within subtree).

Definition at line 189 of file AlpsTreeNode.h.

◆ setIndex()

void AlpsTreeNode::setIndex ( const AlpsNodeIndex_t  index)
inline

Definition at line 190 of file AlpsTreeNode.h.

◆ getDepth()

int AlpsTreeNode::getDepth ( ) const
inline

Query/set what depth the search tree node is at.

Definition at line 195 of file AlpsTreeNode.h.

◆ setDepth()

void AlpsTreeNode::setDepth ( const int  depth)
inline

Definition at line 196 of file AlpsTreeNode.h.

◆ getSolEstimate()

double AlpsTreeNode::getSolEstimate ( ) const
inline

Query/set the solution estimate of the node.

Definition at line 201 of file AlpsTreeNode.h.

◆ setSolEstimate()

void AlpsTreeNode::setSolEstimate ( double  est)
inline

Definition at line 202 of file AlpsTreeNode.h.

◆ getQuality()

double AlpsTreeNode::getQuality ( ) const
inline

Query/set the quality of the node.

Definition at line 207 of file AlpsTreeNode.h.

◆ setQuality()

void AlpsTreeNode::setQuality ( double  quality)
inline

Definition at line 208 of file AlpsTreeNode.h.

◆ getNumChildren()

int AlpsTreeNode::getNumChildren ( ) const
inline

Query/set what the number of children.

Definition at line 213 of file AlpsTreeNode.h.

◆ setNumChildren()

void AlpsTreeNode::setNumChildren ( const int  numChildren)
inline

Definition at line 214 of file AlpsTreeNode.h.

◆ modifyNumChildren()

void AlpsTreeNode::modifyNumChildren ( const int  s)
inline

Definition at line 225 of file AlpsTreeNode.h.

◆ getChild()

AlpsTreeNode* AlpsTreeNode::getChild ( const int  i) const
inline

Query/set pointer to the ith child.

Definition at line 236 of file AlpsTreeNode.h.

◆ setChild()

void AlpsTreeNode::setChild ( const int  i,
AlpsTreeNode node 
)
inline

Definition at line 243 of file AlpsTreeNode.h.

◆ removeChild()

void AlpsTreeNode::removeChild ( AlpsTreeNode *&  child)

Remove the pointer to given child from the list of children.

This method deletes the child as well. An error is thrown if the argument is not a pointer to a child.

◆ addChild()

void AlpsTreeNode::addChild ( AlpsTreeNode *&  child)

Add a child to the list of children for this node.

◆ removeDescendants()

void AlpsTreeNode::removeDescendants ( )

Removes all the descendants of the node.

We might want to do this in some cases where we are cutting out a subtree and replacing it with another one.

◆ getParent()

AlpsTreeNode* AlpsTreeNode::getParent ( ) const
inline

Get/set subtree.

Get/set the parent of the node

Definition at line 266 of file AlpsTreeNode.h.

◆ setParent()

void AlpsTreeNode::setParent ( AlpsTreeNode parent)
inline

Definition at line 267 of file AlpsTreeNode.h.

◆ getParentIndex()

AlpsNodeIndex_t AlpsTreeNode::getParentIndex ( ) const
inline

Get/set the index of the parent of the node.

Used in decode subtree.

Definition at line 272 of file AlpsTreeNode.h.

◆ setParentIndex()

void AlpsTreeNode::setParentIndex ( AlpsNodeIndex_t  index)
inline

Definition at line 273 of file AlpsTreeNode.h.

◆ getExplicit()

int AlpsTreeNode::getExplicit ( ) const
inline

Get/set the indication of whether the node has full or differencing description.

Definition at line 280 of file AlpsTreeNode.h.

◆ setExplicit()

void AlpsTreeNode::setExplicit ( int  fp)
inline

Definition at line 281 of file AlpsTreeNode.h.

◆ convertToExplicit()

virtual void AlpsTreeNode::convertToExplicit ( )
inlinevirtual

Convert explicit description to difference, and vise-vesa.

Definition at line 286 of file AlpsTreeNode.h.

◆ convertToRelative()

virtual void AlpsTreeNode::convertToRelative ( )
inlinevirtual

Definition at line 287 of file AlpsTreeNode.h.

◆ getSentMark()

int AlpsTreeNode::getSentMark ( ) const
inline

Various marks used in parallel code.

Definition at line 292 of file AlpsTreeNode.h.

◆ setSentMark()

void AlpsTreeNode::setSentMark ( const int  tf)
inline

Definition at line 293 of file AlpsTreeNode.h.

Member Data Documentation

◆ active_

bool AlpsTreeNode::active_
protected

The subtree own this node.

Whether the node is being worked on at the moment

Definition at line 58 of file AlpsTreeNode.h.

◆ index_

AlpsNodeIndex_t AlpsTreeNode::index_
protected

The unique index of the tree node (across the whole search tree).

Definition at line 61 of file AlpsTreeNode.h.

◆ depth_

int AlpsTreeNode::depth_
protected

The depth of the node (in the whole tree – the root is at depth 0).

Definition at line 64 of file AlpsTreeNode.h.

◆ solEstimate_

double AlpsTreeNode::solEstimate_
protected

The solution estimate.

The smaller the better.

Definition at line 67 of file AlpsTreeNode.h.

◆ quality_

double AlpsTreeNode::quality_
protected

The quality of this node.

The smaller the better.

Definition at line 70 of file AlpsTreeNode.h.

◆ parent_

AlpsTreeNode* AlpsTreeNode::parent_
protected

The parent of the tree node.

Definition at line 73 of file AlpsTreeNode.h.

◆ parentIndex_

AlpsNodeIndex_t AlpsTreeNode::parentIndex_
protected

The index of parent of the tree node.

Used in decoding sub tree.

Definition at line 76 of file AlpsTreeNode.h.

◆ numChildren_

int AlpsTreeNode::numChildren_
protected

The number of children.

Definition at line 79 of file AlpsTreeNode.h.

◆ children_

AlpsTreeNode** AlpsTreeNode::children_
protected

Definition at line 85 of file AlpsTreeNode.h.

◆ explicit_

int AlpsTreeNode::explicit_
protected

Indicate whether the node description is explicit(1) or relative(0).

Default is relative.

Definition at line 90 of file AlpsTreeNode.h.

◆ desc_

AlpsNodeDesc* AlpsTreeNode::desc_
protected

The actual description of the tree node.

Definition at line 93 of file AlpsTreeNode.h.

◆ status_

AlpsNodeStatus AlpsTreeNode::status_
protected

The current status of the node.

Definition at line 96 of file AlpsTreeNode.h.

◆ sentMark_

int AlpsTreeNode::sentMark_
protected

Various mark used in splitting and passing subtrees.

Definition at line 100 of file AlpsTreeNode.h.


The documentation for this class was generated from the following file: