Example: Black hole patience More...
Public Types | |
enum | { SYMMETRY_NONE, SYMMETRY_CONDITIONAL } |
Symmetry variants. More... | |
enum | { PROPAGATION_REIFIED, PROPAGATION_DFA, PROPAGATION_TUPLE_SET } |
Propagation of placement-rules. More... | |
Public Member Functions | |
BlackHole (const SizeOptions &opt) | |
Actual model. | |
virtual void | print (std::ostream &os) const |
Print instance and solution. | |
BlackHole (bool share, BlackHole &s) | |
Constructor for cloning s. | |
virtual Space * | copy (bool share) |
Copy during cloning. | |
Static Public Member Functions | |
static int | val (const Space &, IntVar x, int) |
Value selection function for branching. | |
Protected Member Functions | |
std::string | card (int val) const |
Return a string representing the card of value val. | |
Static Protected Attributes | |
IntVarArray | x |
Card at position. | |
IntVarArray | y |
Position of card. | |
Related Functions | |
(Note that these are not member functions.) | |
int | main (int argc, char *argv[]) |
Main-function. |
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.
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.
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.
BlackHole::BlackHole | ( | const SizeOptions & | opt | ) | [inline] |
Actual model.
Definition at line 131 of file black-hole.cpp.
BlackHole::BlackHole | ( | bool | share, |
BlackHole & | s | ||
) | [inline] |
Constructor for cloning s.
Definition at line 285 of file black-hole.cpp.
std::string BlackHole::card | ( | int | val | ) | const [inline, protected] |
Return a string representing the card of value val.
Definition at line 111 of file black-hole.cpp.
static int BlackHole::val | ( | const Space & | , |
IntVar | x, | ||
int | |||
) | [inline, static] |
Value selection function for branching.
Definition at line 245 of file black-hole.cpp.
virtual void BlackHole::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print instance and solution.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 259 of file black-hole.cpp.
virtual Space* BlackHole::copy | ( | bool | share | ) | [inline, virtual] |
Copy during cloning.
Definition at line 291 of file black-hole.cpp.
int main | ( | int | argc, |
char * | argv[] | ||
) | [related] |
Main-function.
Definition at line 300 of file black-hole.cpp.
IntVarArray BlackHole::x [static, protected] |
Card at position.
Definition at line 106 of file black-hole.cpp.
IntVarArray BlackHole::y [static, protected] |
Position of card.
Definition at line 106 of file black-hole.cpp.