Example: n-Knights tour (model using circuit) More...
Public Member Functions | |
KnightsCircuit (const SizeOptions &opt) | |
KnightsCircuit (bool share, KnightsCircuit &s) | |
Constructor for cloning s. More... | |
virtual Space * | copy (bool share) |
Copy during cloning. More... | |
![]() | |
int | f (int x, int y) const |
Return field at position x, y. More... | |
int | x (int f) const |
Return x coordinate at field f. More... | |
int | y (int f) const |
Return y coordinate at field f. More... | |
IntSet | neighbors (int i) |
Compute set of neighbour fields. More... | |
Knights (const SizeOptions &opt) | |
Constructor. More... | |
Knights (bool share, Knights &s) | |
Constructor for cloning s. More... | |
virtual void | print (std::ostream &os) const |
Print board. More... | |
![]() | |
ScriptBase (void) | |
Default constructor. More... | |
ScriptBase (bool share, ScriptBase &e) | |
Constructor used for cloning. More... | |
virtual void | compare (const Space &, std::ostream &os) const |
Compare with s. More... | |
Additional Inherited Members | |
![]() | |
enum | { PROP_REIFIED, PROP_CIRCUIT } |
Propagation to use for model. More... | |
enum | { BRANCH_NAIVE, BRANCH_WARNSDORFF } |
Branching to use for model. 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) |
![]() | |
const int | n |
Size of board. More... | |
IntVarArray | succ |
Maps board field to successor field. More... | |
![]() | |
int | main (int argc, char *argv[]) |
Main-function. More... | |
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 311 of file knights.cpp.
|
inline |
Definition at line 313 of file knights.cpp.
|
inline |
Constructor for cloning s.
Definition at line 323 of file knights.cpp.
|
inlinevirtual |
Copy during cloning.
Definition at line 326 of file knights.cpp.