Example: Black hole patience More...
Public Types |
Public Member Functions | |
BlackHole (const SizeOptions &opt) | |
Actual model. More... | |
virtual void | print (std::ostream &os) const |
Print instance and solution. More... | |
BlackHole (bool share, BlackHole &s) | |
Constructor for cloning s. More... | |
virtual Space * | copy (bool share) |
Copy during cloning. More... | |
![]() | |
ScriptBase (const Options &opt) | |
Constructor. More... | |
ScriptBase (bool share, ScriptBase &e) | |
Constructor used for cloning. More... | |
virtual void | compare (const Space &home, std::ostream &os) const |
Compare with s. More... | |
Static Public Member Functions | |
static int | val (const Space &, IntVar x, int) |
Value selection function for branching. More... | |
![]() | |
static std::ostream & | select_ostream (const char *name, std::ofstream &ofs) |
Choose output stream according to name. More... | |
template<class Script , template< class > class Engine, class Options > | |
static void | run (const Options &opt, Script *s=NULL) |
Protected Member Functions | |
std::string | card (int val) const |
Return a string representing the card of value val. More... | |
Protected Attributes | |
IntVarArray | x |
Card at position. More... | |
IntVarArray | y |
Position of card. More... | |
Related Functions | |
(Note that these are not member functions.) | |
int | main (int argc, char *argv[]) |
Main-function. More... | |
Example: Black hole patience
This example solves instances of the black-hole patience game.
The model of the problem is mostly taken from "Search in the Patience Game 'Black Hole'", by Ian P. Gent, Chris Jefferson, Tom Kelsey, InĂªs Lynce, Ian Miguel, Peter Nightingale, Barbara M. Smith, and S. Armagan Tarim.
The conditional symmetry identified in the above paper can be eliminated (enabled by default).
Definition at line 104 of file black-hole.cpp.
anonymous enum |
Symmetry variants.
Enumerator | |
---|---|
SYMMETRY_NONE |
No symmetry breaking. |
SYMMETRY_CONDITIONAL |
Breaking conditional symmetries. |
Definition at line 120 of file black-hole.cpp.
anonymous enum |
Propagation of placement-rules.
Enumerator | |
---|---|
PROPAGATION_REIFIED |
Reified propagation. |
PROPAGATION_DFA |
Extensional propagation using automatons. |
PROPAGATION_TUPLE_SET |
Extensional propagation using tables. |
Definition at line 125 of file black-hole.cpp.
|
inline |
Actual model.
Definition at line 131 of file black-hole.cpp.
|
inline |
Constructor for cloning s.
Definition at line 284 of file black-hole.cpp.
|
inlineprotected |
Return a string representing the card of value val.
Definition at line 111 of file black-hole.cpp.
Value selection function for branching.
Definition at line 244 of file black-hole.cpp.
|
inlinevirtual |
Print instance and solution.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 258 of file black-hole.cpp.
|
inlinevirtual |
Copy during cloning.
Definition at line 290 of file black-hole.cpp.
|
related |
Main-function.
Definition at line 299 of file black-hole.cpp.
|
protected |
Card at position.
Definition at line 106 of file black-hole.cpp.
|
protected |
Position of card.
Definition at line 106 of file black-hole.cpp.