Generated on Mon Aug 25 11:35:48 2008 for Gecode by doxygen 1.5.6

Knights Class Reference

Inherits Example.

Inherited by KnightsCircuit, and KnightsReified.

List of all members.


Detailed Description

Base-class for Knights tour example.

Definition at line 42 of file knights.cc.


Public Types

enum  { PROP_REIFIED, PROP_CIRCUIT }
 Propagation to use for model. More...

Public Member Functions

int field (int x, int y)
 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)
 Print board.

Protected Attributes

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

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 50 of file knights.cc.


Constructor & Destructor Documentation

Knights::Knights ( const SizeOptions opt  )  [inline]

Constructor.

Definition at line 76 of file knights.cc.

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

Constructor for cloning s.

Definition at line 79 of file knights.cc.


Member Function Documentation

int Knights::field ( int  x,
int  y 
) [inline]

Return field at position x, y.

Definition at line 56 of file knights.cc.

void Knights::neighbours ( int  f,
int  nbs[8],
int &  n_nbs 
) [inline]

Compute array of neighbours.

Definition at line 61 of file knights.cc.

virtual void Knights::print ( std::ostream &  os  )  [inline, virtual]

Print board.

Reimplemented from Example.

Definition at line 84 of file knights.cc.


Member Data Documentation

const int Knights::n [protected]

Size of board.

Definition at line 45 of file knights.cc.

Maps board field to successor field.

Definition at line 47 of file knights.cc.


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