29 #ifndef BcpsBranchObject_h_
30 #define BcpsBranchObject_h_
35 #include "AlpsEncoded.h"
177 virtual double branch(
bool normalBranch =
false) = 0;
180 virtual void print(
bool normalBranch) {}
219 AlpsReturnStatus status = AlpsReturnStatusOk;
225 encoded->writeRep(
value_);
233 AlpsReturnStatus status = AlpsReturnStatusOk;
248 virtual AlpsReturnStatus
encode(AlpsEncoded *encoded)
const {
249 AlpsReturnStatus status = AlpsReturnStatusOk;
256 virtual AlpsReturnStatus
decode(AlpsEncoded &encoded) {
257 AlpsReturnStatus status = AlpsReturnStatusOk;
int getDirection() const
Returns a code indicating the active arm of the branching object.
virtual AlpsReturnStatus decode(AlpsEncoded &encoded)
Unpack a branching object from an encoded object.
int direction_
Information required to do branching.
virtual void print(bool normalBranch)
Print information about this branching object.
int numBranchesLeft_
Number of arms remaining to be evaluated.
BcpsBranchObject & operator=(const BcpsBranchObject &rhs)
Assignment operator.
double getUpScore() const
Get integer score.
virtual int numBranches() const
The number of branch arms created for this branch object.
void setType(int t)
Set type.
double value_
Current branching value.
BcpsModel * model_
The model that owns this branch object.
void setObjectIndex(int ind)
Set object objectIndex.
virtual AlpsReturnStatus encode(AlpsEncoded *encoded) const
Pack to an encoded object.
virtual double branch(bool normalBranch=false)=0
Perform branching as specified by the branching object.
virtual BcpsBranchObject * clone() const =0
Clone a object.
virtual int numBranchesLeft() const
The number of branch arms left to be evaluated.
int type_
Type of branching.
BcpsBranchObject(BcpsModel *model, int objectIndex, int direction, double value)
Useful constructor.
double getDownScore() const
Get double score.
AlpsReturnStatus decodeBcps(AlpsEncoded &encoded)
Unpack Bcps portion from an encoded object.
BcpsBranchObject(BcpsModel *model, int objectIndex, int upScore, double downScore, int direction, double value)
Useful constructor.
int objectIndex_
Branch object index.
virtual ~BcpsBranchObject()
Destructor.
double upScore_
Quality/Goodness of this object.
virtual bool boundBranch() const
Return true if branching should fix object bounds.
BcpsBranchObject contains the member data required when choosing branching entities and excuting actu...
BcpsBranchObject()
Default Constructor.
double downScore_
The score of branching down.
void setDownScore(double score)
Get double score.
double getValue() const
Return object branching value.
BcpsModel * model() const
Return model.
int getObjectIndex() const
Object objectIndex.
AlpsReturnStatus encodeBcps(AlpsEncoded *encoded) const
Pack Bcps portion to an encoded object.
BcpsBranchObject(BcpsModel *model)
Useful constructor.
void setUpScore(double score)
Set integer score.
void setDirection(int direction)
Set the direction of the branching object.