Knights Class Reference
Base-class for Knights tour example. More...
Public Types | |
enum | { PROP_REIFIED, PROP_CIRCUIT } |
Propagation to use for model. More... | |
enum | { BRANCH_NAIVE, BRANCH_WARNSDORFF } |
Branching to use for model. More... | |
Public Member Functions | |
int | field (int x, int y) const |
Return field at position x, y. | |
void | neighbours (int f, int nbs[8], int &n_nbs) |
Compute array of neighbours. | |
Knights (const SizeOptions &opt) | |
Constructor. | |
Knights (bool share, Knights &s) | |
Constructor for cloning s. | |
virtual void | print (std::ostream &os) const |
Print board. | |
Protected Attributes | |
const int | n |
Size of board. | |
IntVarArray | succ |
Maps board field to successor field. |
Detailed Description
Base-class for Knights tour example.
Definition at line 142 of file knights.cpp.
Member Enumeration Documentation
anonymous enum |
Propagation to use for model.
Definition at line 150 of file knights.cpp.
anonymous enum |
Branching to use for model.
- Enumerator:
BRANCH_NAIVE Use naive, lexicographical branching.
BRANCH_WARNSDORFF Use Warnsdorff's rule.
Definition at line 155 of file knights.cpp.
Constructor & Destructor Documentation
Knights::Knights | ( | const SizeOptions & | opt | ) | [inline] |
Constructor.
Definition at line 181 of file knights.cpp.
Knights::Knights | ( | bool | share, | |
Knights & | s | |||
) | [inline] |
Constructor for cloning s.
Definition at line 193 of file knights.cpp.
Member Function Documentation
int Knights::field | ( | int | x, | |
int | y | |||
) | const [inline] |
Return field at position x, y.
Definition at line 161 of file knights.cpp.
void Knights::neighbours | ( | int | f, | |
int | nbs[8], | |||
int & | n_nbs | |||
) | [inline] |
Compute array of neighbours.
Definition at line 166 of file knights.cpp.
virtual void Knights::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print board.
Reimplemented from Gecode::Driver::ScriptBase< Space >.
Definition at line 198 of file knights.cpp.
Member Data Documentation
const int Knights::n [protected] |
Size of board.
Definition at line 145 of file knights.cpp.
IntVarArray Knights::succ [protected] |
Maps board field to successor field.
Definition at line 147 of file knights.cpp.
The documentation for this class was generated from the following file:
- examples/knights.cpp (Revision: 9848)