Public Member Functions | Private Attributes | List of all members
BcpsSubTree Class Reference

This class is the data structure for storing a subtree within BCPS. More...

#include <BcpsSubTree.h>

Inheritance diagram for BcpsSubTree:
Inheritance graph
[legend]
Collaboration diagram for BcpsSubTree:
Collaboration graph
[legend]

Public Member Functions

 BcpsSubTree ()
 
virtual ~BcpsSubTree ()
 
BcpsConstraintPoolgetConstraintPool () const
 
BcpsVariablePoolgetVariablePool () const
 
- Public Member Functions inherited from AlpsSubTree
 AlpsSubTree ()
 Default constructor. More...
 
 AlpsSubTree (AlpsKnowledgeBroker *kb)
 Useful constructor. More...
 
virtual ~AlpsSubTree ()
 Destructor. More...
 
AlpsTreeNodeactiveNode ()
 Get pointer to active node. More...
 
void setActiveNode (AlpsTreeNode *activeNode)
 Set pointer to active node. More...
 
void createChildren (AlpsTreeNode *parent, std::vector< CoinTriple< AlpsNodeDesc *, AlpsNodeStatus, double > > &children, AlpsNodePool *kidNodePool=NULL)
 Create children nodes from the given parent node. More...
 
AlpsSubTreesplitSubTree (int &returnSize, int size=10)
 The function split the subtree and return a subtree of the specified size or available size. More...
 
virtual AlpsReturnStatus exploreSubTree (AlpsTreeNode *root, int nodeLimit, double timeLimit, int &numNodesProcessed, int &numNodesBranched, int &numNodesDiscarded, int &numNodesPartial, int &depth)
 Explore the subtree from root as the root of the subtree for given number of nodes or time, depending on which one reach first. More...
 
AlpsReturnStatus exploreUnitWork (bool leaveAsIt, int unitWork, double unitTime, AlpsExitStatus &solStatus, int &numNodesProcessed, int &numNodesBranched, int &numNodesDiscarded, int &numNodesPartial, int &depth, bool &betterSolution)
 Explore the subtree for certain amount of work/time. More...
 
virtual int rampUp (int minNumNodes, int requiredNumNodes, int &depth, AlpsTreeNode *root=NULL)
 Generate required number (specified by a parameter) of nodes. More...
 
virtual AlpsEncodedencode () const
 This method should encode the content of the subtree and return a pointer to the encoded form. More...
 
virtual AlpsKnowledgedecode (AlpsEncoded &encoded) const
 This method should decode and return a pointer to a brand new object, i.e., the method must create a new object on the heap from the decoded data instead of filling up the object for which the method was invoked. More...
 
virtual AlpsSubTreenewSubTree () const
 Create a AlpsSubtree object dynamically. More...
 
void clearNodePools ()
 Remove nodes in pools in the subtree. More...
 
void nullRootActiveNode ()
 Set root and active node to null. More...
 
void reset ()
 Move nodes in node pool, null active node. More...
 
AlpsTreeNodegetRoot () const
 Get the root node of this subtree. More...
 
void setRoot (AlpsTreeNode *r)
 Set the root node of this subtree. More...
 
AlpsNodePoolnodePool ()
 Access the node pool. More...
 
AlpsNodePooldiveNodePool ()
 Access the node pool. More...
 
void setNodePool (AlpsNodePool *np)
 Set node pool. More...
 
void changeNodePool (AlpsNodePool *np)
 Set node pool. More...
 
double getBestKnowledgeValue () const
 Get the quality of the best node in the subtree. More...
 
AlpsTreeNodegetBestNode () const
 Get the "best" node in the subtree. More...
 
AlpsKnowledgeBrokergetKnowledgeBroker () const
 Get the knowledge broker. More...
 
void setKnowledgeBroker (AlpsKnowledgeBroker *kb)
 Set a pointer to the knowledge broker. More...
 
double getQuality () const
 Get the quality of this subtree. More...
 
double getSolEstimate () const
 Get the emtimated quality of this subtree. More...
 
void incDiveDepth (int num=1)
 Increment dive depth. More...
 
int getDiveDepth ()
 Get dive depth. More...
 
void setDiveDepth (int num)
 Set dive depth. More...
 
double calculateQuality ()
 Calcuate and return the quality of this subtree, which is measured by the quality of the specified number of nodes. More...
 
int nextIndex ()
 Get the root node of this subtree. More...
 
int getNextIndex () const
 Get the index of the next generated node. More...
 
void setNextIndex (int next)
 Set the index of the next generated node. More...
 
int getNumNodes () const
 Return the number of nodes on this subtree. More...
 
void setNodeSelection (AlpsSearchStrategy< AlpsTreeNode * > *nc)
 Set the node comparision rule. More...
 
- Public Member Functions inherited from AlpsKnowledge
 AlpsKnowledge ()
 
virtual ~AlpsKnowledge ()
 
KnowledgeType getType ()
 
void setType (KnowledgeType t)
 
virtual AlpsReturnStatus encode (AlpsEncoded *encoded)
 Pack into a encode object. More...
 
AlpsEncodedgetEncoded () const
 Get/set encoded. More...
 
void setEncoded (AlpsEncoded *e)
 

Private Attributes

BcpsConstraintPoolconstraintPool_
 This is the list of objects that exist in the subtree. More...
 
BcpsVariablePoolvariablePool_
 

Additional Inherited Members

- Protected Member Functions inherited from AlpsSubTree
void removeDeadNodes (AlpsTreeNode *&node)
 The purpose of this method is to remove nodes that are not needed in the description of the subtree. More...
 
void replaceNode (AlpsTreeNode *oldNode, AlpsTreeNode *newNode)
 This function replaces oldNode with newNode in the tree. More...
 
void fathomAllNodes ()
 Fathom all nodes on this subtree. More...
 
- Protected Attributes inherited from AlpsSubTree
AlpsTreeNoderoot_
 The root of the sub tree. More...
 
AlpsNodePoolnodePool_
 A node pool containing the leaf nodes awaiting processing. More...
 
AlpsNodePooldiveNodePool_
 A node pool used when diving. More...
 
AlpsSearchStrategy
< AlpsTreeNode * > * 
diveNodeRule_
 Diving node comparing rule. More...
 
int diveDepth_
 Diving depth. More...
 
AlpsTreeNodeactiveNode_
 The next index to be assigned to a new search tree node. More...
 
double quality_
 A quantity indicating how good this subtree is. More...
 
AlpsKnowledgeBrokerbroker_
 A pointer to the knowledge broker of the process where this subtree is processed. More...
 
- Protected Attributes inherited from AlpsKnowledge
KnowledgeType type_
 

Detailed Description

This class is the data structure for storing a subtree within BCPS.

The biggest addition to the fields that already exist withink ALPS is the storage for the global list of objects that are active within that subtree. Initally, this will be implemeted as a std::set, but later on should be changed to something more efficient such as a hash table or something like that.

Definition at line 42 of file BcpsSubTree.h.

Constructor & Destructor Documentation

BcpsSubTree::BcpsSubTree ( )
inline

Definition at line 49 of file BcpsSubTree.h.

virtual BcpsSubTree::~BcpsSubTree ( )
inlinevirtual

Definition at line 54 of file BcpsSubTree.h.

Member Function Documentation

BcpsConstraintPool* BcpsSubTree::getConstraintPool ( ) const
inline

Definition at line 60 of file BcpsSubTree.h.

BcpsVariablePool* BcpsSubTree::getVariablePool ( ) const
inline

Definition at line 65 of file BcpsSubTree.h.

Member Data Documentation

BcpsConstraintPool* BcpsSubTree::constraintPool_
private

This is the list of objects that exist in the subtree.

Definition at line 45 of file BcpsSubTree.h.

BcpsVariablePool* BcpsSubTree::variablePool_
private

Definition at line 46 of file BcpsSubTree.h.


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