27 #include "AlpsKnowledge.h"
36 #define BCPS_NONREMOVALBE 0x0001
37 #define BCPS_BRACNEDON 0x0010
38 #define BCPS_SENDABLE 0x0100
137 effectiveness_(-ALPS_DBL_MAX)
153 effectiveness_(-ALPS_DBL_MAX)
279 double &ceilingValue,
281 double tolerance)
const;
295 AlpsReturnStatus status = AlpsReturnStatusOk;
296 encoded->writeRep(objectIndex_);
297 encoded->writeRep(repType_);
298 encoded->writeRep(intType_);
299 encoded->writeRep(validRegion_);
300 encoded->writeRep(status_);
301 encoded->writeRep(lbHard_);
302 encoded->writeRep(ubHard_);
303 encoded->writeRep(lbSoft_);
304 encoded->writeRep(ubSoft_);
305 encoded->writeRep(hashValue_);
311 AlpsReturnStatus status = AlpsReturnStatusOk;
312 encoded.readRep(objectIndex_);
313 encoded.readRep(repType_);
314 encoded.readRep(intType_);
315 encoded.readRep(validRegion_);
316 encoded.readRep(status_);
317 encoded.readRep(lbHard_);
318 encoded.readRep(ubHard_);
319 encoded.readRep(lbSoft_);
320 encoded.readRep(ubSoft_);
321 encoded.readRep(hashValue_);
329 using AlpsKnowledge::encode ;
331 virtual AlpsReturnStatus
encode(AlpsEncoded *encoded) {
332 AlpsReturnStatus status = AlpsReturnStatusOk;
338 virtual AlpsKnowledge*
decode(AlpsEncoded& encoded)
const {
339 AlpsKnowledge* know = NULL;
virtual void floorCeiling(double &floorValue, double &ceilingValue, double value, double tolerance) const
Returns floor and ceiling i.e.
BcpsConstraint(const BcpsConstraint &rhs)
Copy constructor.
double lbSoft_
The current lower bound of the object.
void setLbHard(double lb)
virtual AlpsReturnStatus encode(AlpsEncoded *encoded)
Pack into a encode object.
BcpsVariable(double lbh, double ubh, double lbs, double ubs)
Useful constructor.
int status_
The status of the object.
void setNumInactive(int num)
virtual BcpsBranchObject * preferredNewFeasible(BcpsModel *m) const
Given a valid solution (with reduced costs, etc.), return a branching object which would give a new f...
BcpsConstraint(double lbh, double ubh, double lbs, double ubs)
Useful constructor.
int getNumInactive() const
double ubHard_
The upper bound of the object when it was first created.
virtual BcpsObject_t getObjType() const
void setObjectIndex(int ind)
Set the appropriate property.
virtual double upEstimate() const
Return "up" estimate.
void setValidRegion(BcpsValidRegion val)
virtual void feasibleRegion(BcpsModel *m)
Look at the current solution and set bounds to match the solution.
virtual double infeasibility(BcpsModel *m, int &preferredWay) const
Infeasibility of the object This is some measure of the infeasibility of the object.
virtual BcpsObject * clone() const
Clone an enity.
virtual AlpsKnowledge * decode(AlpsEncoded &encoded) const
Decode a constraint from an encoded object.
double getEffectiveness() const
int getObjectIndex() const
Return the value of the appropriate field.
BcpsObject(const BcpsObject &rhs)
Copy constructor.
double hashValue_
The hash value of this object.
virtual void hashing(BcpsModel *model=NULL)
Hashing.
void setLbSoft(double lb)
void setIntType(BcpsIntegral_t it)
BcpsIntegral_t getIntType() const
void setUbHard(double ub)
void setUbSoft(double ub)
double ubSoft_
The current upper bound of the object.
BcpsVariable(const BcpsVariable &rhs)
Copy constructor.
char BcpsIntegral_t
typedef's for various integral types.
BcpsObject(double lbh, double ubh, double lbs, double ubs)
virtual BcpsBranchObject * notPreferredNewFeasible(BcpsModel *m) const
Given a valid solution (with reduced costs, etc.), return a branching object which would give a new f...
virtual ~BcpsConstraint()
Desctructor constructor.
A class for describing the objects that comprise a BCPS subproblem.
int numInactive_
Number of inactive when in formulation.
BcpsIntegral_t intType_
The integrality type of the object, i.e., what values it can take up between the specified bounds...
virtual bool boundBranch(BcpsModel *m) const
Return true if branches created by object will modify variable bounds.
AlpsReturnStatus encodeBcpsObject(AlpsEncoded *encoded) const
Pack Bcps part to a encode object.
BcpsVariable()
Default constructor.
virtual BcpsObject_t getObjType() const
virtual void resetBounds(BcpsModel *m)
Reset variable bounds to their original values.
BcpsObject & operator=(const BcpsObject &rhs)
Assignment operator.
BcpsObject * BcpsObject_p
BcpsObject_t
The possible types of an object: primal or dual (i.e., variable or constraint.
void setRepType(BcpsObjRep_t rt)
BcpsConstraint()
Default constructor.
int objectIndex_
Global index of this object.
BcpsBranchObject contains the member data required when choosing branching entities and excuting actu...
virtual ~BcpsVariable()
Destructor.
double effectiveness_
Effectiveness: nonnegative value.
BcpsValidRegion getValidRegion() const
virtual BcpsBranchObject * createBranchObject(BcpsModel *m, int way) const
Create a branching object and indicate which way to branch first.
BcpsObjRep_t repType_
Core, indexed, or algorithmic.
void setEffectiveness(double eff)
virtual double downEstimate() const
Return "down" estimate.
AlpsReturnStatus decodeBcpsObject(AlpsEncoded &encoded)
Unpack Bcps part from a encode object.
BcpsObjRep_t
The possible representations types of an object.
BcpsObjRep_t getRepType() const
BcpsValidRegion validRegion_
Valid in the whole tree or only the subtree rooted at the node that generate this object...
double lbHard_
The lower bound of the object when it was first created.