Cbc  2.9.9
CbcBranchDynamic.hpp
Go to the documentation of this file.
1 /* $Id: CbcBranchDynamic.hpp 1573 2011-01-05 01:12:36Z lou $ */
2 // Copyright (C) 2005, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 
6 #ifndef CbcBranchDynamic_H
7 #define CbcBranchDynamic_H
8 
9 #include "CoinPackedMatrix.hpp"
11 #include "CbcBranchActual.hpp"
12 
20 public:
21  // Default Constructor
23 
24  // Copy constructor
26 
28 
30  virtual CbcBranchDecision * clone() const;
31 
33  virtual void initialize(CbcModel * model);
34 
54  virtual int betterBranch(CbcBranchingObject * thisOne,
55  CbcBranchingObject * bestSoFar,
56  double changeUp, int numInfUp,
57  double changeDn, int numInfDn);
59  virtual void setBestCriterion(double value);
60  virtual double getBestCriterion() const;
63  virtual int whichMethod() {
64  return 3;
65  }
66 
69  virtual void saveBranchingObject(OsiBranchingObject * object) ;
72  virtual void updateInformation(OsiSolverInterface * solver,
73  const CbcNode * node);
74 
75 
76 private:
77 
79  CbcBranchDynamicDecision & operator=(const CbcBranchDynamicDecision& rhs);
80 
82 
84  double bestCriterion_;
85 
87  double bestChangeUp_;
88 
90  int bestNumberUp_;
91 
93  double bestChangeDown_;
94 
96  int bestNumberDown_;
97 
99  CbcBranchingObject * bestObject_;
100 };
112 
113 public:
114 
117 
126  int way , double value,
128 
137  double lowerValue, double upperValue) ;
138 
141 
144 
146  virtual CbcBranchingObject * clone() const;
147 
150 
152  void fillPart (int variable,
153  int way , double value,
155 
161  virtual double branch();
162 
167  virtual int fillStrongInfo( CbcStrongInfo & info);
168 
170  inline double changeInGuessed() const {
171  return changeInGuessed_;
172  }
174  inline void setChangeInGuessed(double value) {
175  changeInGuessed_ = value;
176  }
179  return object_;
180  }
183  object_ = object;
184  }
185 
187  virtual CbcBranchObjType type() const {
189  }
190 
191  // LL: compareOriginalObject and compareBranchingObject are inherited from
192  // CbcIntegerBranchingObject thus need not be declared/defined here. After
193  // all, this kind of branching object is simply using pseudocosts to make
194  // decisions, but once the decisions are made they are the same kind as in
195  // the underlying class.
196 
197 protected:
202 
203 };
204 
205 #endif
206 
CbcBranchingObject::way
int way() const
Get the state of the branching object.
Definition: CbcBranchingObject.hpp:154
CbcBranchingObject::variable
int variable() const
Index identifying the associated CbcObject within its class.
Definition: CbcBranchingObject.hpp:143
CbcSimpleIntegerDynamicPseudoCost
Define a single integer class but with dynamic pseudo costs.
Definition: CbcSimpleIntegerDynamicPseudoCost.hpp:35
CbcDynamicPseudoCostBranchingObject::fillPart
void fillPart(int variable, int way, double value, CbcSimpleIntegerDynamicPseudoCost *object)
Does part of constructor.
CbcBranchDynamicDecision::setBestCriterion
virtual void setBestCriterion(double value)
Sets or gets best criterion so far.
CbcDynamicPseudoCostBranchingObject
Simple branching object for an integer variable with pseudo costs.
Definition: CbcBranchDynamic.hpp:111
CbcDynamicPseudoCostBranchingObject::object_
CbcSimpleIntegerDynamicPseudoCost * object_
Pointer back to object.
Definition: CbcBranchDynamic.hpp:201
CbcBranchingObject::branch
virtual double branch()=0
Execute the actions required to branch, as specified by the current state of the branching object,...
CbcBranchDynamicDecision::CbcBranchDynamicDecision
CbcBranchDynamicDecision(const CbcBranchDynamicDecision &)
CbcSimpleIntegerDynamicPseudoCost.hpp
CbcBranchDynamicDecision::saveBranchingObject
virtual void saveBranchingObject(OsiBranchingObject *object)
Saves a clone of current branching object.
CbcBranchDynamicDecision::~CbcBranchDynamicDecision
virtual ~CbcBranchDynamicDecision()
CbcBranchDynamicDecision::CbcBranchDynamicDecision
CbcBranchDynamicDecision()
CbcDynamicPseudoCostBranchingObject::~CbcDynamicPseudoCostBranchingObject
virtual ~CbcDynamicPseudoCostBranchingObject()
Destructor.
CbcDynamicPseudoCostBranchingObject::setChangeInGuessed
void setChangeInGuessed(double value)
Set change in guessed.
Definition: CbcBranchDynamic.hpp:174
CbcDynamicPseudoCostBranchingObject::changeInGuessed_
double changeInGuessed_
Change in guessed objective value for next branch.
Definition: CbcBranchDynamic.hpp:199
CbcDynamicPseudoCostBranchingObject::CbcDynamicPseudoCostBranchingObject
CbcDynamicPseudoCostBranchingObject(CbcModel *model, int variable, int way, double lowerValue, double upperValue)
Create a degenerate branch object.
CbcModel
Simple Branch and bound class.
Definition: CbcModel.hpp:101
CbcBranchDynamicDecision::initialize
virtual void initialize(CbcModel *model)
Initialize, e.g. before the start of branch selection at a node.
CbcDynamicPseudoCostBranchingObject::changeInGuessed
double changeInGuessed() const
Change in guessed.
Definition: CbcBranchDynamic.hpp:170
CbcBranchDynamicDecision::updateInformation
virtual void updateInformation(OsiSolverInterface *solver, const CbcNode *node)
Pass in information on branch just done.
CbcDynamicPseudoCostBranchingObject::type
virtual CbcBranchObjType type() const
Return the type (an integer identifier) of this.
Definition: CbcBranchDynamic.hpp:187
CbcBranchingObject
Abstract branching object base class Now just difference with OsiBranchingObject.
Definition: CbcBranchingObject.hpp:53
CbcDynamicPseudoCostBranchingObject::operator=
CbcDynamicPseudoCostBranchingObject & operator=(const CbcDynamicPseudoCostBranchingObject &rhs)
Assignment operator.
CbcBranchDecision
Definition: CbcBranchDecision.hpp:28
CbcBranchDynamicDecision
Branching decision dynamic class.
Definition: CbcBranchDynamic.hpp:19
CbcDynamicPseudoCostBranchingObject::CbcDynamicPseudoCostBranchingObject
CbcDynamicPseudoCostBranchingObject(CbcModel *model, int variable, int way, double value, CbcSimpleIntegerDynamicPseudoCost *object)
Create a standard floor/ceiling branch object.
CbcIntegerBranchingObject
Simple branching object for an integer variable.
Definition: CbcSimpleInteger.hpp:23
CbcNode
Information required while the node is live.
Definition: CbcNode.hpp:49
CbcBranchDynamicDecision::whichMethod
virtual int whichMethod()
Says whether this method can handle both methods - 1 better, 2 best, 3 both.
Definition: CbcBranchDynamic.hpp:63
CbcDynamicPseudoCostBranchingObject::object
CbcSimpleIntegerDynamicPseudoCost * object() const
Return object.
Definition: CbcBranchDynamic.hpp:178
CbcStrongInfo
Abstract base class for ‘objects’.
Definition: CbcObject.hpp:51
CbcDynamicPseudoCostBranchingObject::CbcDynamicPseudoCostBranchingObject
CbcDynamicPseudoCostBranchingObject()
Default constructor.
CbcDynamicPseudoCostBranchingObject::setObject
void setObject(CbcSimpleIntegerDynamicPseudoCost *object)
Set object.
Definition: CbcBranchDynamic.hpp:182
CbcDynamicPseudoCostBranchingObject::CbcDynamicPseudoCostBranchingObject
CbcDynamicPseudoCostBranchingObject(const CbcDynamicPseudoCostBranchingObject &)
Copy constructor.
CbcBranchObjType
CbcBranchObjType
Definition: CbcBranchingObject.hpp:19
CbcBranchDynamicDecision::betterBranch
virtual int betterBranch(CbcBranchingObject *thisOne, CbcBranchingObject *bestSoFar, double changeUp, int numInfUp, double changeDn, int numInfDn)
Compare two branching objects.
CbcBranchingObject::model
CbcModel * model() const
Return model.
Definition: CbcBranchingObject.hpp:171
CbcBranchActual.hpp
CbcBranchDynamicDecision::getBestCriterion
virtual double getBestCriterion() const
DynamicPseudoCostBranchObj
@ DynamicPseudoCostBranchObj
Definition: CbcBranchingObject.hpp:32
CbcBranchDynamicDecision::clone
virtual CbcBranchDecision * clone() const
Clone.
CbcDynamicPseudoCostBranchingObject::branch
virtual double branch()
Sets the bounds for the variable according to the current arm of the branch and advances the object s...
CbcDynamicPseudoCostBranchingObject::fillStrongInfo
virtual int fillStrongInfo(CbcStrongInfo &info)
Some branchingObjects may claim to be able to skip strong branching.
CbcDynamicPseudoCostBranchingObject::clone
virtual CbcBranchingObject * clone() const
Clone.