8 #ifndef CbcSimpleIntegerDynamicPseudoCost_H 9 #define CbcSimpleIntegerDynamicPseudoCost_H 14 #define MINIMUM_MOVEMENT 0.1 20 #define WEIGHT_AFTER 0.8 21 #define WEIGHT_BEFORE 0.1 23 #define WEIGHT_PRODUCT 51 double downDynamicPseudoCost,
double upDynamicPseudoCost);
66 virtual double infeasibility(
const OsiBranchingInformation * info,
90 virtual void updateAfter(
const OsiObject * rhs,
const OsiObject * baseObject) ;
92 void updateAfterMini(
int numberDown,
int numberDownInfeasible,
double sumDown,
93 int numberUp,
int numberUpInfeasible,
double sumUp);
317 void print(
int type = 0,
double value = 0.0)
const;
408 int way ,
double value) ;
418 double lowerValue,
double upperValue) ;
437 virtual double branch();
441 return changeInGuessed_;
445 changeInGuessed_ = value;
468 #ifdef SWITCH_VARIABLES 480 CbcSwitchingBinary ();
484 int nOdd,
const int * other,
const int * otherRow);
488 CbcSwitchingBinary (
const CbcSwitchingBinary &);
494 CbcSwitchingBinary &
operator=(
const CbcSwitchingBinary& rhs);
497 virtual ~CbcSwitchingBinary ();
500 void addZeroSwitches(
int nAdd,
const int * columns);
502 virtual double infeasibility(
const OsiBranchingInformation * info,
506 bool same(
const CbcSwitchingBinary * obj)
const;
508 virtual int setAssociatedBounds(OsiSolverInterface * solver=NULL,
509 int cleanBasis=0)
const;
511 int checkAssociatedBounds(
const OsiSolverInterface * solver,
const double * solution,
512 int printLevel,
int state[3],
int & nBadFixed)
const;
514 inline const double * zeroLowerBound()
const 515 {
return zeroLowerBound_; }
517 inline const double * oneLowerBound()
const 518 {
return oneLowerBound_; }
520 inline const double * zeroUpperBound()
const 521 {
return zeroUpperBound_; }
523 inline const double * oneUpperBound()
const 524 {
return oneUpperBound_; }
527 inline const int * otherVariable()
const 528 {
return otherVariable_;}
530 inline int numberOther()
const 531 {
return numberOther_;}
537 inline int type()
const 543 double * zeroLowerBound_;
545 double * oneLowerBound_;
547 double * zeroUpperBound_;
549 double * oneUpperBound_;
552 int * otherVariable_;
Simple branching object for an integer variable.
void updateAfterMini(int numberDown, int numberDownInfeasible, double sumDown, int numberUp, int numberUpInfeasible, double sumUp)
Updates stuff like pseudocosts after mini branch and bound.
virtual void updateBefore(const OsiObject *rhs)
Updates stuff like pseudocosts before threads.
void incrementNumberTimesUp()
Increment up number times.
double sumUpChange() const
Up sum change.
void addToSumDownCost(double value)
Add to down sum cost and set last and square.
void print(int type=0, double value=0.0) const
Print - 0 -summary, 1 just before strong.
double upShadowPrice() const
Up pseudo shadow price cost.
virtual ~CbcSimpleIntegerDynamicPseudoCost()
double upShadowPrice_
Current pseudo-shadow price estimate up.
void setDownDynamicPseudoCost(double value)
Set down pseudo cost.
void setUpShadowPrice(double value)
Set up pseudo shadow price cost.
double downDynamicPseudoCost() const
Down pseudo cost.
int numberTimesUpInfeasible() const
Up number times infeasible.
void setNumberTimesDownInfeasible(int value)
Set down number times infeasible.
int numberBeforeTrust() const
Number of times before trusted.
void setSumDownCost(double value)
Set down sum cost.
void setSumUpCost(double value)
Set up sum cost.
void addToSumDownDecrease(double value)
Add to sum down decrease number infeasibilities from strong or actual.
int numberTimesDownInfeasible_
Number of times we have been infeasible going down.
void setUpDynamicPseudoCost(double value)
Set up pseudo cost.
double downShadowPrice() const
Down pseudo shadow price cost.
double sumUpDecrease_
Sum up decrease number infeasibilities from strong or actual.
void setNumberBeforeTrust(int value)
Set number of times before trusted.
int numberTimesDown_
Number of times we have gone down.
void incrementNumberBeforeTrust()
Increment number of times before trusted.
void addToSumUpDecrease(double value)
Add to sum up decrease number infeasibilities from strong or actual.
double numberTimesDownTotalFixed_
Number of total probing fixings going down.
void incrementNumberTimesDown()
Increment down number times.
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
int method_
Number of times infeasible when tested.
virtual CbcBranchingObject * createCbcBranch(OsiSolverInterface *solver, const OsiBranchingInformation *info, int way)
Creates a branching object.
Define a single integer class but with dynamic pseudo costs.
virtual double upEstimate() const
Return "up" estimate.
double sumUpCost() const
Up sum cost.
virtual OsiSolverBranch * solverBranch() const
Create an OsiSolverBranch object.
int numberTimesUp_
Number of times we have gone up.
virtual void updateInformation(const CbcObjectUpdateData &data)
Update object by CbcObjectUpdateData.
int numberTimesDownLocalFixed_
Number of local probing fixings going down.
int numberTimesDownInfeasible() const
Down number times infeasible.
void setUpDownSeparator(double value)
Set up down separator.
Define a single integer class.
double sumUpDecrease() const
Sum up decrease number infeasibilities from strong or actual.
int numberTimesProbingTotal_
Number of times probing done.
double downShadowPrice_
Current pseudo-shadow price estimate down.
double changeInGuessed() const
Change in guessed.
void addToSumUpChange(double value)
Add to up sum change and set last and square.
double sumDownDecrease_
Sum down decrease number infeasibilities from strong or actual.
int numberTimesBranched() const
Number times branched.
void setSumUpChange(double value)
Set up sum change.
double sumUpCost_
Sum up cost from strong or actual.
void updateUpDynamicPseudoCost(double value)
Modify up pseudo cost in a slightly different way.
int numberTimesDown() const
Down number times.
double sumUpChange_
Sum of all changes to x when going up.
double sumDownChange_
Sum of all changes to x when going down.
virtual CbcObject * clone() const
Clone.
void setProbingInformation(int fixedDown, int fixedUp)
Pass in probing information.
void addToSumDownChange(double value)
Add to down sum change.
void incrementNumberTimesUpInfeasible()
Increment up number times infeasible.
CbcSimpleIntegerDynamicPseudoCost()
Abstract branching object base class Now just difference with OsiBranchingObject. ...
double upDownSeparator() const
Up down separator.
double sumDownCost_
Sum down cost from strong or actual.
int method() const
method - see below for details
double upDynamicPseudoCost_
Up pseudo cost.
void setMethod(int value)
Set method.
double downDynamicPseudoCost_
data
Information required while the node is live.
CbcSimpleIntegerDynamicPseudoCost & operator=(const CbcSimpleIntegerDynamicPseudoCost &rhs)
void setSumUpDecrease(double value)
Set sum up decrease number infeasibilities from strong or actual.
void setUpInformation(double changeObjectiveUp, int changeInfeasibilityUp)
Pass in information on a up branch.
void setNumberTimesDown(int value)
Set down number times.
int lastUpDecrease_
Last up decrease number infeasibilities from strong (i.e. as computed by last strong) ...
int numberBeforeTrust_
Number of branches before we trust.
CbcModel * model() const
Return model.
virtual double branch()=0
Execute the actions required to branch, as specified by the current state of the branching object...
void copySome(const CbcSimpleIntegerDynamicPseudoCost *otherObject)
Copy some information i.e. just variable stuff.
void setNumberTimesUpInfeasible(int value)
Set up number times infeasible.
void setDownInformation(double changeObjectiveDown, int changeInfeasibilityDown)
Pass in information on a down branch.
void setSumDownDecrease(double value)
Set sum down decrease number infeasibilities from strong or actual.
void addToSumUpCost(double value)
Add to up sum cost and set last and square.
double changeInGuessed_
Change in guessed objective value for next branch.
void setChangeInGuessed(double value)
Set change in guessed.
double breakEven() const
Breakeven e.g 0.7 -> >= 0.7 go up first.
double numberTimesUpTotalFixed_
Number of total probing fixings going up.
void incrementNumberTimesDownInfeasible()
Increment down number times infeasible.
void setNumberTimesUp(int value)
Set up number times.
double upDownSeparator_
Up/down separator If >0.0 then do first branch up if value-floor(value) >= this value.
Simple branching object for an integer variable with pseudo costs.
bool same(const CbcSimpleIntegerDynamicPseudoCost *obj) const
Same - returns true if contents match(ish)
int numberTimesUpLocalFixed_
Number of local probing fixings going up.
virtual CbcObjectUpdateData createUpdateInformation(const OsiSolverInterface *solver, const CbcNode *node, const CbcBranchingObject *branchingObject)
Fills in a created branching object.
int lastDownDecrease_
Last down decrease number infeasibilities from strong (i.e. as computed by last strong) ...
void setSumDownChange(double value)
Set down sum change.
int numberTimesUp() const
Up number times.
void setDownShadowPrice(double value)
Set down pseudo shadow price cost.
virtual OsiSolverBranch * solverBranch() const
Create an OsiSolverBranch object.
virtual void updateAfter(const OsiObject *rhs, const OsiObject *baseObject)
Updates stuff like pseudocosts after threads finished.
double lastUpCost_
Last up cost from strong (i.e. as computed by last strong)
virtual double infeasibility(const OsiBranchingInformation *info, int &preferredWay) const
Infeasibility - large is 0.5.
double sumDownDecrease() const
Sum down decrease number infeasibilities from strong or actual.
Simple Branch and bound class.
int numberTimesUpInfeasible_
Number of times we have been infeasible going up.
virtual double downEstimate() const
Return "down" estimate (default 1.0e-5)
double sumDownChange() const
Down sum change.
double sumDownCost() const
Down sum cost.
int preferredWay() const
If -1 down always chosen first, +1 up always, 0 normal.
double lastDownCost_
Last down cost from strong (i.e. as computed by last strong)
double upDynamicPseudoCost() const
Up pseudo cost.
void updateDownDynamicPseudoCost(double value)
Modify down pseudo cost in a slightly different way.