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