movementAnalysator_c Class Reference

this class is can do analysation of movements within a puzzle. More...

#include <movementanalysator.h>

Collaboration diagram for movementAnalysator_c:

Collaboration graph

List of all members.

Public Member Functions

 movementAnalysator_c (const problem_c *puz)
 construct the analysator for this concrete problem.
 ~movementAnalysator_c (void)
void init_find (disassemblerNode_c *nd, const std::vector< unsigned int > &pieces)
disassemblerNode_cfind (void)
void completeFind (disassemblerNode_c *searchnode, const std::vector< unsigned int > &pieces, std::vector< disassemblerNode_c * > *result)
disassemblerNode_cfindMatching (disassemblerNode_c *nd, const std::vector< unsigned int > &pcs, unsigned int piece, int dx, int dy, int dz)

Private Member Functions

void prepare (void)
bool checkmovement (unsigned int maxPieces, unsigned int nextstep)
disassemblerNode_cnewNode (unsigned int amount)
disassemblerNode_cnewNodeMerge (const disassemblerNode_c *n0, const disassemblerNode_c *n1)
 movementAnalysator_c (const movementAnalysator_c &)
void operator= (const movementAnalysator_c &)

Private Attributes

unsigned int * matrix
unsigned int * movement
int * weights
unsigned int piecenumber
int nextpiece
int next_pn
int nextstate
int nextpiece2
int state99nextState
unsigned int nextdir
unsigned int maxstep
unsigned int nextstep
const std::vector< unsigned int > * pieces

Detailed Description

this class is can do analysation of movements within a puzzle.

It takes a position of pieces and then tries to find all other positions that can be reached directly from that starting point.

It is implemented using Bill Cuttlers algorithm, so please read there in case you are interested how it works. The comments are written with the thought that you know his algorithm

Constructor & Destructor Documentation

movementAnalysator_c::movementAnalysator_c ( const problem_c puz  ) 

construct the analysator for this concrete problem.

Ts can not be changed, once you done that but you can analyse many positions

References bt_assert, cache, problem_c::getGridType(), gridType_c::getMovementCache(), problem_c::getShapeMax(), problem_c::getShapeShape(), voxel_c::getWeight(), matrix, movement, nextstate, nodes, movementCache_c::numDirections(), problem_c::partNumber(), problem_c::pieceNumber(), piecenumber, and weights.

movementAnalysator_c::~movementAnalysator_c ( void   ) 

References cache, matrix, movement, nodes, and weights.

movementAnalysator_c::movementAnalysator_c ( const movementAnalysator_c  )  [private]

Member Function Documentation

bool movementAnalysator_c::checkmovement ( unsigned int  maxPieces,
unsigned int  nextstep 
) [private]

void movementAnalysator_c::completeFind ( disassemblerNode_c searchnode,
const std::vector< unsigned int > &  pieces,
std::vector< disassemblerNode_c * > *  result 

References find(), init_find(), and maxstep.

disassemblerNode_c * movementAnalysator_c::find ( void   ) 

disassemblerNode_c * movementAnalysator_c::findMatching ( disassemblerNode_c nd,
const std::vector< unsigned int > &  pcs,
unsigned int  piece,
int  dx,
int  dy,
int  dz 

void movementAnalysator_c::init_find ( disassemblerNode_c nd,
const std::vector< unsigned int > &  pieces 

disassemblerNode_c * movementAnalysator_c::newNode ( unsigned int  amount  )  [private]

disassemblerNode_c * movementAnalysator_c::newNodeMerge ( const disassemblerNode_c n0,
const disassemblerNode_c n1 
) [private]

void movementAnalysator_c::operator= ( const movementAnalysator_c  )  [private]

void movementAnalysator_c::prepare ( void   )  [private]

Member Data Documentation

unsigned int* movementAnalysator_c::matrix [private]

unsigned int movementAnalysator_c::maxstep [private]

Referenced by completeFind(), and find().

unsigned int* movementAnalysator_c::movement [private]

unsigned int movementAnalysator_c::nextdir [private]

unsigned int movementAnalysator_c::nextstep [private]

Referenced by find(), findMatching(), and init_find().

unsigned int movementAnalysator_c::piecenumber [private]

const std::vector<unsigned int>* movementAnalysator_c::pieces [private]

Referenced by find().

Referenced by find().

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

Generated on Sun Oct 10 10:02:58 2010 for BurrTools by  doxygen 1.5.8