HOG2
|
#include <FlipSide.h>
Public Member Functions | |
FlipSide (int width=5) | |
~FlipSide () | |
void | GetSuccessors (const FlipSideState &stateID, std::vector< FlipSideState > &neighbors) const |
void | GetActions (const FlipSideState &stateID, std::vector< flipMove > &actions) const |
flipMove | GetAction (const FlipSideState &s1, const FlipSideState &s2) const |
void | ApplyAction (FlipSideState &s, flipMove a) const |
bool | InvertAction (flipMove &) const |
double | HCost (const FlipSideState &) const |
Heuristic value between node and the stored goal. More... | |
double | HCost (const FlipSideState &state1, const FlipSideState &state2) const |
Heuristic value between two arbitrary nodes. More... | |
double | GCost (const FlipSideState &state1, const FlipSideState &state2) const |
double | GCost (const FlipSideState &, const flipMove &) const |
bool | GoalTest (const FlipSideState &state, const FlipSideState &goal) const |
bool | GoalTest (const FlipSideState &) const |
Goal Test if the goal is stored. More... | |
uint64_t | GetStateHash (const FlipSideState &state) const |
uint64_t | GetActionHash (flipMove act) const |
void | OpenGLDraw () const |
void | OpenGLDraw (const FlipSideState &s) const |
void | OpenGLDraw (const FlipSideState &, const flipMove &) const |
void | OpenGLDraw (const FlipSideState &, const FlipSideState &, float) const |
Draw the transition at some percentage 0...1 between two states. More... | |
void | StoreGoal (FlipSideState &) |
Stores the goal for use by single-state HCost. More... | |
void | ClearGoal () |
Clears the goal from memory. More... | |
bool | IsGoalStored () const |
Public Member Functions inherited from SearchEnvironment< FlipSideState, flipMove > | |
virtual | ~SearchEnvironment () |
virtual int | GetNumSuccessors (const FlipSideState &stateID) const |
virtual void | UndoAction (FlipSideState &s, flipMove a) const |
virtual void | GetNextState (const FlipSideState &s1, flipMove a, FlipSideState &s2) const |
virtual bool | IsGoalStored () const |
Returns true if the goal is stored and false otherwise. More... | |
virtual double | HCost (const FlipSideState &node1, const FlipSideState &node2, double parentHCost) const |
virtual uint64_t | GetMaxHash () const |
virtual void | GetStateFromHash (uint64_t parent, FlipSideState &s) const |
virtual double | GetPathLength (std::vector< FlipSideState > &neighbors) |
virtual double | GetPathLength (const FlipSideState &start, std::vector< flipMove > &neighbors) |
virtual OccupancyInterface< FlipSideState, flipMove > * | GetOccupancyInfo () |
virtual void | SetOccupancyInfo (OccupancyInterface< FlipSideState, flipMove > *) |
virtual void | OpenGLDraw () const |
virtual void | GLLabelState (const FlipSideState &, const char *) const |
virtual void | GLDrawLine (const FlipSideState &x, const FlipSideState &y) const |
virtual void | GLDrawPath (const std::vector< FlipSideState > &x) const |
virtual void | SetColor (const rgbColor &r) const |
virtual void | SetColor (GLfloat rr, GLfloat g, GLfloat b, GLfloat t=1.0) const |
virtual void | GetColor (GLfloat &rr, GLfloat &g, GLfloat &b, GLfloat &t) const |
virtual rgbColor | GetColor () const |
virtual void | Draw (Graphics::Display &display) const |
virtual void | Draw (Graphics::Display &display, const FlipSideState &) const |
virtual void | DrawLine (Graphics::Display &display, const FlipSideState &x, const FlipSideState &y, float width=1.0) const |
Public Member Functions inherited from Heuristic< FlipSideState > | |
Heuristic () | |
virtual | ~Heuristic () |
Private Attributes | |
int | width |
Additional Inherited Members | |
Public Attributes inherited from Heuristic< FlipSideState > | |
std::vector< HeuristicTreeNode > | lookups |
std::vector< Heuristic * > | heuristics |
uint64_t | histogram [256] |
Protected Attributes inherited from SearchEnvironment< FlipSideState, flipMove > | |
bool | bValidSearchGoal |
FlipSideState | searchGoal |
rgbColor | color |
GLfloat | transparency |
Definition at line 66 of file FlipSide.h.
FlipSide::FlipSide | ( | int | width = 5 | ) |
Definition at line 12 of file FlipSide.cpp.
FlipSide::~FlipSide | ( | ) |
Definition at line 17 of file FlipSide.cpp.
|
virtual |
Implements SearchEnvironment< FlipSideState, flipMove >.
Definition at line 52 of file FlipSide.cpp.
References flipMove::bottom, FlipSideState::puzzle, flipMove::top, and FlipSideState::width.
Referenced by GetSuccessors().
|
inlinevirtual |
Clears the goal from memory.
Reimplemented from SearchEnvironment< FlipSideState, flipMove >.
Definition at line 98 of file FlipSide.h.
|
inlinevirtual |
Implements SearchEnvironment< FlipSideState, flipMove >.
Definition at line 83 of file FlipSide.h.
|
virtual |
Implements SearchEnvironment< FlipSideState, flipMove >.
Definition at line 109 of file FlipSide.cpp.
|
virtual |
Reimplemented from SearchEnvironment< FlipSideState, flipMove >.
Definition at line 46 of file FlipSide.cpp.
|
virtual |
Implements SearchEnvironment< FlipSideState, flipMove >.
Definition at line 129 of file FlipSide.cpp.
References flipMove::bottom, and flipMove::top.
|
virtual |
Implements SearchEnvironment< FlipSideState, flipMove >.
Definition at line 34 of file FlipSide.cpp.
References FlipSideState::width.
Referenced by GetSuccessors().
|
virtual |
Implements SearchEnvironment< FlipSideState, flipMove >.
Definition at line 119 of file FlipSide.cpp.
References FlipSideState::puzzle.
|
virtual |
Implements SearchEnvironment< FlipSideState, flipMove >.
Definition at line 21 of file FlipSide.cpp.
References ApplyAction(), and GetActions().
|
inlinevirtual |
Goal Test if the goal is stored.
Reimplemented from SearchEnvironment< FlipSideState, flipMove >.
Definition at line 86 of file FlipSide.h.
|
virtual |
Implements SearchEnvironment< FlipSideState, flipMove >.
Definition at line 114 of file FlipSide.cpp.
|
inlinevirtual |
Heuristic value between node and the stored goal.
Asserts that the goal is stored
Reimplemented from SearchEnvironment< FlipSideState, flipMove >.
Definition at line 78 of file FlipSide.h.
|
virtual |
Heuristic value between two arbitrary nodes.
Implements SearchEnvironment< FlipSideState, flipMove >.
Definition at line 62 of file FlipSide.cpp.
References FlipSideState::puzzle, and FlipSideState::width.
|
inlinevirtual |
Implements SearchEnvironment< FlipSideState, flipMove >.
Definition at line 74 of file FlipSide.h.
|
inline |
Definition at line 99 of file FlipSide.h.
void FlipSide::OpenGLDraw | ( | ) | const |
Definition at line 134 of file FlipSide.cpp.
|
inlinevirtual |
Reimplemented from SearchEnvironment< FlipSideState, flipMove >.
Definition at line 94 of file FlipSide.h.
|
inlinevirtual |
Draw the transition at some percentage 0...1 between two states.
Reimplemented from SearchEnvironment< FlipSideState, flipMove >.
Definition at line 95 of file FlipSide.h.
|
virtual |
Reimplemented from SearchEnvironment< FlipSideState, flipMove >.
Definition at line 139 of file FlipSide.cpp.
References width.
|
inlinevirtual |
Stores the goal for use by single-state HCost.
Reimplemented from SearchEnvironment< FlipSideState, flipMove >.
Definition at line 97 of file FlipSide.h.
|
private |
Definition at line 101 of file FlipSide.h.
Referenced by OpenGLDraw().