29 #ifndef BcpsBranchObject_h_ 30 #define BcpsBranchObject_h_ 35 #include "AlpsEncoded.h" 124 objectIndex_(objectIndex),
127 direction_(direction),
142 objectIndex_(objectIndex),
144 downScore_(downScore),
145 direction_(direction),
177 virtual double branch(
bool normalBranch =
false) = 0;
180 virtual void print(
bool normalBranch) {}
219 AlpsReturnStatus status = AlpsReturnStatusOk;
221 encoded->writeRep(objectIndex_);
222 encoded->writeRep(upScore_);
223 encoded->writeRep(downScore_);
224 encoded->writeRep(direction_);
225 encoded->writeRep(value_);
226 encoded->writeRep(numBranchesLeft_);
233 AlpsReturnStatus status = AlpsReturnStatusOk;
235 encoded.readRep(objectIndex_);
236 encoded.readRep(upScore_);
237 encoded.readRep(downScore_);
238 encoded.readRep(direction_);
239 encoded.readRep(value_);
240 encoded.readRep(numBranchesLeft_);
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 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.
virtual BcpsBranchObject * clone() const =0
Clone a object.
void setDirection(int direction)
Set the direction of the branching object.