Generated on Sat Feb 7 2015 02:01:38 for Gecode by doxygen 1.8.9.1
Knights Class Reference

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. 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...
 
- Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
 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...
 

Public Attributes

const int n
 Size of board. More...
 
IntVarArray succ
 Maps board field to successor field. More...
 

Related Functions

(Note that these are not member functions.)

int main (int argc, char *argv[])
 Main-function. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
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)
 

Detailed Description

Base-class for knight's tour example.

Definition at line 168 of file knights.cpp.

Member Enumeration Documentation

anonymous enum

Propagation to use for model.

Enumerator
PROP_REIFIED 

Use reified constraints.

PROP_CIRCUIT 

Use single circuit constraints.

Definition at line 175 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 180 of file knights.cpp.

Constructor & Destructor Documentation

Knights::Knights ( const SizeOptions opt)
inline

Constructor.

Definition at line 210 of file knights.cpp.

Knights::Knights ( bool  share,
Knights s 
)
inline

Constructor for cloning s.

Definition at line 222 of file knights.cpp.

Member Function Documentation

int Knights::f ( int  x,
int  y 
) const
inline

Return field at position x, y.

Definition at line 185 of file knights.cpp.

int Knights::x ( int  f) const
inline

Return x coordinate at field f.

Definition at line 189 of file knights.cpp.

int Knights::y ( int  f) const
inline

Return y coordinate at field f.

Definition at line 193 of file knights.cpp.

IntSet Knights::neighbors ( int  i)
inline

Compute set of neighbour fields.

Definition at line 197 of file knights.cpp.

virtual void Knights::print ( std::ostream &  os) const
inlinevirtual

Print board.

Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.

Definition at line 227 of file knights.cpp.

Friends And Related Function Documentation

int main ( int  argc,
char *  argv[] 
)
related

Main-function.

Definition at line 415 of file knights.cpp.

Member Data Documentation

const int Knights::n

Size of board.

Definition at line 171 of file knights.cpp.

IntVarArray Knights::succ

Maps board field to successor field.

Definition at line 173 of file knights.cpp.


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