Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0

Example: n-Knight's tour (simple model) More...

Public Member Functions

 KnightsReified (const SizeOptions &opt)
 KnightsReified (KnightsReified &s)
 Constructor for cloning s.
virtual Spacecopy (void)
 Copy during cloning.
Public Member Functions inherited from Knights
int f (int x, int y) const
 Return field at position x, y.
int x (int f) const
 Return x coordinate at field f.
int y (int f) const
 Return y coordinate at field f.
IntSet neighbors (int i)
 Compute set of neighbour fields.
 Knights (const SizeOptions &opt)
 Constructor.
 Knights (Knights &s)
 Constructor for cloning s.
virtual void print (std::ostream &os) const
 Print board.
Public Member Functions inherited from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< Space > >
 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.
Public Member Functions inherited from Gecode::Driver::IgnoreStepOption< BaseSpace >
 IgnoreStepOption (const Options &)
 Constructor.
 IgnoreStepOption (BaseSpace &e)
 Constructor used for cloning.

Additional Inherited Members

Public Types inherited from Knights
enum  { PROP_REIFIED , PROP_CIRCUIT }
 Propagation to use for model. More...
enum  { BRANCH_NAIVE , BRANCH_WARNSDORFF }
 Branching to use for model. More...
Static Public Member Functions inherited from Gecode::Driver::ScriptBase< Driver::IgnoreStepOption< Space > >
static std::ostream & select_ostream (const char *sn, std::ofstream &ofs)
 Choose output stream according to sn.
static void run (const Options &opt, Script *s=NULL)
Public Attributes inherited from Knights
const int n
 Size of board.
IntVarArray succ
 Maps board field to successor field.

Detailed Description

Example: n-Knight's tour (simple model)

Fill an n times n chess board with knight's moves such that the knight does a full tour (last move reaches first move again). The formulation is due to Gert Smolka.

Definition at line 250 of file knights.cpp.

Constructor & Destructor Documentation

◆ KnightsReified() [1/2]

KnightsReified::KnightsReified ( const SizeOptions & opt)
inline

Definition at line 252 of file knights.cpp.

◆ KnightsReified() [2/2]

KnightsReified::KnightsReified ( KnightsReified & s)
inline

Constructor for cloning s.

Definition at line 285 of file knights.cpp.

Member Function Documentation

◆ copy()

virtual Space * KnightsReified::copy ( void )
inlinevirtual

Copy during cloning.

Definition at line 288 of file knights.cpp.


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