Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

SbbBranchDecision Class Reference

#include <SbbBranchBase.hpp>

Inheritance diagram for SbbBranchDecision:

SbbBranchDefaultDecision SbbBranchUserDecision List of all members.

Public Member Functions

 SbbBranchDecision ()
 Default Constructor.

virtual ~SbbBranchDecision ()
 Destructor.

virtual SbbBranchDecisionclone () 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

SbbBranchDecisionoperator= (const SbbBranchDecision &rhs)
 Assignment is illegal.


Detailed Description

Abstract branching decision base class

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.


Member Function Documentation

int SbbBranchDecision::bestBranch SbbBranchingObject **  objects,
int  numberObjects,
int  numberUnsatisfied,
double *  changeUp,
int *  numberInfeasibilitiesUp,
double *  changeDown,
int *  numberInfeasibilitiesDown,
double  objectiveValue
[virtual]
 

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 }

virtual int SbbBranchDecision::betterBranch SbbBranchingObject thisOne,
SbbBranchingObject bestSoFar,
double  changeUp,
int  numberInfeasibilitiesUp,
double  changeDown,
int  numberInfeasibilitiesDown
[pure virtual]
 

Compare two branching objects. Return nonzero if branching using thisOne is better than branching using bestSoFar.

If bestSoFar is NULL, the routine should return a nonzero value. This routine is used only after strong branching.

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().


The documentation for this class was generated from the following files:
Generated on Wed Dec 3 14:36:22 2003 for Sbb by doxygen 1.3.5