HOG2
Classes | Namespaces | Enumerations | Functions | Variables
MNPuzzle.h File Reference
#include <stdint.h>
#include <iostream>
#include "SearchEnvironment.h"
#include "PermutationPuzzleEnvironment.h"
#include "UnitSimulation.h"
#include "GraphEnvironment.h"
#include "Graph.h"
#include <sstream>
#include <array>
Include dependency graph for MNPuzzle.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MNPuzzleState< width, height >
 
struct  std::hash< MNPuzzleState< w, h > >
 
class  MNPuzzle< width, height >
 
class  GraphPuzzleDistanceHeuristic< width, height >
 

Namespaces

 std
 

Enumerations

enum  slideDir {
  kLeft, kUp, kDown, kRight,
  kNoSlide
}
 Note, direction "kLeft" indicates that the blank is being moved to the left. More...
 
enum  puzzleWeight {
  kUnitWeight, kSquared, kSquareRoot, kSquarePlusOneRoot,
  kUnitPlusFrac
}
 

Functions

template<int width, int height>
static std::ostream & operator<< (std::ostream &out, const MNPuzzleState< width, height > &loc)
 
static std::ostream & operator<< (std::ostream &out, const slideDir &loc)
 
template<int width, int height>
static bool operator== (const MNPuzzleState< width, height > &l1, const MNPuzzleState< width, height > &l2)
 
template<int width, int height>
static bool operator!= (const MNPuzzleState< width, height > &l1, const MNPuzzleState< width, height > &l2)
 
void DrawTile (float x, float y, char c1, char c2, int w, int h)
 
void DrawFrame (int w, int h)
 

Variables

static int costs [25]
 

Enumeration Type Documentation

◆ puzzleWeight

Enumerator
kUnitWeight 
kSquared 
kSquareRoot 
kSquarePlusOneRoot 
kUnitPlusFrac 

Definition at line 128 of file MNPuzzle.h.

◆ slideDir

enum slideDir

Note, direction "kLeft" indicates that the blank is being moved to the left.

That is, a tile is being slid right into the blank position. The other actions are defined similarly.

Enumerator
kLeft 
kUp 
kDown 
kRight 
kNoSlide 

Definition at line 84 of file MNPuzzle.h.

Function Documentation

◆ DrawFrame()

void DrawFrame ( int  w,
int  h 
)

Definition at line 48 of file MNPuzzle.cpp.

Referenced by MNPuzzle< width, height >::OpenGLDraw().

◆ DrawTile()

void DrawTile ( float  x,
float  y,
char  c1,
char  c2,
int  w,
int  h 
)

Definition at line 13 of file MNPuzzle.cpp.

Referenced by MNPuzzle< width, height >::OpenGLDraw().

◆ operator!=()

template<int width, int height>
static bool operator!= ( const MNPuzzleState< width, height > &  l1,
const MNPuzzleState< width, height > &  l2 
)
static

Definition at line 123 of file MNPuzzle.h.

◆ operator<<() [1/2]

template<int width, int height>
static std::ostream& operator<< ( std::ostream &  out,
const MNPuzzleState< width, height > &  loc 
)
static

Definition at line 89 of file MNPuzzle.h.

References height, and width.

◆ operator<<() [2/2]

static std::ostream& operator<< ( std::ostream &  out,
const slideDir loc 
)
static

Definition at line 97 of file MNPuzzle.h.

References kDown, kLeft, kRight, and kUp.

◆ operator==()

template<int width, int height>
static bool operator== ( const MNPuzzleState< width, height > &  l1,
const MNPuzzleState< width, height > &  l2 
)
static

Variable Documentation

◆ costs

int costs[25]
static
Initial value:
=
{
3, 5, 4, 7, 10, 5, 3, 3, 8, 9, 2, 10, 10, 1, 2, 1, 1, 4, 7, 9, 6, 10, 2, 8, 8
}

Definition at line 769 of file MNPuzzle.h.