Base-class for branchers. More...
#include <core.hpp>
Protected Member Functions | |
Brancher (Home home) | |
Constructor for creation. | |
Brancher (Space &home, bool share, Brancher &b) | |
Constructor for cloning b. | |
Brancher | |
unsigned int | id (void) const |
Return unsigned brancher id. | |
virtual bool | status (const Space &home) const =0 |
Check status of brancher, return true if alternatives left. | |
virtual const Choice * | choice (Space &home)=0 |
Return choice. | |
virtual const Choice * | choice (const Space &home, Archive &e)=0 |
Return choice from e. | |
virtual ExecStatus | commit (Space &home, const Choice &c, unsigned int a)=0 |
Commit for choice c and alternative a. | |
virtual NGL * | ngl (Space &home, const Choice &c, unsigned int a) const |
Create no-good literal for choice c and alternative a. | |
virtual void | print (const Space &home, const Choice &c, unsigned int a, std::ostream &o) const |
Print branch for choice c and alternative a. |
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.
Gecode::Brancher::Brancher | ( | Home | home | ) | [inline, protected] |
Gecode::Brancher::Brancher | ( | Space & | home, |
bool | share, | ||
Brancher & | b | ||
) | [inline, protected] |
unsigned int Gecode::Brancher::id | ( | void | ) | const [inline] |
virtual bool Gecode::Brancher::status | ( | const Space & | home | ) | const [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, Gecode::FlatZinc::AuxVarBrancher, Gecode::ViewBrancher< View, n >, Gecode::ViewBrancher< IntView, n >, Warnsdorff, Gecode::FunctionBranch, and Gecode::Gist::StopBrancher.
virtual const Choice* Gecode::Brancher::choice | ( | Space & | home | ) | [pure virtual] |
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 Gecode::Int::Branch::ViewValuesBrancher< n, min >, SteelMill::SteelMillBranch, Gecode::Int::LDSB::LDSBBrancher< View, n, Val, a >, Radiotherapy::NestedSearch, CDBF, QueenArmies::QueenBranch, Gecode::FlatZinc::AuxVarBrancher, Gecode::ViewValBrancher< View, n, Val, a >, Warnsdorff, Gecode::Set::LDSB::LDSBSetBrancher< View, n, Val, a >, Gecode::FunctionBranch, and Gecode::Gist::StopBrancher.
virtual const Choice* Gecode::Brancher::choice | ( | const Space & | home, |
Archive & | e | ||
) | [pure virtual] |
Return choice from e.
Implemented in Gecode::Int::Branch::ViewValuesBrancher< n, min >, SteelMill::SteelMillBranch, Gecode::Int::LDSB::LDSBBrancher< View, n, Val, a >, CDBF, Radiotherapy::NestedSearch, QueenArmies::QueenBranch, Gecode::FlatZinc::AuxVarBrancher, Warnsdorff, Gecode::ViewValBrancher< View, n, Val, a >, Gecode::FunctionBranch, and Gecode::Gist::StopBrancher.
virtual ExecStatus Gecode::Brancher::commit | ( | Space & | home, |
const Choice & | c, | ||
unsigned int | a | ||
) | [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 Gecode::Int::Branch::ViewValuesBrancher< n, min >, SteelMill::SteelMillBranch, Gecode::Int::LDSB::LDSBBrancher< View, n, Val, a >, CDBF, Radiotherapy::NestedSearch, QueenArmies::QueenBranch, Gecode::FlatZinc::AuxVarBrancher, Warnsdorff, Gecode::ViewValBrancher< View, n, Val, a >, Gecode::Set::LDSB::LDSBSetBrancher< View, n, Val, a >, Gecode::FunctionBranch, and Gecode::Gist::StopBrancher.
NGL * Gecode::Brancher::ngl | ( | Space & | home, |
const Choice & | c, | ||
unsigned int | a | ||
) | const [virtual] |
Create no-good literal for choice c and alternative a.
The current brancher in the space home creates a no-good literal from the information provided by the choice c and the alternative a. The brancher has the following options:
Reimplemented in Gecode::Int::Branch::ViewValuesBrancher< n, min >, and Gecode::ViewValBrancher< View, n, Val, a >.
void Gecode::Brancher::print | ( | const Space & | home, |
const Choice & | c, | ||
unsigned int | a, | ||
std::ostream & | o | ||
) | const [virtual] |
Print branch for choice c and alternative a.
Prints an explanation of the alternative a of choice c on the stream o.
The default function prints nothing.
Reimplemented in Gecode::Int::Branch::ViewValuesBrancher< n, min >, SteelMill::SteelMillBranch, CDBF, Radiotherapy::NestedSearch, QueenArmies::QueenBranch, Gecode::FlatZinc::AuxVarBrancher, Warnsdorff, Gecode::ViewValBrancher< View, n, Val, a >, Gecode::FunctionBranch, and Gecode::Gist::StopBrancher.