HOG2
|
#include <NaryTree.h>
Public Member Functions | |
NaryTree (int branchingFactor, int depth) | |
int | GetBranchingFactor () |
NaryState | GetLastNode () |
NaryState | GetParent (NaryState s) const |
virtual void | GetSuccessors (const NaryState &nodeID, std::vector< NaryState > &neighbors) const |
virtual void | GetActions (const NaryState &nodeID, std::vector< NaryAction > &actions) const |
virtual NaryAction | GetAction (const NaryState &s1, const NaryState &s2) const |
virtual void | ApplyAction (NaryState &s, NaryAction a) const |
virtual void | GetNextState (const NaryState &, NaryAction, NaryState &) const |
virtual bool | InvertAction (NaryAction &a) const |
virtual double | HCost (const NaryState &node1, const NaryState &node2) const |
Heuristic value between two arbitrary nodes. More... | |
virtual double | HCost (const NaryState &node) const |
Heuristic value between node and the stored goal. More... | |
virtual double | GCost (const NaryState &node1, const NaryState &node2) const |
virtual double | GCost (const NaryState &node, const NaryAction &act) const |
virtual bool | GoalTest (const NaryState &node, const NaryState &goal) const |
virtual bool | GoalTest (const NaryState &node) const |
Goal Test if the goal is stored. More... | |
virtual uint64_t | GetStateHash (const NaryState &node) const |
virtual uint64_t | GetActionHash (NaryAction act) const |
void | SetWidthScale (double v) |
virtual void | OpenGLDraw () const |
virtual void | OpenGLDraw (const NaryState &) const |
virtual void | OpenGLDraw (const NaryState &, const NaryState &, float) const |
Draw the transition at some percentage 0...1 between two states. More... | |
virtual void | OpenGLDraw (const NaryState &, const NaryAction &) const |
void | GLDrawLine (const NaryState &x, const NaryState &y) const |
virtual void | Draw (Graphics::Display &display) const |
virtual void | Draw (Graphics::Display &display, const NaryState &s) const |
virtual void | DrawLine (Graphics::Display &display, const NaryState &, const NaryState &, float width) const |
NaryState | GetClosestNode (float x, float y) |
Public Member Functions inherited from SearchEnvironment< NaryState, NaryAction > | |
virtual | ~SearchEnvironment () |
virtual int | GetNumSuccessors (const NaryState &stateID) const |
virtual void | UndoAction (NaryState &s, NaryAction a) const |
virtual void | StoreGoal (NaryState &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 NaryState &node1, const NaryState &node2, double parentHCost) const |
virtual uint64_t | GetMaxHash () const |
virtual void | GetStateFromHash (uint64_t parent, NaryState &s) const |
virtual double | GetPathLength (std::vector< NaryState > &neighbors) |
virtual double | GetPathLength (const NaryState &start, std::vector< NaryAction > &neighbors) |
virtual OccupancyInterface< NaryState, NaryAction > * | GetOccupancyInfo () |
virtual void | SetOccupancyInfo (OccupancyInterface< NaryState, NaryAction > *) |
virtual void | OpenGLDraw () const |
virtual void | GLLabelState (const NaryState &, const char *) const |
virtual void | GLDrawPath (const std::vector< NaryState > &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 |
Public Member Functions inherited from Heuristic< NaryState > | |
Heuristic () | |
virtual | ~Heuristic () |
Private Member Functions | |
int | GetDepth (const NaryState s) const |
float | GetDepthRadius (int depth) const |
uint64_t | GetOffset (const NaryState s) const |
void | GetLocation (const NaryState &s, float &x, float &y) const |
Private Attributes | |
int | b |
int | d |
std::vector< uint64_t > | nodesAtDepth |
std::vector< uint64_t > | totalNodesAtDepth |
double | scaleWidth |
Additional Inherited Members | |
Public Attributes inherited from Heuristic< NaryState > | |
std::vector< HeuristicTreeNode > | lookups |
std::vector< Heuristic * > | heuristics |
uint64_t | histogram [256] |
Protected Attributes inherited from SearchEnvironment< NaryState, NaryAction > | |
bool | bValidSearchGoal |
NaryState | searchGoal |
rgbColor | color |
GLfloat | transparency |
Definition at line 21 of file NaryTree.h.
NaryTree::NaryTree | ( | int | branchingFactor, |
int | depth | ||
) |
Definition at line 14 of file NaryTree.cpp.
References b, d, nodesAtDepth, scaleWidth, and totalNodesAtDepth.
|
virtual |
Implements SearchEnvironment< NaryState, NaryAction >.
Definition at line 59 of file NaryTree.cpp.
References b.
|
virtual |
Reimplemented from SearchEnvironment< NaryState, NaryAction >.
Definition at line 211 of file NaryTree.cpp.
References SearchEnvironment< NaryState, NaryAction >::color, Graphics::Display::FillCircle(), Graphics::Display::FillTriangle(), SearchEnvironment< NaryState, NaryAction >::GetColor(), GetDepth(), GetDepthRadius(), GetLocation(), GetSuccessors(), Colors::gray, and totalNodesAtDepth.
|
virtual |
Reimplemented from SearchEnvironment< NaryState, NaryAction >.
Definition at line 253 of file NaryTree.cpp.
References SearchEnvironment< NaryState, NaryAction >::color, Graphics::Display::FillCircle(), GetDepth(), GetDepthRadius(), GetLocation(), and max.
|
virtual |
Reimplemented from SearchEnvironment< NaryState, NaryAction >.
Definition at line 263 of file NaryTree.cpp.
References SearchEnvironment< NaryState, NaryAction >::color, Graphics::Display::FillCircle(), Graphics::Display::FillTriangle(), GetDepth(), GetDepthRadius(), GetLocation(), and width.
|
virtual |
Implements SearchEnvironment< NaryState, NaryAction >.
Definition at line 89 of file NaryTree.cpp.
Implements SearchEnvironment< NaryState, NaryAction >.
Definition at line 87 of file NaryTree.cpp.
|
virtual |
Reimplemented from SearchEnvironment< NaryState, NaryAction >.
Definition at line 53 of file NaryTree.cpp.
|
virtual |
Implements SearchEnvironment< NaryState, NaryAction >.
Definition at line 98 of file NaryTree.cpp.
References b.
|
virtual |
Implements SearchEnvironment< NaryState, NaryAction >.
Definition at line 42 of file NaryTree.cpp.
References b, d, and GetDepth().
|
inline |
Definition at line 25 of file NaryTree.h.
References b.
NaryState NaryTree::GetClosestNode | ( | float | x, |
float | y | ||
) |
Definition at line 106 of file NaryTree.cpp.
References GetLocation(), sqdist(), and totalNodesAtDepth.
|
private |
Definition at line 135 of file NaryTree.cpp.
References b.
Referenced by Draw(), DrawLine(), GetActions(), GetLocation(), GetSuccessors(), and OpenGLDraw().
|
private |
Definition at line 245 of file NaryTree.cpp.
References min(), and nodesAtDepth.
Referenced by Draw(), and DrawLine().
|
inline |
Definition at line 26 of file NaryTree.h.
References totalNodesAtDepth.
|
private |
Definition at line 124 of file NaryTree.cpp.
References d, GetDepth(), GetOffset(), nodesAtDepth, and scaleWidth.
Referenced by Draw(), DrawLine(), GetClosestNode(), GLDrawLine(), and OpenGLDraw().
|
virtual |
Reimplemented from SearchEnvironment< NaryState, NaryAction >.
Definition at line 70 of file NaryTree.cpp.
References b.
|
private |
Definition at line 144 of file NaryTree.cpp.
References totalNodesAtDepth.
Referenced by GetLocation().
Definition at line 156 of file NaryTree.cpp.
References b.
|
virtual |
Implements SearchEnvironment< NaryState, NaryAction >.
Definition at line 95 of file NaryTree.cpp.
|
virtual |
Implements SearchEnvironment< NaryState, NaryAction >.
Definition at line 32 of file NaryTree.cpp.
References b, d, and GetDepth().
Referenced by Draw(), and OpenGLDraw().
Reimplemented from SearchEnvironment< NaryState, NaryAction >.
Definition at line 195 of file NaryTree.cpp.
References b, SearchEnvironment< NaryState, NaryAction >::GetColor(), and GetLocation().
|
inlinevirtual |
Goal Test if the goal is stored.
Reimplemented from SearchEnvironment< NaryState, NaryAction >.
Definition at line 51 of file NaryTree.h.
References SearchEnvironment< NaryState, NaryAction >::bValidSearchGoal, and SearchEnvironment< NaryState, NaryAction >::searchGoal.
Implements SearchEnvironment< NaryState, NaryAction >.
Definition at line 91 of file NaryTree.cpp.
|
inlinevirtual |
Heuristic value between node and the stored goal.
Asserts that the goal is stored
Reimplemented from SearchEnvironment< NaryState, NaryAction >.
Definition at line 43 of file NaryTree.h.
References SearchEnvironment< NaryState, NaryAction >::bValidSearchGoal, HCost(), and SearchEnvironment< NaryState, NaryAction >::searchGoal.
Heuristic value between two arbitrary nodes.
Implements SearchEnvironment< NaryState, NaryAction >.
Definition at line 84 of file NaryTree.cpp.
Referenced by HCost().
|
virtual |
Implements SearchEnvironment< NaryState, NaryAction >.
Definition at line 80 of file NaryTree.cpp.
|
virtual |
Definition at line 163 of file NaryTree.cpp.
References GetLocation(), GetSuccessors(), and totalNodesAtDepth.
|
virtual |
Reimplemented from SearchEnvironment< NaryState, NaryAction >.
Definition at line 183 of file NaryTree.cpp.
References b, d, DrawSphere(), SearchEnvironment< NaryState, NaryAction >::GetColor(), GetDepth(), GetLocation(), min(), and nodesAtDepth.
|
virtual |
Reimplemented from SearchEnvironment< NaryState, NaryAction >.
Definition at line 285 of file NaryTree.cpp.
Draw the transition at some percentage 0...1 between two states.
Reimplemented from SearchEnvironment< NaryState, NaryAction >.
Definition at line 284 of file NaryTree.cpp.
|
inline |
Definition at line 58 of file NaryTree.h.
References scaleWidth.
|
private |
Definition at line 78 of file NaryTree.h.
Referenced by ApplyAction(), GetActionHash(), GetActions(), GetBranchingFactor(), GetDepth(), GetNextState(), GetParent(), GetSuccessors(), GLDrawLine(), NaryTree(), and OpenGLDraw().
|
private |
Definition at line 78 of file NaryTree.h.
Referenced by GetActions(), GetLocation(), GetSuccessors(), NaryTree(), and OpenGLDraw().
|
private |
Definition at line 79 of file NaryTree.h.
Referenced by GetDepthRadius(), GetLocation(), NaryTree(), and OpenGLDraw().
|
private |
Definition at line 81 of file NaryTree.h.
Referenced by GetLocation(), NaryTree(), and SetWidthScale().
|
private |
Definition at line 80 of file NaryTree.h.
Referenced by Draw(), GetClosestNode(), GetLastNode(), GetOffset(), NaryTree(), and OpenGLDraw().