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

Example: n-Knights tour (model using circuit) More...

Public Member Functions

 KnightsCircuit (const SizeOptions &opt)
 
 KnightsCircuit (KnightsCircuit &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< 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.
 

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< 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)
 
- Public Attributes inherited from Knights
const int n
 Size of board.
 
IntVarArray succ
 Maps board field to successor field.
 

Detailed Description

Example: n-Knights tour (model using circuit)

Fill an n times n chess board with knights such that the knights do a full tour by knights move (last knight reaches first knight again).

Definition at line 303 of file knights.cpp.

Constructor & Destructor Documentation

◆ KnightsCircuit() [1/2]

KnightsCircuit::KnightsCircuit ( const SizeOptions & opt)
inline

Definition at line 305 of file knights.cpp.

◆ KnightsCircuit() [2/2]

KnightsCircuit::KnightsCircuit ( KnightsCircuit & s)
inline

Constructor for cloning s.

Definition at line 315 of file knights.cpp.

Member Function Documentation

◆ copy()

virtual Space * KnightsCircuit::copy ( void )
inlinevirtual

Copy during cloning.

Definition at line 318 of file knights.cpp.


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