Bcps 0.94.5
Loading...
Searching...
No Matches
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:
+ Collaboration diagram for BcpsTreeNode:

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 ()
 
AlpsNodeDescgetDesc () const
 
void setDesc (AlpsNodeDesc *desc)
 
AlpsKnowledgeBrokergetKnowledgeBroker () const
 
void setKnowledgeBroker (AlpsKnowledgeBroker *kb)
 
virtual AlpsTreeNodecreateNewTreeNode (AlpsNodeDesc *&desc) const=0
 
void removeChild (AlpsTreeNode *&child)
 
void addChild (AlpsTreeNode *&child)
 
void removeDescendants ()
 
AlpsNodeStatus getStatus () const
 
void setStatus (const AlpsNodeStatus stat)
 
bool isCandidate () const
 
bool isEvaluated () const
 
bool isPregnant () const
 
bool isBranched () const
 
bool isFathomed () const
 
bool isDiscarded () const
 
bool isActive () const
 
void setActive (const bool yesno)
 
AlpsNodeIndex_t getIndex () const
 
void setIndex (const AlpsNodeIndex_t index)
 
int getDepth () const
 
void setDepth (const int depth)
 
double getSolEstimate () const
 
void setSolEstimate (double est)
 
double getQuality () const
 
void setQuality (double quality)
 
int getNumChildren () const
 
void setNumChildren (const int numChildren)
 
void modifyNumChildren (const int s)
 
AlpsTreeNodegetChild (const int i) const
 
void setChild (const int i, AlpsTreeNode *node)
 
AlpsTreeNodegetParent () const
 
void setParent (AlpsTreeNode *parent)
 
AlpsNodeIndex_t getParentIndex () const
 
void setParentIndex (AlpsNodeIndex_t index)
 
int getExplicit () const
 
void setExplicit (int fp)
 
virtual void convertToExplicit ()
 
virtual void convertToRelative ()
 
int getSentMark () const
 
void setSentMark (const int tf)
 
AlpsNodeStatus getStatus () const
 
void setStatus (const AlpsNodeStatus stat)
 
bool isCandidate () const
 
bool isEvaluated () const
 
bool isPregnant () const
 
bool isBranched () const
 
bool isFathomed () const
 
bool isDiscarded () const
 
bool isActive () const
 
void setActive (const bool yesno)
 
AlpsNodeIndex_t getIndex () const
 
void setIndex (const AlpsNodeIndex_t index)
 
int getDepth () const
 
void setDepth (const int depth)
 
double getSolEstimate () const
 
void setSolEstimate (double est)
 
double getQuality () const
 
void setQuality (double quality)
 
int getNumChildren () const
 
void setNumChildren (const int numChildren)
 
void modifyNumChildren (const int s)
 
AlpsTreeNodegetChild (const int i) const
 
void setChild (const int i, AlpsTreeNode *node)
 
AlpsTreeNodegetParent () const
 
void setParent (AlpsTreeNode *parent)
 
AlpsNodeIndex_t getParentIndex () const
 
void setParentIndex (AlpsNodeIndex_t index)
 
int getExplicit () const
 
void setExplicit (int fp)
 
virtual void convertToExplicit ()
 
virtual void convertToRelative ()
 
int getSentMark () const
 
void setSentMark (const int tf)
 
- Public Member Functions inherited from AlpsKnowledge
 AlpsKnowledge ()
 
virtual ~AlpsKnowledge ()
 
KnowledgeType getType ()
 
void setType (KnowledgeType t)
 
virtual AlpsEncodedencode () const
 
virtual AlpsReturnStatus encode (AlpsEncoded *encoded)
 
virtual AlpsKnowledgedecode (AlpsEncoded &encoded) const
 
AlpsEncodedgetEncoded () const
 
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_
 
AlpsNodeIndex_t index_
 
int depth_
 
double solEstimate_
 
double quality_
 
AlpsTreeNodeparent_
 
AlpsNodeIndex_t parentIndex_
 
int numChildren_
 
AlpsTreeNode ** children_
 
int explicit_
 
AlpsNodeDescdesc_
 
AlpsNodeStatus status_
 
AlpsKnowledgeBrokerknowledgeBroker_
 
int sentMark_
 
- 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::BcpsTreeNode ( )
inline

Default constructor.

Definition at line 99 of file BcpsTreeNode.h.

◆ ~BcpsTreeNode()

virtual BcpsTreeNode::~BcpsTreeNode ( )
inlinevirtual

Destructor.

Definition at line 102 of file BcpsTreeNode.h.

Member Function Documentation

◆ generateConstraints()

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.

◆ generateVariables()

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.

◆ chooseBranchingObject()

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

Choose a branching object.

◆ installSubProblem()

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.

◆ handleBoundingStatus()

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.

◆ process()

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.

◆ bound()

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

Bounding procedure to estimate quality of this node.

◆ branch()

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.

◆ branchObject()

const BcpsBranchObject * BcpsTreeNode::branchObject ( ) const
inline

Return the branching object.

Definition at line 123 of file BcpsTreeNode.h.

◆ setBranchObject()

void BcpsTreeNode::setBranchObject ( BcpsBranchObject b)
inline

Set the branching object.

Definition at line 126 of file BcpsTreeNode.h.

◆ encodeBcps()

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

◆ branchObject_

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: