Generated on Tue Jan 28 2020 00:00:00 for Gecode by doxygen 1.8.17
Warnsdorff Class Reference

Custom brancher for knight's tours using Warnsdorff's rule. More...

Classes

class  Choice
 Choice More...
 

Public Member Functions

virtual bool status (const Space &) const
 Check status of brancher, return true if alternatives left. More...
 
virtual Gecode::Choicechoice (Space &)
 Return choice. More...
 
virtual Choicechoice (const Space &, Archive &e)
 Return choice. More...
 
virtual ExecStatus commit (Space &home, const Gecode::Choice &_c, unsigned int a)
 Perform commit for choice _c and alternative a. More...
 
virtual void print (const Space &, const Gecode::Choice &_c, unsigned int a, std::ostream &o) const
 Print explanation. More...
 
virtual Actorcopy (Space &home, bool share)
 Copy brancher. More...
 
virtual size_t dispose (Space &)
 Delete brancher and return its size. More...
 
- Public Member Functions inherited from Gecode::Brancher
virtual NGLngl (Space &home, const Choice &c, unsigned int a) const
 Create no-good literal for choice c and alternative a. More...
 
unsigned int id (void) const
 Return brancher id. More...
 
BrancherGroup group (void) const
 Return group brancher belongs to. More...
 
void group (BrancherGroup g)
 Add brancher to group g. More...
 
- Public Member Functions inherited from Gecode::Actor
virtual ~Actor (void)
 To avoid warnings. More...
 

Static Public Member Functions

static void post (Home home, const IntVarArgs &x)
 Post brancher. More...
 
- Static Public Member Functions inherited from Gecode::Actor
static void * operator new (size_t s, Space &home)
 Allocate memory from space. More...
 
static void operator delete (void *p, Space &home)
 No-op for exceptions. More...
 
static void * operator new (size_t s)
 Not used. More...
 
static void operator delete (void *p)
 Not used. More...
 

Protected Member Functions

 Warnsdorff (Home home, ViewArray< Int::IntView > &xv)
 Construct brancher. More...
 
 Warnsdorff (Space &home, bool share, Warnsdorff &b)
 Copy constructor. More...
 
- Protected Member Functions inherited from Gecode::Brancher
 Brancher (Home home)
 Constructor for creation. More...
 
 Brancher (Space &home, bool share, Brancher &b)
 Constructor for cloning b. More...
 

Protected Attributes

ViewArray< Int::IntViewx
 Views of the brancher. More...
 
int start
 Next variable to branch on. More...
 

Detailed Description

Custom brancher for knight's tours using Warnsdorff's rule.

This class implements Warnsdorff's rule for finding knight's tours. The next position is choosen by taking the jump that minimizes the number of alternatives in the next step.

Definition at line 62 of file knights.cpp.

Constructor & Destructor Documentation

◆ Warnsdorff() [1/2]

Warnsdorff::Warnsdorff ( Home  home,
ViewArray< Int::IntView > &  xv 
)
inlineprotected

Construct brancher.

Definition at line 92 of file knights.cpp.

◆ Warnsdorff() [2/2]

Warnsdorff::Warnsdorff ( Space home,
bool  share,
Warnsdorff b 
)
inlineprotected

Copy constructor.

Definition at line 95 of file knights.cpp.

Member Function Documentation

◆ status()

virtual bool Warnsdorff::status ( const Space ) const
inlinevirtual

Check status of brancher, return true if alternatives left.

Implements Gecode::Brancher.

Definition at line 101 of file knights.cpp.

◆ choice() [1/2]

virtual Gecode::Choice* Warnsdorff::choice ( Space )
inlinevirtual

Return choice.

Implements Gecode::Brancher.

Definition at line 112 of file knights.cpp.

◆ choice() [2/2]

virtual Choice* Warnsdorff::choice ( const Space ,
Archive e 
)
inlinevirtual

Return choice.

Implements Gecode::Brancher.

Definition at line 128 of file knights.cpp.

◆ commit()

virtual ExecStatus Warnsdorff::commit ( Space home,
const Gecode::Choice _c,
unsigned int  a 
)
inlinevirtual

Perform commit for choice _c and alternative a.

Implements Gecode::Brancher.

Definition at line 134 of file knights.cpp.

◆ print()

virtual void Warnsdorff::print ( const Space ,
const Gecode::Choice _c,
unsigned int  a,
std::ostream &  o 
) const
inlinevirtual

Print explanation.

Reimplemented from Gecode::Brancher.

Definition at line 143 of file knights.cpp.

◆ copy()

virtual Actor* Warnsdorff::copy ( Space home,
bool  share 
)
inlinevirtual

Copy brancher.

Implements Gecode::Actor.

Definition at line 152 of file knights.cpp.

◆ post()

static void Warnsdorff::post ( Home  home,
const IntVarArgs x 
)
inlinestatic

Post brancher.

Definition at line 156 of file knights.cpp.

◆ dispose()

virtual size_t Warnsdorff::dispose ( Space )
inlinevirtual

Delete brancher and return its size.

Reimplemented from Gecode::Actor.

Definition at line 161 of file knights.cpp.

Member Data Documentation

◆ x

ViewArray<Int::IntView> Warnsdorff::x
protected

Views of the brancher.

Definition at line 65 of file knights.cpp.

◆ start

int Warnsdorff::start
mutableprotected

Next variable to branch on.

Definition at line 67 of file knights.cpp.


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