HOG2
|
#include <MountainCar.h>
Public Member Functions | |
MountainCarEnvironment () | |
virtual void | GetSuccessors (const MountainCarState &nodeID, std::vector< MountainCarState > &neighbors) const |
virtual void | GetActions (const MountainCarState &nodeID, std::vector< MountainCarAction > &actions) const |
virtual MountainCarAction | GetAction (const MountainCarState &s1, const MountainCarState &s2) const |
virtual void | ApplyAction (MountainCarState &s, MountainCarAction a) const |
virtual void | GetNextState (const MountainCarState &, MountainCarAction, MountainCarState &) const |
virtual bool | InvertAction (MountainCarAction &a) const |
virtual double | HCost (const MountainCarState &node1, const MountainCarState &node2) const |
Heuristic value between two arbitrary nodes. More... | |
virtual double | HCost (const MountainCarState &node) const |
Heuristic value between node and the stored goal. More... | |
virtual double | GCost (const MountainCarState &node1, const MountainCarState &node2) const |
virtual double | GCost (const MountainCarState &node, const MountainCarAction &act) const |
virtual bool | GoalTest (const MountainCarState &node, const MountainCarState &goal) const |
virtual bool | GoalTest (const MountainCarState &node) const |
Goal Test if the goal is stored. More... | |
virtual uint64_t | GetStateHash (const MountainCarState &node) const |
virtual uint64_t | GetActionHash (MountainCarAction act) const |
virtual void | OpenGLDraw () const |
virtual void | OpenGLDraw (const MountainCarState &) const |
virtual void | OpenGLDraw (const MountainCarState &, const MountainCarState &, float) const |
Draw the transition at some percentage 0...1 between two states. More... | |
virtual void | OpenGLDraw (const MountainCarState &, const MountainCarAction &) const |
Public Member Functions inherited from SearchEnvironment< MountainCarState, MountainCarAction > | |
virtual | ~SearchEnvironment () |
virtual int | GetNumSuccessors (const MountainCarState &stateID) const |
virtual void | UndoAction (MountainCarState &s, MountainCarAction a) const |
virtual void | StoreGoal (MountainCarState &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 MountainCarState &node1, const MountainCarState &node2, double parentHCost) const |
virtual uint64_t | GetMaxHash () const |
virtual void | GetStateFromHash (uint64_t parent, MountainCarState &s) const |
virtual double | GetPathLength (std::vector< MountainCarState > &neighbors) |
virtual double | GetPathLength (const MountainCarState &start, std::vector< MountainCarAction > &neighbors) |
virtual OccupancyInterface< MountainCarState, MountainCarAction > * | GetOccupancyInfo () |
virtual void | SetOccupancyInfo (OccupancyInterface< MountainCarState, MountainCarAction > *) |
virtual void | OpenGLDraw () const |
virtual void | GLLabelState (const MountainCarState &, const char *) const |
virtual void | GLDrawLine (const MountainCarState &x, const MountainCarState &y) const |
virtual void | GLDrawPath (const std::vector< MountainCarState > &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 MountainCarState &) const |
virtual void | DrawLine (Graphics::Display &display, const MountainCarState &x, const MountainCarState &y, float width=1.0) const |
Public Member Functions inherited from Heuristic< MountainCarState > | |
Heuristic () | |
virtual | ~Heuristic () |
Private Member Functions | |
double | GetHeightAtPosition (double queryPosition) const |
double | GetSlope (double queryPosition) const |
Private Attributes | |
double | minPosition |
double | maxPosition |
double | minVelocity |
double | maxVelocity |
double | goalPosition |
double | accelerationFactor |
double | gravityFactor |
double | hillPeakFrequency |
Additional Inherited Members | |
Public Attributes inherited from Heuristic< MountainCarState > | |
std::vector< HeuristicTreeNode > | lookups |
std::vector< Heuristic * > | heuristics |
uint64_t | histogram [256] |
Protected Attributes inherited from SearchEnvironment< MountainCarState, MountainCarAction > | |
bool | bValidSearchGoal |
MountainCarState | searchGoal |
rgbColor | color |
GLfloat | transparency |
Definition at line 30 of file MountainCar.h.
MountainCarEnvironment::MountainCarEnvironment | ( | ) |
Definition at line 13 of file MountainCar.cpp.
References accelerationFactor, goalPosition, gravityFactor, hillPeakFrequency, maxPosition, maxVelocity, minPosition, and minVelocity.
|
virtual |
Implements SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 49 of file MountainCar.cpp.
References accelerationFactor, GetSlope(), gravityFactor, MountainCarState::loc, maxPosition, maxVelocity, minPosition, minVelocity, and MountainCarState::speed.
Referenced by GetNextState(), and GetSuccessors().
|
virtual |
Implements SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 109 of file MountainCar.cpp.
|
virtual |
Implements SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 104 of file MountainCar.cpp.
|
virtual |
Reimplemented from SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 44 of file MountainCar.cpp.
|
virtual |
Implements SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 124 of file MountainCar.cpp.
|
virtual |
Implements SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 36 of file MountainCar.cpp.
|
private |
Definition at line 74 of file MountainCar.cpp.
References hillPeakFrequency.
Referenced by OpenGLDraw().
|
virtual |
Reimplemented from SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 88 of file MountainCar.cpp.
References ApplyAction().
|
private |
Definition at line 79 of file MountainCar.cpp.
References hillPeakFrequency.
Referenced by ApplyAction().
|
virtual |
Implements SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 119 of file MountainCar.cpp.
|
virtual |
Implements SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 25 of file MountainCar.cpp.
References ApplyAction().
|
inlinevirtual |
Goal Test if the goal is stored.
Reimplemented from SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 57 of file MountainCar.h.
References SearchEnvironment< MountainCarState, MountainCarAction >::bValidSearchGoal, and SearchEnvironment< MountainCarState, MountainCarAction >::searchGoal.
|
virtual |
Implements SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 114 of file MountainCar.cpp.
References fgreater(), and goalPosition.
|
inlinevirtual |
Heuristic value between node and the stored goal.
Asserts that the goal is stored
Reimplemented from SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 49 of file MountainCar.h.
References SearchEnvironment< MountainCarState, MountainCarAction >::bValidSearchGoal, HCost(), and SearchEnvironment< MountainCarState, MountainCarAction >::searchGoal.
|
virtual |
Heuristic value between two arbitrary nodes.
Implements SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 101 of file MountainCar.cpp.
Referenced by HCost().
|
virtual |
Implements SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 94 of file MountainCar.cpp.
|
virtual |
Definition at line 129 of file MountainCar.cpp.
References GetHeightAtPosition(), maxPosition, and minPosition.
|
virtual |
Reimplemented from SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 142 of file MountainCar.cpp.
|
virtual |
Reimplemented from SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 144 of file MountainCar.cpp.
|
virtual |
Draw the transition at some percentage 0...1 between two states.
Reimplemented from SearchEnvironment< MountainCarState, MountainCarAction >.
Definition at line 143 of file MountainCar.cpp.
|
private |
Definition at line 76 of file MountainCar.h.
Referenced by ApplyAction(), and MountainCarEnvironment().
|
private |
Definition at line 75 of file MountainCar.h.
Referenced by GoalTest(), and MountainCarEnvironment().
|
private |
Definition at line 77 of file MountainCar.h.
Referenced by ApplyAction(), and MountainCarEnvironment().
|
private |
Definition at line 78 of file MountainCar.h.
Referenced by GetHeightAtPosition(), GetSlope(), and MountainCarEnvironment().
|
private |
Definition at line 72 of file MountainCar.h.
Referenced by ApplyAction(), MountainCarEnvironment(), and OpenGLDraw().
|
private |
Definition at line 74 of file MountainCar.h.
Referenced by ApplyAction(), and MountainCarEnvironment().
|
private |
Definition at line 71 of file MountainCar.h.
Referenced by ApplyAction(), MountainCarEnvironment(), and OpenGLDraw().
|
private |
Definition at line 73 of file MountainCar.h.
Referenced by ApplyAction(), and MountainCarEnvironment().