- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# AlpsTreeNode Class Reference

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

`#include <AlpsTreeNode.h>`

Inheritance diagram for AlpsTreeNode:

[legend]
Collaboration diagram for AlpsTreeNode:

[legend]
List of all members.

## Public Member Functions
| AlpsTreeNode ()
virtual | ~AlpsTreeNode ()
bool | operator< (const AlpsTreeNode &compNode)
AlpsNodeDesc * | modifyDesc ()
| Access the desc so that can modify it.
AlpsNodeDesc * | getDesc () const
void | setDesc (AlpsNodeDesc *desc)
AlpsKnowledgeBroker * | getKnowledgeBroker () const
| Functions to access/set the knwoledge broker.
void | setKnowledgeBroker (AlpsKnowledgeBroker *kb)
virtual AlpsTreeNode * | createNewTreeNode (AlpsNodeDesc *&desc) const =0
| The purpose of this function is be able to create the children of a node after branching.
void | removeChild (AlpsTreeNode *&child)
| Remove the pointer to given child from the list of children.
void | addChild (AlpsTreeNode *&child)
| Add a child to the list of children for this node.
void | removeDescendants ()
| Removes all the descendants of the node.
AlpsNodeStatus | getStatus () const
| Query/set the current status.
void | setStatus (const AlpsNodeStatus stat)
| Query/set the current status.
bool | isCandidate () const
| Query functions about specific stati.
bool | isEvaluated () const
| Query functions about specific stati.
bool | isPregnant () const
| Query functions about specific stati.
bool | isBranched () const
| Query functions about specific stati.
bool | isFathomed () const
| Query functions about specific stati.
bool | isDiscarded () const
| Query functions about specific stati.
bool | isActive () const
| Query/set node in-process indicator.
void | setActive (const bool yesno)
| Query/set node in-process indicator.
AlpsNodeIndex_t | getIndex () const
| Query/set node identifier (unique within subtree).
void | setIndex (const AlpsNodeIndex_t index)
| Query/set node identifier (unique within subtree).
int | getDepth () const
| Query/set what depth the search tree node is at.
void | setDepth (const int depth)
| Query/set what depth the search tree node is at.
double | getSolEstimate () const
| Query/set the solution estimate of the node.
void | setSolEstimate (double est)
| Query/set the solution estimate of the node.
double | getQuality () const
| Query/set the quality of the node.
void | setQuality (double quality)
| Query/set the quality of the node.
int | getNumChildren () const
| Query/set what the number of children.
void | setNumChildren (const int numChildren)
| Query/set what the number of children.
void | modifyNumChildren (const int s)
| Query/set what the number of children.
AlpsTreeNode * | getChild (const int i) const
| Query/set pointer to the ith child.
void | setChild (const int i, AlpsTreeNode *node)
| Returns a const pointer to the ith child.
AlpsTreeNode * | getParent () const
| Get/set the parent of the node.
void | setParent (AlpsTreeNode *parent)
| Get/set the parent of the node.
AlpsNodeIndex_t | getParentIndex () const
| Get/set the index of the parent of the node.
void | setParentIndex (AlpsNodeIndex_t index)
| Get/set the index of the parent of the node.
int | getExplicit () const
| Get/set the indication of whether the node has full or differencing description.
void | setExplicit (int fp)
| Get/set the indication of whether the node has full or differencing description.
virtual void | convertToExplicit ()
| Convert explicit description to difference, and vise-vesa.
virtual void | convertToRelative ()
| Convert explicit description to difference, and vise-vesa.
int | getDiving () const
| If the this node is in a diving process.
void | setDiving (const bool d)
| If the this node is in a diving process.
int | getSentMark () const
| Various marks used in parallel code.
void | setSentMark (const int tf)
| Various marks used in parallel code.
## Protected Attributes
bool | active_
| Whether the node is being worked on at the moment.
AlpsNodeIndex_t | index_
| The unique index of the tree node (across the whole search tree).
int | depth_
| The depth of the node (in the whole tree -- the root is at depth 0).
double | solEstimate_
| The solution estimate.
double | quality_
| The quality of this node.
AlpsTreeNode * | parent_
| The parent of the tree node.
AlpsNodeIndex_t | parentIndex_
| The index of parent of the tree node.
int | numChildren_
| The number of children.
AlpsTreeNode ** | children_
int | explicit_
| Indicate whether the node description is explicit(1) or relative(0).
AlpsNodeDesc * | desc_
| The actual description of the tree node.
AlpsNodeStatus | status_
| The current status of the node.
AlpsKnowledgeBroker * | knowledgeBroker_
| A pointer to the knowledge broker of the process where this node is processed.
int | sentMark_
| Various mark used in splitting and passing subtrees.
bool | diving_
| When processing it, if it is in the diving processing.
## Private Member Functions
| AlpsTreeNode (const AlpsTreeNode &)
AlpsTreeNode & | operator= (const AlpsTreeNode &)

## 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 50 of file AlpsTreeNode.h.

## Constructor & Destructor Documentation

AlpsTreeNode::AlpsTreeNode | ( | const AlpsTreeNode & |  | ) | `[private]`

AlpsTreeNode::AlpsTreeNode | ( |  | ) | `[inline]`

Definition at line 113 of file AlpsTreeNode.h.

References AlpsKnowledgeTypeNode, and AlpsKnowledge::setType().

virtual AlpsTreeNode::~AlpsTreeNode | ( |  | ) | `[inline, virtual]`

Definition at line 136 of file AlpsTreeNode.h.

References children_, desc_, and numChildren_.

## Member Function Documentation

AlpsTreeNode& AlpsTreeNode::operator= | ( | const AlpsTreeNode & |  | ) | `[private]`

bool AlpsTreeNode::operator< | ( | const AlpsTreeNode & | compNode | ) | `[inline]`

Definition at line 151 of file AlpsTreeNode.h.

References getQuality(), and quality_.

AlpsNodeDesc* AlpsTreeNode::modifyDesc | ( |  | ) | `[inline]`

Access the desc so that can modify it.

Definition at line 155 of file AlpsTreeNode.h.

References desc_.

AlpsNodeDesc* AlpsTreeNode::getDesc | ( |  | ) | const`[inline]`

Definition at line 156 of file AlpsTreeNode.h.

References desc_.

void AlpsTreeNode::setDesc | ( | AlpsNodeDesc * | desc | ) | `[inline]`

Definition at line 157 of file AlpsTreeNode.h.

References desc_.

AlpsKnowledgeBroker* AlpsTreeNode::getKnowledgeBroker | ( |  | ) | const`[inline]`

Functions to access/set the knwoledge broker.

Definition at line 160 of file AlpsTreeNode.h.

References knowledgeBroker_.

Referenced by AbcTreeNode::AbcTreeNode(), and KnapTreeNode::KnapTreeNode().

void AlpsTreeNode::setKnowledgeBroker | ( | AlpsKnowledgeBroker * | kb | ) | `[inline]`

Definition at line 162 of file AlpsTreeNode.h.

References knowledgeBroker_.

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, KnapTreeNode, BlisTreeNode, and BlisTreeNode.

AlpsNodeStatus AlpsTreeNode::getStatus | ( |  | ) | const`[inline]`

Query/set the current status.

Definition at line 176 of file AlpsTreeNode.h.

References status_.

Referenced by AlpsSubTree::getNumNodes().

void AlpsTreeNode::setStatus | ( | const AlpsNodeStatus | stat | ) | `[inline]`

Query/set the current status.

Definition at line 177 of file AlpsTreeNode.h.

References status_.

bool AlpsTreeNode::isCandidate | ( |  | ) | const`[inline]`

Query functions about specific stati.

Definition at line 182 of file AlpsTreeNode.h.

References AlpsNodeStatusCandidate, and status_.

bool AlpsTreeNode::isEvaluated | ( |  | ) | const`[inline]`

Query functions about specific stati.

Definition at line 184 of file AlpsTreeNode.h.

References AlpsNodeStatusEvaluated, and status_.

bool AlpsTreeNode::isPregnant | ( |  | ) | const`[inline]`

Query functions about specific stati.

Definition at line 186 of file AlpsTreeNode.h.

References AlpsNodeStatusPregnant, and status_.

bool AlpsTreeNode::isBranched | ( |  | ) | const`[inline]`

Query functions about specific stati.

Definition at line 188 of file AlpsTreeNode.h.

References AlpsNodeStatusBranched, and status_.

bool AlpsTreeNode::isFathomed | ( |  | ) | const`[inline]`

Query functions about specific stati.

Definition at line 190 of file AlpsTreeNode.h.

References AlpsNodeStatusFathomed, and status_.

bool AlpsTreeNode::isDiscarded | ( |  | ) | const`[inline]`

Query functions about specific stati.

Definition at line 192 of file AlpsTreeNode.h.

References AlpsNodeStatusDiscarded, and status_.

bool AlpsTreeNode::isActive | ( |  | ) | const`[inline]`

Query/set node in-process indicator.

Definition at line 198 of file AlpsTreeNode.h.

References active_.

void AlpsTreeNode::setActive | ( | const bool | yesno | ) | `[inline]`

Query/set node in-process indicator.

Definition at line 199 of file AlpsTreeNode.h.

References active_.

AlpsNodeIndex_t AlpsTreeNode::getIndex | ( |  | ) | const`[inline]`

Query/set node identifier (unique within subtree).

Definition at line 204 of file AlpsTreeNode.h.

References index_.

void AlpsTreeNode::setIndex | ( | const AlpsNodeIndex_t | index | ) | `[inline]`

Query/set node identifier (unique within subtree).

Definition at line 205 of file AlpsTreeNode.h.

References index_.

int AlpsTreeNode::getDepth | ( |  | ) | const`[inline]`

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

Definition at line 210 of file AlpsTreeNode.h.

References depth_.

Referenced by AlpsNodeSelectionDepth::compare(), and AlpsNodeSelectionBreadth::compare().

void AlpsTreeNode::setDepth | ( | const int | depth | ) | `[inline]`

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

Definition at line 211 of file AlpsTreeNode.h.

References depth_.

double AlpsTreeNode::getSolEstimate | ( |  | ) | const`[inline]`

Query/set the solution estimate of the node.

Definition at line 216 of file AlpsTreeNode.h.

References solEstimate_.

Referenced by AlpsNodeSelectionEstimate::compare(), and AlpsSubTree::getSolEstimate().

void AlpsTreeNode::setSolEstimate | ( | double | est | ) | `[inline]`

Query/set the solution estimate of the node.

Definition at line 217 of file AlpsTreeNode.h.

References solEstimate_.

Referenced by BlisModel::setSolEstimate().

double AlpsTreeNode::getQuality | ( |  | ) | const`[inline]`

Query/set the quality of the node.

Definition at line 222 of file AlpsTreeNode.h.

References quality_.

Referenced by AlpsNodeSelectionHybrid::compare(), AlpsNodeSelectionBest::compare(), AlpsNodePool::getBestKnowledgeValue(), AlpsNodePool::getBestNode(), AlpsNodePool::getKnowledge(), TotalWorkload::operator()(), operator<(), and AlpsSubTree::reset().

void AlpsTreeNode::setQuality | ( | double | quality | ) | `[inline]`

Query/set the quality of the node.

Definition at line 223 of file AlpsTreeNode.h.

References quality_.

int AlpsTreeNode::getNumChildren | ( |  | ) | const`[inline]`

Query/set what the number of children.

Definition at line 228 of file AlpsTreeNode.h.

References numChildren_.

void AlpsTreeNode::setNumChildren | ( | const int | numChildren | ) | `[inline]`

Query/set what the number of children.

Definition at line 229 of file AlpsTreeNode.h.

References children_, and numChildren_.

void AlpsTreeNode::modifyNumChildren | ( | const int | s | ) | `[inline]`

Query/set what the number of children.

Definition at line 240 of file AlpsTreeNode.h.

References numChildren_.

AlpsTreeNode* AlpsTreeNode::getChild | ( | const int | i | ) | const`[inline]`

Query/set pointer to the ith child.

Definition at line 251 of file AlpsTreeNode.h.

References children_.

void AlpsTreeNode::setChild | ( | const int | i,
|  | AlpsTreeNode * | node |
| ) |  |  | `[inline]`

Returns a const pointer to the ith child.

Definition at line 258 of file AlpsTreeNode.h.

References children_.

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.

void AlpsTreeNode::addChild | ( | AlpsTreeNode *& | child | ) |

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

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.

AlpsTreeNode* AlpsTreeNode::getParent | ( |  | ) | const`[inline]`

Get/set the parent of the node.

Definition at line 281 of file AlpsTreeNode.h.

References parent_.

void AlpsTreeNode::setParent | ( | AlpsTreeNode * | parent | ) | `[inline]`

Get/set the parent of the node.

Definition at line 282 of file AlpsTreeNode.h.

References parent_.

AlpsNodeIndex_t AlpsTreeNode::getParentIndex | ( |  | ) | const`[inline]`

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

Used in decode subtree.

Definition at line 287 of file AlpsTreeNode.h.

References parentIndex_.

void AlpsTreeNode::setParentIndex | ( | AlpsNodeIndex_t | index | ) | `[inline]`

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

Used in decode subtree.

Definition at line 288 of file AlpsTreeNode.h.

References parentIndex_.

int AlpsTreeNode::getExplicit | ( |  | ) | const`[inline]`

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

Definition at line 295 of file AlpsTreeNode.h.

References explicit_.

void AlpsTreeNode::setExplicit | ( | int | fp | ) | `[inline]`

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

Definition at line 296 of file AlpsTreeNode.h.

References explicit_.

virtual void AlpsTreeNode::convertToExplicit | ( |  | ) | `[inline, virtual]`

Convert explicit description to difference, and vise-vesa.

Reimplemented in BlisTreeNode, and BlisTreeNode.

Definition at line 301 of file AlpsTreeNode.h.

virtual void AlpsTreeNode::convertToRelative | ( |  | ) | `[inline, virtual]`

Convert explicit description to difference, and vise-vesa.

Reimplemented in BlisTreeNode, and BlisTreeNode.

Definition at line 302 of file AlpsTreeNode.h.

int AlpsTreeNode::getDiving | ( |  | ) | const`[inline]`

If the this node is in a diving process.

Definition at line 307 of file AlpsTreeNode.h.

References diving_.

void AlpsTreeNode::setDiving | ( | const bool | d | ) | `[inline]`

If the this node is in a diving process.

Definition at line 308 of file AlpsTreeNode.h.

References diving_.

int AlpsTreeNode::getSentMark | ( |  | ) | const`[inline]`

Various marks used in parallel code.

Definition at line 313 of file AlpsTreeNode.h.

References sentMark_.

void AlpsTreeNode::setSentMark | ( | const int | tf | ) | `[inline]`

Various marks used in parallel code.

Definition at line 314 of file AlpsTreeNode.h.

References sentMark_.

## Member Data Documentation

bool AlpsTreeNode::active_`[protected]`

Whether the node is being worked on at the moment.

Definition at line 60 of file AlpsTreeNode.h.

Referenced by isActive(), and setActive().

AlpsNodeIndex_t AlpsTreeNode::index_`[protected]`

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

Definition at line 63 of file AlpsTreeNode.h.

Referenced by getIndex(), and setIndex().

int AlpsTreeNode::depth_`[protected]`

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

Definition at line 66 of file AlpsTreeNode.h.

Referenced by getDepth(), and setDepth().

double AlpsTreeNode::solEstimate_`[protected]`

The solution estimate.

The smaller the better.

Definition at line 69 of file AlpsTreeNode.h.

Referenced by getSolEstimate(), and setSolEstimate().

double AlpsTreeNode::quality_`[protected]`

The quality of this node.

The smaller the better.

Definition at line 72 of file AlpsTreeNode.h.

Referenced by AbcTreeNode::getObjValue(), getQuality(), operator<(), AbcTreeNode::setObjValue(), and setQuality().

AlpsTreeNode* AlpsTreeNode::parent_`[protected]`

The parent of the tree node.

Definition at line 75 of file AlpsTreeNode.h.

Referenced by getParent(), and setParent().

AlpsNodeIndex_t AlpsTreeNode::parentIndex_`[protected]`

The index of parent of the tree node.

Used in decoding sub tree.

Definition at line 78 of file AlpsTreeNode.h.

Referenced by getParentIndex(), and setParentIndex().

int AlpsTreeNode::numChildren_`[protected]`

The number of children.

Definition at line 81 of file AlpsTreeNode.h.

Referenced by getNumChildren(), modifyNumChildren(), setNumChildren(), and ~AlpsTreeNode().

AlpsTreeNode** AlpsTreeNode::children_`[protected]`

Definition at line 87 of file AlpsTreeNode.h.

Referenced by getChild(), setChild(), setNumChildren(), and ~AlpsTreeNode().

int AlpsTreeNode::explicit_`[protected]`

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

Default is relative.

Definition at line 92 of file AlpsTreeNode.h.

Referenced by getExplicit(), and setExplicit().

AlpsNodeDesc* AlpsTreeNode::desc_`[protected]`

The actual description of the tree node.

Definition at line 95 of file AlpsTreeNode.h.

Referenced by AbcTreeNode::AbcTreeNode(), BlisTreeNode::BlisTreeNode(), getDesc(), KnapTreeNode::KnapTreeNode(), modifyDesc(), setDesc(), and ~AlpsTreeNode().

AlpsNodeStatus AlpsTreeNode::status_`[protected]`

The current status of the node.

Definition at line 98 of file AlpsTreeNode.h.

Referenced by getStatus(), isBranched(), isCandidate(), isDiscarded(), isEvaluated(), isFathomed(), isPregnant(), and setStatus().

AlpsKnowledgeBroker* AlpsTreeNode::knowledgeBroker_`[protected]`

A pointer to the knowledge broker of the process where this node is processed.

Definition at line 103 of file AlpsTreeNode.h.

Referenced by getKnowledgeBroker(), and setKnowledgeBroker().

int AlpsTreeNode::sentMark_`[protected]`

Various mark used in splitting and passing subtrees.

Definition at line 107 of file AlpsTreeNode.h.

Referenced by getSentMark(), and setSentMark().

bool AlpsTreeNode::diving_`[protected]`

When processing it, if it is in the diving processing.

Definition at line 110 of file AlpsTreeNode.h.

Referenced by getDiving(), and setDiving().

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

- /home/coin/SVN-release/Blis-0.91.0/Alps/src/AlpsTreeNode.h