Bcps 0.95.1
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BcpsBranchObject Class Referenceabstract

BcpsBranchObject contains the member data required when choosing branching entities and excuting actual branching. More...

#include <BcpsBranchObject.h>

+ Collaboration diagram for BcpsBranchObject:

Public Member Functions

 BcpsBranchObject ()
 Default Constructor.
 
 BcpsBranchObject (BcpsModel *model)
 Useful constructor.
 
 BcpsBranchObject (BcpsModel *model, int objectIndex, int direction, double value)
 Useful constructor.
 
 BcpsBranchObject (BcpsModel *model, int objectIndex, double upScore, double downScore, int direction, double value)
 Useful constructor.
 
 BcpsBranchObject (const BcpsBranchObject &)
 Copy constructor.
 
virtual ~BcpsBranchObject ()
 Destructor.
 
BcpsBranchObjectoperator= (const BcpsBranchObject &rhs)
 Assignment operator.
 
virtual BcpsBranchObjectclone () const =0
 Clone a object.
 
int getType ()
 Get type.
 
void setType (int t)
 Set type.
 
virtual int numBranches () const
 The number of branch arms created for this branch object.
 
virtual int numBranchesLeft () const
 The number of branch arms left to be evaluated.
 
virtual double branch (bool normalBranch=false)=0
 Perform branching as specified by the branching object.
 
virtual void print (bool normalBranch)
 Print information about this branching object.
 
virtual bool boundBranch () const
 Return true if branching should fix object bounds.
 
int getObjectIndex () const
 Object objectIndex.
 
void setObjectIndex (int ind)
 Set object objectIndex.
 
double getUpScore () const
 Get integer score.
 
void setUpScore (double score)
 Set integer score.
 
double getDownScore () const
 Get double score.
 
void setDownScore (double score)
 Get double score.
 
int getDirection () const
 Returns a code indicating the active arm of the branching object.
 
void setDirection (int direction)
 Set the direction of the branching object.
 
double getValue () const
 Return object branching value.
 
BcpsModelmodel () const
 Return model.
 
virtual AlpsReturnStatus encode (AlpsEncoded *encoded) const
 Pack to an encoded object.
 
virtual AlpsReturnStatus decode (AlpsEncoded &encoded)
 Unpack a branching object from an encoded object.
 

Protected Member Functions

AlpsReturnStatus encodeBcps (AlpsEncoded *encoded) const
 Pack Bcps portion to an encoded object.
 
AlpsReturnStatus decodeBcps (AlpsEncoded &encoded)
 Unpack Bcps portion from an encoded object.
 

Protected Attributes

int type_
 Type of branching.
 
BcpsModelmodel_
 The model that owns this branch object.
 
int objectIndex_
 Branch object index.
 
double upScore_
 Quality/Goodness of this object.
 
double downScore_
 The score of branching down.
 
int direction_
 Information required to do branching.
 
double value_
 Current branching value.
 
int numBranchesLeft_
 Number of arms remaining to be evaluated.
 

Detailed Description

BcpsBranchObject contains the member data required when choosing branching entities and excuting actual branching.

It also has the member funtions to do branching by adjusting bounds, etc. in solver. Branching objects can be simple integer variables or more complicated objects like SOS.

Definition at line 48 of file BcpsBranchObject.h.

Constructor & Destructor Documentation

◆ BcpsBranchObject() [1/5]

BcpsBranchObject::BcpsBranchObject ( )
inline

Default Constructor.

Definition at line 92 of file BcpsBranchObject.h.

◆ BcpsBranchObject() [2/5]

BcpsBranchObject::BcpsBranchObject ( BcpsModel * model)
inline

Useful constructor.

Definition at line 105 of file BcpsBranchObject.h.

◆ BcpsBranchObject() [3/5]

BcpsBranchObject::BcpsBranchObject ( BcpsModel * model,
int objectIndex,
int direction,
double value )
inline

Useful constructor.

Definition at line 118 of file BcpsBranchObject.h.

◆ BcpsBranchObject() [4/5]

BcpsBranchObject::BcpsBranchObject ( BcpsModel * model,
int objectIndex,
double upScore,
double downScore,
int direction,
double value )
inline

Useful constructor.

Definition at line 134 of file BcpsBranchObject.h.

◆ BcpsBranchObject() [5/5]

BcpsBranchObject::BcpsBranchObject ( const BcpsBranchObject & )

Copy constructor.

◆ ~BcpsBranchObject()

virtual BcpsBranchObject::~BcpsBranchObject ( )
inlinevirtual

Destructor.

Definition at line 155 of file BcpsBranchObject.h.

Member Function Documentation

◆ operator=()

BcpsBranchObject & BcpsBranchObject::operator= ( const BcpsBranchObject & rhs)

Assignment operator.

◆ clone()

virtual BcpsBranchObject * BcpsBranchObject::clone ( ) const
pure virtual

Clone a object.

◆ getType()

int BcpsBranchObject::getType ( )
inline

Get type.

Definition at line 164 of file BcpsBranchObject.h.

◆ setType()

void BcpsBranchObject::setType ( int t)
inline

Set type.

Definition at line 167 of file BcpsBranchObject.h.

◆ numBranches()

virtual int BcpsBranchObject::numBranches ( ) const
inlinevirtual

The number of branch arms created for this branch object.

Definition at line 170 of file BcpsBranchObject.h.

◆ numBranchesLeft()

virtual int BcpsBranchObject::numBranchesLeft ( ) const
inlinevirtual

The number of branch arms left to be evaluated.

Definition at line 173 of file BcpsBranchObject.h.

◆ branch()

virtual double BcpsBranchObject::branch ( bool normalBranch = false)
pure virtual

Perform branching as specified by the branching object.

Also, update the status of this branching object.

◆ print()

virtual void BcpsBranchObject::print ( bool normalBranch)
inlinevirtual

Print information about this branching object.

Definition at line 181 of file BcpsBranchObject.h.

◆ boundBranch()

virtual bool BcpsBranchObject::boundBranch ( ) const
inlinevirtual

Return true if branching should fix object bounds.

Definition at line 184 of file BcpsBranchObject.h.

◆ getObjectIndex()

int BcpsBranchObject::getObjectIndex ( ) const
inline

Object objectIndex.

Definition at line 187 of file BcpsBranchObject.h.

◆ setObjectIndex()

void BcpsBranchObject::setObjectIndex ( int ind)
inline

Set object objectIndex.

Definition at line 190 of file BcpsBranchObject.h.

◆ getUpScore()

double BcpsBranchObject::getUpScore ( ) const
inline

Get integer score.

Definition at line 193 of file BcpsBranchObject.h.

◆ setUpScore()

void BcpsBranchObject::setUpScore ( double score)
inline

Set integer score.

Definition at line 196 of file BcpsBranchObject.h.

◆ getDownScore()

double BcpsBranchObject::getDownScore ( ) const
inline

Get double score.

Definition at line 199 of file BcpsBranchObject.h.

◆ setDownScore()

void BcpsBranchObject::setDownScore ( double score)
inline

Get double score.

Definition at line 202 of file BcpsBranchObject.h.

◆ getDirection()

int BcpsBranchObject::getDirection ( ) const
inline

Returns a code indicating the active arm of the branching object.

Definition at line 205 of file BcpsBranchObject.h.

◆ setDirection()

void BcpsBranchObject::setDirection ( int direction)
inline

Set the direction of the branching object.

Definition at line 208 of file BcpsBranchObject.h.

◆ getValue()

double BcpsBranchObject::getValue ( ) const
inline

Return object branching value.

Definition at line 211 of file BcpsBranchObject.h.

◆ model()

BcpsModel * BcpsBranchObject::model ( ) const
inline

Return model.

Definition at line 214 of file BcpsBranchObject.h.

◆ encodeBcps()

AlpsReturnStatus BcpsBranchObject::encodeBcps ( AlpsEncoded * encoded) const
inlineprotected

Pack Bcps portion to an encoded object.

Definition at line 219 of file BcpsBranchObject.h.

◆ decodeBcps()

AlpsReturnStatus BcpsBranchObject::decodeBcps ( AlpsEncoded & encoded)
inlineprotected

Unpack Bcps portion from an encoded object.

Definition at line 233 of file BcpsBranchObject.h.

◆ encode()

virtual AlpsReturnStatus BcpsBranchObject::encode ( AlpsEncoded * encoded) const
inlinevirtual

Pack to an encoded object.

Definition at line 249 of file BcpsBranchObject.h.

◆ decode()

virtual AlpsReturnStatus BcpsBranchObject::decode ( AlpsEncoded & encoded)
inlinevirtual

Unpack a branching object from an encoded object.

Definition at line 257 of file BcpsBranchObject.h.

Member Data Documentation

◆ type_

int BcpsBranchObject::type_
protected

Type of branching.

Definition at line 53 of file BcpsBranchObject.h.

◆ model_

BcpsModel* BcpsBranchObject::model_
protected

The model that owns this branch object.

Definition at line 56 of file BcpsBranchObject.h.

◆ objectIndex_

int BcpsBranchObject::objectIndex_
protected

Branch object index.

The index is not the same as variable index. For integer branching, the index refers to the position in the integer object array/vector.

Definition at line 61 of file BcpsBranchObject.h.

◆ upScore_

double BcpsBranchObject::upScore_
protected

Quality/Goodness of this object.

They are set when creating candiate branching entities, and used when comparing two branching enities. Derived class can add more metrics. The score of branching up. Used for binary branching only.

Definition at line 70 of file BcpsBranchObject.h.

◆ downScore_

double BcpsBranchObject::downScore_
protected

The score of branching down.

Used for binary branching only.

Definition at line 73 of file BcpsBranchObject.h.

◆ direction_

int BcpsBranchObject::direction_
protected

Information required to do branching.

Used for binary branching only. The direction of the active branch. Down is -1, up is 1.

Definition at line 79 of file BcpsBranchObject.h.

◆ value_

double BcpsBranchObject::value_
protected

Current branching value.

For integer, it can be fractional solution value.

Definition at line 83 of file BcpsBranchObject.h.

◆ numBranchesLeft_

int BcpsBranchObject::numBranchesLeft_
protected

Number of arms remaining to be evaluated.

Definition at line 86 of file BcpsBranchObject.h.


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