HOG2
|
#include <NQueens.h>
Public Member Functions | |
NQueens () | |
~NQueens () | |
virtual void | GetSuccessors (const NQueenState &nodeID, std::vector< NQueenState > &neighbors) const |
virtual void | GetActions (const NQueenState &nodeID, std::vector< NQueenAction > &actions) const |
virtual NQueenAction | GetAction (const NQueenState &s1, const NQueenState &s2) const |
virtual void | ApplyAction (NQueenState &s, NQueenAction a) const |
virtual void | GetNextState (const NQueenState &, NQueenAction, NQueenState &) const |
virtual bool | InvertAction (NQueenAction &a) const |
virtual double | HCost (const NQueenState &node1, const NQueenState &node2) const |
Heuristic value between two arbitrary nodes. More... | |
virtual double | HCost (const NQueenState &node) const |
Heuristic value between node and the stored goal. More... | |
virtual double | GCost (const NQueenState &node1, const NQueenState &node2) const |
virtual double | GCost (const NQueenState &node, const NQueenAction &act) const |
virtual bool | GoalTest (const NQueenState &node, const NQueenState &goal) const |
virtual bool | GoalTest (const NQueenState &node) const |
Goal Test if the goal is stored. More... | |
virtual uint64_t | GetStateHash (const NQueenState &node) const |
virtual uint64_t | GetActionHash (NQueenAction act) const |
int | NumCollisions (const NQueenState &node) const |
int | NumCollisions (const NQueenState &node, int row) const |
int | NumCollisions (const NQueenState &node, int row, int column) const |
virtual void | OpenGLDraw () const |
virtual void | OpenGLDraw (const NQueenState &) const |
virtual void | OpenGLDraw (const NQueenState &, const NQueenState &, float) const |
Draw the transition at some percentage 0...1 between two states. More... | |
virtual void | OpenGLDraw (const NQueenState &, const NQueenAction &) const |
void | GLLabelState (const NQueenState &s, int x, int y, int number) const |
void | OpenGLDrawBackground (float r, float g, float b) |
void | OpenGLDrawBackground (const NQueenState &, float r, float g, float b, int firstRow, int lastRow) |
void | OpenGLDrawConflicts (const NQueenState &s) const |
Public Member Functions inherited from SearchEnvironment< NQueenState, NQueenAction > | |
virtual | ~SearchEnvironment () |
virtual int | GetNumSuccessors (const NQueenState &stateID) const |
virtual void | UndoAction (NQueenState &s, NQueenAction a) const |
virtual void | StoreGoal (NQueenState &s) |
Stores the goal for use by single-state HCost. More... | |
virtual void | ClearGoal () |
Clears the goal from memory. More... | |
virtual bool | IsGoalStored () const |
Returns true if the goal is stored and false otherwise. More... | |
virtual double | HCost (const NQueenState &node1, const NQueenState &node2, double parentHCost) const |
virtual uint64_t | GetMaxHash () const |
virtual void | GetStateFromHash (uint64_t parent, NQueenState &s) const |
virtual double | GetPathLength (std::vector< NQueenState > &neighbors) |
virtual double | GetPathLength (const NQueenState &start, std::vector< NQueenAction > &neighbors) |
virtual OccupancyInterface< NQueenState, NQueenAction > * | GetOccupancyInfo () |
virtual void | SetOccupancyInfo (OccupancyInterface< NQueenState, NQueenAction > *) |
virtual void | OpenGLDraw () const |
virtual void | GLLabelState (const NQueenState &, const char *) const |
virtual void | GLDrawLine (const NQueenState &x, const NQueenState &y) const |
virtual void | GLDrawPath (const std::vector< NQueenState > &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 NQueenState &) const |
virtual void | DrawLine (Graphics::Display &display, const NQueenState &x, const NQueenState &y, float width=1.0) const |
Public Member Functions inherited from Heuristic< NQueenState > | |
Heuristic () | |
virtual | ~Heuristic () |
Additional Inherited Members | |
Public Attributes inherited from Heuristic< NQueenState > | |
std::vector< HeuristicTreeNode > | lookups |
std::vector< Heuristic * > | heuristics |
uint64_t | histogram [256] |
Protected Attributes inherited from SearchEnvironment< NQueenState, NQueenAction > | |
bool | bValidSearchGoal |
NQueenState | searchGoal |
rgbColor | color |
GLfloat | transparency |
|
virtual |
Implements SearchEnvironment< NQueenState, NQueenAction >.
Definition at line 42 of file NQueens.cpp.
References NQueenAction::loc, NQueenState::locs, and NQueenAction::value.
Referenced by GetNextState().
|
inlinevirtual |
Implements SearchEnvironment< NQueenState, NQueenAction >.
|
inlinevirtual |
Implements SearchEnvironment< NQueenState, NQueenAction >.
|
virtual |
Reimplemented from SearchEnvironment< NQueenState, NQueenAction >.
Definition at line 35 of file NQueens.cpp.
|
inlinevirtual |
Implements SearchEnvironment< NQueenState, NQueenAction >.
|
virtual |
Implements SearchEnvironment< NQueenState, NQueenAction >.
Definition at line 17 of file NQueens.cpp.
References NQueenAction::loc, NQueenState::locs, and NQueenAction::value.
|
virtual |
Reimplemented from SearchEnvironment< NQueenState, NQueenAction >.
Definition at line 47 of file NQueens.cpp.
References ApplyAction().
|
inlinevirtual |
Implements SearchEnvironment< NQueenState, NQueenAction >.
|
virtual |
Implements SearchEnvironment< NQueenState, NQueenAction >.
Definition at line 12 of file NQueens.cpp.
void NQueens::GLLabelState | ( | const NQueenState & | s, |
int | x, | ||
int | y, | ||
int | number | ||
) | const |
Definition at line 343 of file NQueens.cpp.
References NQueenState::locs.
Referenced by OpenGLDrawConflicts().
|
virtual |
Goal Test if the goal is stored.
Reimplemented from SearchEnvironment< NQueenState, NQueenAction >.
Definition at line 54 of file NQueens.cpp.
|
inlinevirtual |
Implements SearchEnvironment< NQueenState, NQueenAction >.
Definition at line 77 of file NQueens.h.
References GoalTest().
Referenced by GoalTest().
|
inlinevirtual |
Heuristic value between node and the stored goal.
Asserts that the goal is stored
Reimplemented from SearchEnvironment< NQueenState, NQueenAction >.
|
inlinevirtual |
Heuristic value between two arbitrary nodes.
Implements SearchEnvironment< NQueenState, NQueenAction >.
|
inlinevirtual |
Implements SearchEnvironment< NQueenState, NQueenAction >.
int NQueens::NumCollisions | ( | const NQueenState & | node | ) | const |
Definition at line 172 of file NQueens.cpp.
Referenced by OpenGLDraw(), and OpenGLDrawConflicts().
int NQueens::NumCollisions | ( | const NQueenState & | node, |
int | row | ||
) | const |
Definition at line 131 of file NQueens.cpp.
int NQueens::NumCollisions | ( | const NQueenState & | node, |
int | row, | ||
int | column | ||
) | const |
Definition at line 89 of file NQueens.cpp.
|
virtual |
Definition at line 211 of file NQueens.cpp.
|
virtual |
Reimplemented from SearchEnvironment< NQueenState, NQueenAction >.
Definition at line 241 of file NQueens.cpp.
References NQueenState::locs, and NumCollisions().
|
virtual |
Reimplemented from SearchEnvironment< NQueenState, NQueenAction >.
Definition at line 379 of file NQueens.cpp.
|
virtual |
Draw the transition at some percentage 0...1 between two states.
Reimplemented from SearchEnvironment< NQueenState, NQueenAction >.
Definition at line 374 of file NQueens.cpp.
void NQueens::OpenGLDrawBackground | ( | const NQueenState & | s, |
float | r, | ||
float | g, | ||
float | b, | ||
int | firstRow, | ||
int | lastRow | ||
) |
Definition at line 227 of file NQueens.cpp.
References NQueenState::locs.
void NQueens::OpenGLDrawBackground | ( | float | r, |
float | g, | ||
float | b | ||
) |
Definition at line 216 of file NQueens.cpp.
void NQueens::OpenGLDrawConflicts | ( | const NQueenState & | s | ) | const |
Definition at line 325 of file NQueens.cpp.
References GLLabelState(), NQueenState::locs, and NumCollisions().