Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0

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 (BlackHole &s)
 Constructor for cloning s.
 
virtual Spacecopy (void)
 Copy during cloning.
 
- Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
 ScriptBase (const Options &opt)
 Constructor.
 
 ScriptBase (ScriptBase &e)
 Constructor used for cloning.
 
virtual void compare (const Space &home, std::ostream &os) const
 Compare with s.
 

Static Public Member Functions

static int val (const Space &, IntVar x, int)
 Value selection function for branching.
 
- Static Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
static std::ostream & select_ostream (const char *sn, std::ofstream &ofs)
 Choose output stream according to sn.
 
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.
 

Protected Attributes

IntVarArray x
 Card at position.
 
IntVarArray y
 Position of card.
 

Related Symbols

(Note that these are not member symbols.)

int main (int argc, char *argv[])
 Main-function.
 

Detailed Description

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 100 of file black-hole.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Symmetry variants.

Enumerator
SYMMETRY_NONE 

No symmetry breaking.

SYMMETRY_CONDITIONAL 

Breaking conditional symmetries.

Definition at line 116 of file black-hole.cpp.

◆ anonymous enum

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 121 of file black-hole.cpp.

Constructor & Destructor Documentation

◆ BlackHole() [1/2]

BlackHole::BlackHole ( const SizeOptions & opt)
inline

Actual model.

Definition at line 127 of file black-hole.cpp.

◆ BlackHole() [2/2]

BlackHole::BlackHole ( BlackHole & s)
inline

Constructor for cloning s.

Definition at line 279 of file black-hole.cpp.

Member Function Documentation

◆ card()

std::string BlackHole::card ( int val) const
inlineprotected

Return a string representing the card of value val.

Definition at line 107 of file black-hole.cpp.

◆ val()

static int BlackHole::val ( const Space & ,
IntVar x,
int  )
inlinestatic

Value selection function for branching.

Definition at line 239 of file black-hole.cpp.

◆ print()

virtual void BlackHole::print ( std::ostream & os) const
inlinevirtual

Print instance and solution.

Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.

Definition at line 253 of file black-hole.cpp.

◆ copy()

virtual Space * BlackHole::copy ( void )
inlinevirtual

Copy during cloning.

Definition at line 285 of file black-hole.cpp.

Friends And Related Symbol Documentation

◆ main()

int main ( int argc,
char * argv[] )
related

Main-function.

Definition at line 294 of file black-hole.cpp.

Member Data Documentation

◆ x

IntVarArray BlackHole::x
protected

Card at position.

Definition at line 102 of file black-hole.cpp.

◆ y

IntVarArray BlackHole::y
protected

Position of card.

Definition at line 103 of file black-hole.cpp.


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