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

SbbBranchingObject Class Reference

Abstract branching object base class. More...

#include <SbbBranchBase.hpp>

Inheritance diagram for SbbBranchingObject:

SbbCliqueBranchingObject SbbIntegerBranchingObject SbbLongCliqueBranchingObject List of all members.

Public Member Functions

 SbbBranchingObject ()
 Default Constructor.

 SbbBranchingObject (SbbModel *model, int variable, int way, double value)
 Constructor.

 SbbBranchingObject (const SbbBranchingObject &)
 Copy constructor.

SbbBranchingObjectoperator= (const SbbBranchingObject &rhs)
 Assignment operator.

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

SbbModelmodel () const
 Return model.


Protected Attributes

SbbModelmodel_
 The model that owns this branching object.

int variable_
 Branching variable (0 is first integer).

int way_
double value_
 Current value.

int numberBranchesLeft_

Detailed Description

Abstract branching object base class.

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.


Member Function Documentation

virtual int SbbBranchingObject::numberBranches  )  const [inline, virtual]
 

The number of branch arms created for this branching object

Todo:
The hardwired `2' has to be changed before sbb can do branches with more than two arms.

Definition at line 186 of file SbbBranchBase.hpp.

Referenced by SbbNode::initializeInfo(), and SbbNode::numberBranches().

00187   {return 2;};

int SbbBranchingObject::variable  )  const [inline]
 

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_;};

void SbbBranchingObject::way int  way  )  [inline]
 

Set the state of the branching object.

See way()

Definition at line 227 of file SbbBranchBase.hpp.

References way_.

00228   {way_=way;};

int SbbBranchingObject::way  )  const [inline]
 

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.

See also:
way_

Definition at line 220 of file SbbBranchBase.hpp.

References way_.

Referenced by SbbBranchDecision::bestBranch(), and SbbNode::chooseBranch().

00221   {return way_;};


Member Data Documentation

int SbbBranchingObject::numberBranchesLeft_ [protected]
 

Number of arms remaining to be evaluated

Todo:
Compare with SbbNodeInfo::numberBranchesLeft_, and check for redundancy.

Definition at line 263 of file SbbBranchBase.hpp.

Referenced by numberBranchesLeft(), operator=(), and SbbBranchingObject().

int SbbBranchingObject::way_ [protected]
 

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


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