Generated on Mon Aug 25 11:35:49 2008 for Gecode by doxygen 1.5.6

Gecode::ViewValBranching< View, Val, ViewSel, ValSel > Class Template Reference
[Generic branching based on view and value selection]

Inherits Gecode::Branching.

List of all members.


Detailed Description

template<class View, class Val, class ViewSel, class ValSel>
class Gecode::ViewValBranching< View, Val, ViewSel, ValSel >

Generic branching.

Implements view-based branching for an array of views (of type View) and value (of type Val). The behaviour is defined by the class ViewSel (which view is selected for branching) and the class ValSel (which value is selected for branching).

The class ViewSel must implement two member functions:

  • Gecode::ViewSelStatus init(const Space* home, View x) Initializes view selection with the View x. If x is known to be a best one, VSS_COMMIT should be returned. Otherwise, either VSS_NONE or VSS_SELECT should be returned.
  • Gecode::ViewSelStatus select(const Space* home, View x) If x is not better than the previously selected view, return VSS_NONE. If it is better, return VSS_SELECT. If it is a best view, return VSS_COMMIT.

The class ValSel must implement two member functions:

  • Val val(const Space* home, View x) const returns the value (most likely determined by x) to branch with.
  • Gecode::ModEvent tell(Space* home, unsigned int a, View x, Val n) performs a tell for alternative a on x with value n.

For examples, see integer branchings .

Definition at line 84 of file branching.icc.


Public Member Functions

 ViewValBranching (Space *home, ViewArray< View > &x)
 Constructor for creation.
virtual bool status (const Space *home) const
 Check status of branching, return true if alternatives left.
virtual const BranchingDescdescription (const Space *home) const
 Return branching description (of type Gecode::PosValDesc).
virtual ExecStatus commit (Space *home, const BranchingDesc *d, unsigned int a)
 Perform commit for branching description d and alternative a.
virtual Reflection::ActorSpec spec (const Space *home, Reflection::VarMap &m) const
 Return specification for this branching given a variable map m.
virtual Reflection::BranchingSpec branchingSpec (const Space *home, Reflection::VarMap &m, const BranchingDesc *d) const
 Return specification for a branch.
virtual Actorcopy (Space *home, bool share)
 Perform cloning.

Static Public Member Functions

static Support::Symbol ati (void)
 Actor type identifier of this branching.
static void post (Space *home, Reflection::VarMap &m, const Reflection::ActorSpec &spec)
 Post branching according to specification.

Protected Member Functions

 ViewValBranching (Space *home, bool share, ViewValBranching &b)

Protected Attributes

ViewArray< View > x
 Views to branch on.
int start
 Unassigned views start at x[start] Constructor for cloning b.

Constructor & Destructor Documentation

template<class View, class Val, class ViewSel, class ValSel>
Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::ViewValBranching ( Space home,
bool  share,
ViewValBranching< View, Val, ViewSel, ValSel > &  b 
) [inline, protected]

Definition at line 247 of file branching.icc.

template<class View, class Val, class ViewSel, class ValSel>
Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::ViewValBranching ( Space home,
ViewArray< View > &  x 
) [inline]

Constructor for creation.

Definition at line 240 of file branching.icc.


Member Function Documentation

template<class View, class Val, class ViewSel, class ValSel>
bool Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::status ( const Space home  )  const [inline, virtual]

Check status of branching, return true if alternatives left.

Implements Gecode::Branching.

Definition at line 262 of file branching.icc.

template<class View, class Val, class ViewSel, class ValSel>
const BranchingDesc * Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::description ( const Space home  )  const [inline, virtual]

Return branching description (of type Gecode::PosValDesc).

Implements Gecode::Branching.

Definition at line 274 of file branching.icc.

template<class View, class Val, class ViewSel, class ValSel>
ExecStatus Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::commit ( Space home,
const BranchingDesc d,
unsigned int  a 
) [inline, virtual]

Perform commit for branching description d and alternative a.

Implements Gecode::Branching.

Definition at line 296 of file branching.icc.

template<class View, class Val, class ViewSel, class ValSel>
Reflection::ActorSpec Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::spec ( const Space home,
Reflection::VarMap m 
) const [inline, virtual]

Return specification for this branching given a variable map m.

Reimplemented from Gecode::Actor.

Definition at line 321 of file branching.icc.

template<class View, class Val, class ViewSel, class ValSel>
Reflection::BranchingSpec Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::branchingSpec ( const Space home,
Reflection::VarMap m,
const BranchingDesc d 
) const [inline, virtual]

Return specification for a branch.

Reimplemented from Gecode::Branching.

Definition at line 329 of file branching.icc.

template<class View, class Val, class ViewSel, class ValSel>
Support::Symbol Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::ati ( void   )  [inline, static]

Actor type identifier of this branching.

Definition at line 305 of file branching.icc.

template<class View, class Val, class ViewSel, class ValSel>
void Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::post ( Space home,
Reflection::VarMap m,
const Reflection::ActorSpec spec 
) [inline, static]

Post branching according to specification.

Definition at line 312 of file branching.icc.

template<class View, class Val, class ViewSel, class ValSel>
Actor * Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::copy ( Space home,
bool  share 
) [inline, virtual]

Perform cloning.

Implements Gecode::Actor.

Definition at line 254 of file branching.icc.


Member Data Documentation

template<class View, class Val, class ViewSel, class ValSel>
ViewArray<View> Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::x [protected]

Views to branch on.

Definition at line 86 of file branching.icc.

template<class View, class Val, class ViewSel, class ValSel>
int Gecode::ViewValBranching< View, Val, ViewSel, ValSel >::start [mutable, protected]

Unassigned views start at x[start] Constructor for cloning b.

Definition at line 87 of file branching.icc.


The documentation for this class was generated from the following file: