Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BcpsTreeNode Class Referenceabstract

This class contain the data for a BCPS search tree node. More...

#include <BcpsTreeNode.h>

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

Public Member Functions

 BcpsTreeNode ()
 Default constructor. More...
 
virtual ~BcpsTreeNode ()
 Destructor. More...
 
virtual int process (bool isRoot=false, bool rampUp=false)
 This methods performs the processing of the node. More...
 
virtual int bound (BcpsModel *model)=0
 Bounding procedure to estimate quality of this node. More...
 
virtual std::vector
< CoinTriple< AlpsNodeDesc
*, AlpsNodeStatus, double > > 
branch ()=0
 This method must be invoked on a pregnant node (which has all the information needed to create the children) and should create the children's decriptions. More...
 
const BcpsBranchObjectbranchObject () const
 Return the branching object. More...
 
void setBranchObject (BcpsBranchObject *b)
 Set the branching object. More...
 
- Public Member Functions inherited from AlpsTreeNode
 AlpsTreeNode ()
 
virtual ~AlpsTreeNode ()
 
bool operator< (const AlpsTreeNode &compNode)
 
AlpsNodeDescmodifyDesc ()
 Access the desc so that can modify it. More...
 
AlpsNodeDescgetDesc () const
 
void setDesc (AlpsNodeDesc *desc)
 
AlpsKnowledgeBrokergetKnowledgeBroker () const
 Functions to access/set the knwoledge broker. More...
 
void setKnowledgeBroker (AlpsKnowledgeBroker *kb)
 
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...
 
AlpsNodeStatus getStatus () const
 Query/set the current status. More...
 
void setStatus (const AlpsNodeStatus stat)
 Query/set the current status. More...
 
bool isCandidate () const
 Query functions about specific stati. More...
 
bool isEvaluated () const
 Query functions about specific stati. More...
 
bool isPregnant () const
 Query functions about specific stati. More...
 
bool isBranched () const
 Query functions about specific stati. More...
 
bool isFathomed () const
 Query functions about specific stati. More...
 
bool isDiscarded () const
 Query functions about specific stati. More...
 
bool isActive () const
 Query/set node in-process indicator. More...
 
void setActive (const bool yesno)
 Query/set node in-process indicator. More...
 
AlpsNodeIndex_t getIndex () const
 Query/set node identifier (unique within subtree). More...
 
void setIndex (const AlpsNodeIndex_t index)
 Query/set node identifier (unique within subtree). More...
 
int getDepth () const
 Query/set what depth the search tree node is at. More...
 
void setDepth (const int depth)
 Query/set what depth the search tree node is at. More...
 
double getSolEstimate () const
 Query/set the solution estimate of the node. More...
 
void setSolEstimate (double est)
 Query/set the solution estimate of the node. More...
 
double getQuality () const
 Query/set the quality of the node. More...
 
void setQuality (double quality)
 Query/set the quality of the node. More...
 
int getNumChildren () const
 Query/set what the number of children. More...
 
void setNumChildren (const int numChildren)
 Query/set what the number of children. More...
 
void modifyNumChildren (const int s)
 Query/set what the number of children. More...
 
AlpsTreeNodegetChild (const int i) const
 Query/set pointer to the ith child. More...
 
void setChild (const int i, AlpsTreeNode *node)
 Returns a const pointer to the ith child. More...
 
AlpsTreeNodegetParent () const
 Get/set subtree. More...
 
void setParent (AlpsTreeNode *parent)
 Get/set subtree. More...
 
AlpsNodeIndex_t getParentIndex () const
 Get/set the index of the parent of the node. More...
 
void setParentIndex (AlpsNodeIndex_t index)
 Get/set the index of the parent of the node. More...
 
int getExplicit () const
 Get/set the indication of whether the node has full or differencing description. More...
 
void setExplicit (int fp)
 Get/set the indication of whether the node has full or differencing description. More...
 
virtual void convertToExplicit ()
 Convert explicit description to difference, and vise-vesa. More...
 
virtual void convertToRelative ()
 Convert explicit description to difference, and vise-vesa. More...
 
int getDiving () const
 If the this node is in a diving process. More...
 
void setDiving (const bool d)
 If the this node is in a diving process. More...
 
int getSentMark () const
 Various marks used in parallel code. More...
 
void setSentMark (const int tf)
 Various marks used in parallel code. More...
 
- Public Member Functions inherited from AlpsKnowledge
 AlpsKnowledge ()
 
virtual ~AlpsKnowledge ()
 
KnowledgeType getType ()
 
void setType (KnowledgeType t)
 
virtual AlpsEncodedencode () const
 This method should encode the content of the object and return a pointer to the encoded form. More...
 
virtual AlpsReturnStatus encode (AlpsEncoded *encoded)
 Pack into a encode object. 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...
 
AlpsEncodedgetEncoded () const
 Get/set encoded. More...
 
void setEncoded (AlpsEncoded *e)
 

Protected Member Functions

virtual int generateConstraints (BcpsModel *model, BcpsConstraintPool *conPool)
 Generate constraints. More...
 
virtual int generateVariables (BcpsModel *model, BcpsVariablePool *varPool)
 Generate variables. More...
 
virtual int chooseBranchingObject (BcpsModel *model)=0
 Choose a branching object. More...
 
virtual int installSubProblem (BcpsModel *model)=0
 Extract node information (bounds, constraints, variables) from this node and load the information into the relaxation solver, such as linear programming solver. More...
 
virtual int handleBoundingStatus (int status, bool &keepOn, bool &fathomed)
 Handle bounding status: More...
 
AlpsReturnStatus encodeBcps (AlpsEncoded *encoded) const
 Pack Bcps portion of node into an encoded object. More...
 

Protected Attributes

BcpsBranchObjectbranchObject_
 Branching object for this node, which has information of how to execute branching. More...
 
- Protected Attributes inherited from AlpsTreeNode
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...
 
AlpsKnowledgeBrokerknowledgeBroker_
 A pointer to the knowledge broker of the process where this node is processed. More...
 
int sentMark_
 Various mark used in splitting and passing subtrees. More...
 
bool diving_
 When processing it, if it is in the diving processing. More...
 
- Protected Attributes inherited from AlpsKnowledge
KnowledgeType type_
 

Detailed Description

This class contain the data for a BCPS search tree node.

At this level, we consider a tree node to be simply a list of objects. The objects are organized by type. A differencing scheme is implemented here by looking for differences between the lists of each type in the current node and its parent.

Definition at line 46 of file BcpsTreeNode.h.

Constructor & Destructor Documentation

BcpsTreeNode::BcpsTreeNode ( )
inline

Default constructor.

Definition at line 99 of file BcpsTreeNode.h.

virtual BcpsTreeNode::~BcpsTreeNode ( )
inlinevirtual

Destructor.

Definition at line 102 of file BcpsTreeNode.h.

Member Function Documentation

virtual int BcpsTreeNode::generateConstraints ( BcpsModel model,
BcpsConstraintPool conPool 
)
inlineprotectedvirtual

Generate constraints.

The generated constraints are stored in constraint pool. The default implementation does nothing.

Definition at line 58 of file BcpsTreeNode.h.

virtual int BcpsTreeNode::generateVariables ( BcpsModel model,
BcpsVariablePool varPool 
)
inlineprotectedvirtual

Generate variables.

The generated varaibles are stored in variable pool. The default implementation does nothing.

Definition at line 66 of file BcpsTreeNode.h.

virtual int BcpsTreeNode::chooseBranchingObject ( BcpsModel model)
protectedpure virtual

Choose a branching object.

Implemented in BlisTreeNode, and BlisTreeNode.

virtual int BcpsTreeNode::installSubProblem ( BcpsModel model)
protectedpure virtual

Extract node information (bounds, constraints, variables) from this node and load the information into the relaxation solver, such as linear programming solver.

Implemented in BlisTreeNode, and BlisTreeNode.

virtual int BcpsTreeNode::handleBoundingStatus ( int  status,
bool &  keepOn,
bool &  fathomed 
)
inlineprotectedvirtual

Handle bounding status:

  • relaxed feasible but not integer feasible,
  • integer feasible,
  • infeasible,
  • unbounded,
  • fathomed (for instance, reaching objective limit for LP). Set node status accordingly.
    Parameters
    stausInput The solution status of bounding.
    keepOnOutput Whether to keep on bounding.
    fathomedOutput Whether this node is fathomed.

Definition at line 91 of file BcpsTreeNode.h.

virtual int BcpsTreeNode::process ( bool  isRoot = false,
bool  rampUp = false 
)
virtual

This methods performs the processing of the node.

For branch and bound, this would mean performing the bounding operation. The minimum requirement for this method is that it change the status to either internal or fathomed so the tree manager can deal with it afterwards. The status of the node when it begins processing will be active.

Reimplemented in BlisTreeNode, and BlisTreeNode.

virtual int BcpsTreeNode::bound ( BcpsModel model)
pure virtual

Bounding procedure to estimate quality of this node.

Implemented in BlisTreeNode, and BlisTreeNode.

virtual std::vector< CoinTriple<AlpsNodeDesc*, AlpsNodeStatus, double> > BcpsTreeNode::branch ( )
pure virtual

This method must be invoked on a pregnant node (which has all the information needed to create the children) and should create the children's decriptions.

The stati of the children can be any of the ones process() can return.

Implemented in BlisTreeNode, and BlisTreeNode.

const BcpsBranchObject* BcpsTreeNode::branchObject ( ) const
inline

Return the branching object.

Definition at line 123 of file BcpsTreeNode.h.

void BcpsTreeNode::setBranchObject ( BcpsBranchObject b)
inline

Set the branching object.

Definition at line 126 of file BcpsTreeNode.h.

AlpsReturnStatus BcpsTreeNode::encodeBcps ( AlpsEncoded encoded) const
inlineprotected

Pack Bcps portion of node into an encoded object.

Definition at line 131 of file BcpsTreeNode.h.

Member Data Documentation

BcpsBranchObject* BcpsTreeNode::branchObject_
protected

Branching object for this node, which has information of how to execute branching.

Definition at line 52 of file BcpsTreeNode.h.


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