#include <SbbBranchBase.hpp>
Inheritance diagram for SbbBranchingObject:
Public Member Functions | |
SbbBranchingObject () | |
Default Constructor. | |
SbbBranchingObject (SbbModel *model, int variable, int way, double value) | |
Constructor. | |
SbbBranchingObject (const SbbBranchingObject &) | |
Copy constructor. | |
SbbBranchingObject & | operator= (const SbbBranchingObject &rhs) |
Assignment operator. | |
virtual SbbBranchingObject * | clone () const=0 |
Clone. | |
virtual | ~SbbBranchingObject () |
Destructor. | |
virtual int | numberBranches () const |
virtual int | numberBranchesLeft () const |
The number of branch arms left to be evaluated. | |
virtual void | branch ()=0 |
Execute the actions required to branch, as specified by the current state of the branching object, and advance the object's state. | |
int | variable () const |
Index identifying the associated SbbObject within its class. | |
int | way () const |
void | way (int way) |
double | value () const |
Current value. | |
SbbModel * | model () const |
Return model. | |
Protected Attributes | |
SbbModel * | model_ |
The model that owns this branching object. | |
int | variable_ |
Branching variable (0 is first integer). | |
int | way_ |
double | value_ |
Current value. | |
int | numberBranchesLeft_ |
In the abstract, an SbbBranchingObject contains instructions for how to branch. We want an abstract class so that we can describe how to branch on simple objects (e.g., integers) and more exotic objects (e.g., cliques or hyperplanes).
The branch() method is the crucial routine: it is expected to be able to step through a set of branch arms, executing the actions required to create each subproblem in turn. The base class is primarily virtual to allow for a wide range of problem modifications.
See SbbObject for an overview of the three classes (SbbObject, SbbBranchingObject, and SbbBranchDecision) which make up sbb's branching model.
Definition at line 159 of file SbbBranchBase.hpp.
|
The number of branch arms created for this branching object
Definition at line 186 of file SbbBranchBase.hpp. Referenced by SbbNode::initializeInfo(), and SbbNode::numberBranches().
00187 {return 2;};
|
|
Index identifying the associated SbbObject within its class. The name is misleading, and typically the index will not refer directly to a variable. Rather, it identifies an SbbObject within the class of similar SbbObjects E.g., for an SbbSimpleInteger, variable() is the index of the integer variable in the set of integer variables (not the index of the variable in the set of all variables). Definition at line 210 of file SbbBranchBase.hpp. References variable_. Referenced by SbbNode::variable().
00211 {return variable_;}; |
|
Set the state of the branching object. See way() Definition at line 227 of file SbbBranchBase.hpp. References way_.
00228 {way_=way;}; |
|
Get the state of the branching object Returns a code indicating the active arm of the branching object. The precise meaning is defined in the derived class.
Definition at line 220 of file SbbBranchBase.hpp. References way_. Referenced by SbbBranchDecision::bestBranch(), and SbbNode::chooseBranch().
00221 {return way_;}; |
|
Number of arms remaining to be evaluated
Definition at line 263 of file SbbBranchBase.hpp. Referenced by numberBranchesLeft(), operator=(), and SbbBranchingObject(). |
|
The state of the branching object. Specifies the active arm of the branching object. Coded as -1 to take the `down' arm, +1 for the `up' arm. `Down' and `up' are defined based on the natural meaning (floor and ceiling, respectively) for a simple integer. The precise meaning is defined in the derived class. Definition at line 253 of file SbbBranchBase.hpp. Referenced by operator=(), SbbBranchingObject(), and way(). |