
Base-class for knight's 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 | 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 (bool share, Knights &s) | |
| Constructor for cloning s. | |
| virtual void | print (std::ostream &os) const |
| Print board. | |
Public Attributes | |
| const int | n |
| Size of board. | |
| IntVarArray | succ |
| Maps board field to successor field. | |
Related Functions | |
(Note that these are not member functions.) | |
| int | main (int argc, char *argv[]) |
| Main-function. | |
Base-class for knight's tour example.
Definition at line 156 of file knights.cpp.
| anonymous enum |
Propagation to use for model.
Definition at line 163 of file knights.cpp.
| anonymous enum |
Branching to use for model.
| BRANCH_NAIVE |
Use naive, lexicographical branching. |
| BRANCH_WARNSDORFF |
Use Warnsdorff's rule. |
Definition at line 168 of file knights.cpp.
| Knights::Knights | ( | const SizeOptions & | opt | ) | [inline] |
Constructor.
Definition at line 198 of file knights.cpp.
| Knights::Knights | ( | bool | share, |
| Knights & | s | ||
| ) | [inline] |
Constructor for cloning s.
Definition at line 210 of file knights.cpp.
| int Knights::f | ( | int | x, |
| int | y | ||
| ) | const [inline] |
Return field at position x, y.
Definition at line 173 of file knights.cpp.
| int Knights::x | ( | int | f | ) | const [inline] |
Return x coordinate at field f.
Definition at line 177 of file knights.cpp.
| int Knights::y | ( | int | f | ) | const [inline] |
Return y coordinate at field f.
Definition at line 181 of file knights.cpp.
| IntSet Knights::neighbors | ( | int | i | ) | [inline] |
Compute set of neighbour fields.
Definition at line 185 of file knights.cpp.
| virtual void Knights::print | ( | std::ostream & | os | ) | const [inline, virtual] |
Print board.
Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.
Definition at line 215 of file knights.cpp.
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) | [related] |
Main-function.
Definition at line 403 of file knights.cpp.
| const int Knights::n |
Size of board.
Definition at line 159 of file knights.cpp.
Maps board field to successor field.
Definition at line 161 of file knights.cpp.