Assignment Search Framework
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
TilePuzzleState Class Reference

Public Member Functions

 TilePuzzleState ()
 
virtual ~TilePuzzleState ()
 
 TilePuzzleState (const unsigned rows, const unsigned cols)
 
 TilePuzzleState (const std::vector< unsigned > &perm, const unsigned rows, const unsigned cols)
 

Public Attributes

std::vector< unsigned > permutation
 The permutation representation of the state. More...
 
unsigned num_rows
 Number of rows in the state. More...
 
unsigned num_cols
 Number of columns in the state. More...
 
unsigned blank_loc
 Location of the blank (or 0) More...
 

Detailed Description

Defines a tile puzzle state.

Todo:
Is both equality and inequality actually needed?

Constructor & Destructor Documentation

TilePuzzleState::TilePuzzleState ( )

Creates an empty tile puzzle with zero in all dimensions.

TilePuzzleState::~TilePuzzleState ( )
virtual

Destructor for a sliding tile puzzle state. Does nothing.

TilePuzzleState::TilePuzzleState ( const unsigned  rows,
const unsigned  cols 
)

Creates a tile puzzle of the given dimensions.

Parameters
rowsThe number of rows in the puzzle.
colsThe number of columns in the puzzle.
TilePuzzleState::TilePuzzleState ( const std::vector< unsigned > &  perm,
const unsigned  rows,
const unsigned  cols 
)

Creates a tile puzzle from the given permutation with the given dimensions.

Parameters
permThe permutation as the basis of the puzzle.
rowsThe number of rows in the puzzle.
colsThe number of columns in the puzzle.

Member Data Documentation

unsigned TilePuzzleState::blank_loc

Location of the blank (or 0)

unsigned TilePuzzleState::num_cols

Number of columns in the state.

unsigned TilePuzzleState::num_rows

Number of rows in the state.

std::vector<unsigned> TilePuzzleState::permutation

The permutation representation of the state.


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