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;
virtual AlpsReturnStatus decode(AlpsEncoded &encoded)
Unpack a branching object from an encoded object.
virtual bool boundBranch() const
Return true if branching should fix object bounds.
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.
void setType(int t)
Set type.
double value_
Current branching value.
BcpsModel * model_
The model that owns this branch object.
double getValue() const
Return object branching value.
void setObjectIndex(int ind)
Set object objectIndex.
BcpsModel * model() const
Return model.
virtual double branch(bool normalBranch=false)=0
Perform branching as specified by the branching object.
int getObjectIndex() const
Object objectIndex.
virtual AlpsReturnStatus encode(AlpsEncoded *encoded) const
Pack to an encoded object.
virtual int numBranchesLeft() const
The number of branch arms left to be evaluated.
virtual BcpsBranchObject * clone() const =0
Clone a object.
double getDownScore() const
Get double score.
virtual int numBranches() const
The number of branch arms created for this branch object.
int type_
Type of branching.
BcpsBranchObject(BcpsModel *model, int objectIndex, int direction, double value)
Useful constructor.
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.
double getUpScore() const
Get integer score.
AlpsReturnStatus encodeBcps(AlpsEncoded *encoded) const
Pack Bcps portion to an encoded object.
BcpsBranchObject contains the member data required when choosing branching entities and excuting actu...
BcpsBranchObject()
Default Constructor.
double downScore_
The score of branching down.
int getDirection() const
Returns a code indicating the active arm of the branching object.
void setDownScore(double score)
Get double score.
BcpsBranchObject(BcpsModel *model)
Useful constructor.
void setUpScore(double score)
Set integer score.
void setDirection(int direction)
Set the direction of the branching object.