#include <SbbBranchBase.hpp>
Inheritance diagram for SbbBranchDecision:
Public Member Functions | |
SbbBranchDecision () | |
Default Constructor. | |
virtual | ~SbbBranchDecision () |
Destructor. | |
virtual SbbBranchDecision * | clone () const=0 |
Clone. | |
virtual void | initialize (SbbModel *model)=0 |
Initialize e.g. before starting to choose a branch at a node. | |
virtual int | betterBranch (SbbBranchingObject *thisOne, SbbBranchingObject *bestSoFar, double changeUp, int numberInfeasibilitiesUp, double changeDown, int numberInfeasibilitiesDown)=0 |
Compare two branching objects. Return nonzero if branching using thisOne is better than branching using bestSoFar . | |
virtual int | bestBranch (SbbBranchingObject **objects, int numberObjects, int numberUnsatisfied, double *changeUp, int *numberInfeasibilitiesUp, double *changeDown, int *numberInfeasibilitiesDown, double objectiveValue) |
Compare N branching objects. Return index of best and sets way of branching in chosen object. | |
Private Member Functions | |
SbbBranchDecision & | operator= (const SbbBranchDecision &rhs) |
Assignment is illegal. |
In the abstract, an SbbBranchDecision object is expected to be able to compare two possible branching choices.
The betterBranch() method is the crucial routine. It is expected to be able to compare two SbbBranchingObjects .
See SbbObject for an overview of the three classes (SbbObject, SbbBranchingObject, and SbbBranchDecision) which make up sbb's branching model.
Definition at line 281 of file SbbBranchBase.hpp.
|
Compare N branching objects. Return index of best and sets way of branching in chosen object. This routine is used only after strong branching. This is reccommended version as it can be more sophisticated Reimplemented in SbbBranchUserDecision. Definition at line 121 of file SbbBranchBase.cpp. References betterBranch(), initialize(), and SbbBranchingObject::way(). Referenced by SbbNode::chooseBranch().
00126 { 00127 int bestWay=0; 00128 int whichObject = -1; 00129 if (numberObjects) { 00130 initialize(objects[0]->model()); 00131 SbbBranchingObject * bestObject = NULL; 00132 for (int i = 0 ; i < numberObjects ; i++) { 00133 int betterWay = betterBranch(objects[i], 00134 bestObject, 00135 changeUp[i], 00136 numberInfeasibilitiesUp [i], 00137 changeDown[i], 00138 numberInfeasibilitiesDown[i] ); 00139 if (betterWay) { 00140 bestObject = objects[i]; 00141 bestWay = betterWay; 00142 whichObject=i; 00143 } 00144 } 00145 // set way in best 00146 bestObject->way(bestWay); 00147 } 00148 return whichObject; 00149 } |
|
Compare two branching objects. Return nonzero if branching using
If It is now reccommended that bestBranch is used - see below. This has been left for compatibility. Implemented in SbbBranchDefaultDecision, and SbbBranchUserDecision. Referenced by bestBranch(), and SbbNode::chooseBranch(). |