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