Base-class for branchers. More...
#include <core.hpp>
Protected Member Functions | |
Brancher (Home home) | |
Constructor for creation. More... | |
Brancher (Space &home, bool share, Brancher &b) | |
Constructor for cloning b. More... | |
Brancher | |
virtual bool | status (const Space &home) const =0 |
Check status of brancher, return true if alternatives left. More... | |
virtual const Choice * | choice (Space &home)=0 |
Return choice. More... | |
virtual const Choice * | choice (const Space &home, Archive &e)=0 |
Return choice from e. More... | |
virtual ExecStatus | commit (Space &home, const Choice &c, unsigned int a)=0 |
Commit for choice c and alternative a. More... | |
unsigned int | id (void) const |
Return unsigned brancher id. More... | |
Additional Inherited Members | |
![]() | |
virtual Actor * | copy (Space &home, bool share)=0 |
Create copy. More... | |
virtual size_t | allocated (void) const |
Report size occupied by additionally datastructures. More... | |
virtual size_t | dispose (Space &home) |
Delete actor and return its size. More... | |
![]() | |
static void * | operator new (size_t s, Space &home) |
Allocate memory from space. More... | |
static void | operator delete (void *p, Space &home) |
No-op for exceptions. More... | |
Base-class for branchers.
Note that branchers cannot be created inside a propagator (no idea why one would like to do that anyway). If you do that the system will explode in a truly interesting way.
|
inlineprotected |
|
pure virtual |
Check status of brancher, return true if alternatives left.
This method is called when Space::status is called, it determines whether to continue branching with this brancher or move on to the (possibly) next brancher.
Implemented in SteelMill::SteelMillBranch, CDBF, Radiotherapy::NestedSearch, QueenArmies::QueenBranch, BlackHoleBranch, Warnsdorff, Gecode::ViewBrancher< ViewSel >, Gecode::FunctionBranch, and Gecode::Gist::StopBrancher.
Return choice.
Note that this method relies on the fact that it is called immediately after a previous call to status. Moreover, the member function can only be called once.
Implemented in SteelMill::SteelMillBranch, Radiotherapy::NestedSearch, CDBF, Gecode::Int::Branch::ViewValuesBrancher< ViewSel, View >, QueenArmies::QueenBranch, BlackHoleBranch, Gecode::ViewValBrancher< ViewSel, ValSel >, Warnsdorff, Gecode::FunctionBranch, and Gecode::Gist::StopBrancher.
Return choice from e.
Implemented in SteelMill::SteelMillBranch, CDBF, Radiotherapy::NestedSearch, Gecode::Int::Branch::ViewValuesBrancher< ViewSel, View >, QueenArmies::QueenBranch, BlackHoleBranch, Gecode::ViewValBrancher< ViewSel, ValSel >, Warnsdorff, Gecode::FunctionBranch, and Gecode::Gist::StopBrancher.
|
pure virtual |
Commit for choice c and alternative a.
The current brancher in the space home performs a commit from the information provided by the choice c and the alternative a.
Implemented in SteelMill::SteelMillBranch, CDBF, Radiotherapy::NestedSearch, QueenArmies::QueenBranch, Gecode::Int::Branch::ViewValuesBrancher< ViewSel, View >, BlackHoleBranch, Warnsdorff, Gecode::ViewValBrancher< ViewSel, ValSel >, Gecode::FunctionBranch, and Gecode::Gist::StopBrancher.
|
inline |