HOG2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MountainCarEnvironment Class Reference

#include <MountainCar.h>

Inheritance diagram for MountainCarEnvironment:
Inheritance graph
[legend]
Collaboration diagram for MountainCarEnvironment:
Collaboration graph
[legend]

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< HeuristicTreeNodelookups
 
std::vector< Heuristic * > heuristics
 
uint64_t histogram [256]
 
- Protected Attributes inherited from SearchEnvironment< MountainCarState, MountainCarAction >
bool bValidSearchGoal
 
MountainCarState searchGoal
 
rgbColor color
 
GLfloat transparency
 

Detailed Description

Definition at line 30 of file MountainCar.h.

Constructor & Destructor Documentation

◆ MountainCarEnvironment()

MountainCarEnvironment::MountainCarEnvironment ( )

Member Function Documentation

◆ ApplyAction()

void MountainCarEnvironment::ApplyAction ( MountainCarState s,
MountainCarAction  a 
) const
virtual

◆ GCost() [1/2]

double MountainCarEnvironment::GCost ( const MountainCarState node,
const MountainCarAction act 
) const
virtual

◆ GCost() [2/2]

double MountainCarEnvironment::GCost ( const MountainCarState node1,
const MountainCarState node2 
) const
virtual

◆ GetAction()

MountainCarAction MountainCarEnvironment::GetAction ( const MountainCarState s1,
const MountainCarState s2 
) const
virtual

Reimplemented from SearchEnvironment< MountainCarState, MountainCarAction >.

Definition at line 44 of file MountainCar.cpp.

◆ GetActionHash()

uint64_t MountainCarEnvironment::GetActionHash ( MountainCarAction  act) const
virtual

◆ GetActions()

void MountainCarEnvironment::GetActions ( const MountainCarState nodeID,
std::vector< MountainCarAction > &  actions 
) const
virtual

◆ GetHeightAtPosition()

double MountainCarEnvironment::GetHeightAtPosition ( double  queryPosition) const
private

Definition at line 74 of file MountainCar.cpp.

References hillPeakFrequency.

Referenced by OpenGLDraw().

◆ GetNextState()

void MountainCarEnvironment::GetNextState ( const MountainCarState s1,
MountainCarAction  a,
MountainCarState s2 
) const
virtual

Reimplemented from SearchEnvironment< MountainCarState, MountainCarAction >.

Definition at line 88 of file MountainCar.cpp.

References ApplyAction().

◆ GetSlope()

double MountainCarEnvironment::GetSlope ( double  queryPosition) const
private

Definition at line 79 of file MountainCar.cpp.

References hillPeakFrequency.

Referenced by ApplyAction().

◆ GetStateHash()

uint64_t MountainCarEnvironment::GetStateHash ( const MountainCarState node) const
virtual

◆ GetSuccessors()

void MountainCarEnvironment::GetSuccessors ( const MountainCarState nodeID,
std::vector< MountainCarState > &  neighbors 
) const
virtual

◆ GoalTest() [1/2]

virtual bool MountainCarEnvironment::GoalTest ( const MountainCarState node) const
inlinevirtual

◆ GoalTest() [2/2]

bool MountainCarEnvironment::GoalTest ( const MountainCarState node,
const MountainCarState goal 
) const
virtual

◆ HCost() [1/2]

virtual double MountainCarEnvironment::HCost ( const MountainCarState node) const
inlinevirtual

◆ HCost() [2/2]

double MountainCarEnvironment::HCost ( const MountainCarState node1,
const MountainCarState node2 
) const
virtual

Heuristic value between two arbitrary nodes.

Implements SearchEnvironment< MountainCarState, MountainCarAction >.

Definition at line 101 of file MountainCar.cpp.

Referenced by HCost().

◆ InvertAction()

bool MountainCarEnvironment::InvertAction ( MountainCarAction a) const
virtual

◆ OpenGLDraw() [1/4]

void MountainCarEnvironment::OpenGLDraw ( ) const
virtual

Definition at line 129 of file MountainCar.cpp.

References GetHeightAtPosition(), maxPosition, and minPosition.

◆ OpenGLDraw() [2/4]

void MountainCarEnvironment::OpenGLDraw ( const MountainCarState ) const
virtual

Reimplemented from SearchEnvironment< MountainCarState, MountainCarAction >.

Definition at line 142 of file MountainCar.cpp.

◆ OpenGLDraw() [3/4]

void MountainCarEnvironment::OpenGLDraw ( const MountainCarState ,
const MountainCarAction  
) const
virtual

Reimplemented from SearchEnvironment< MountainCarState, MountainCarAction >.

Definition at line 144 of file MountainCar.cpp.

◆ OpenGLDraw() [4/4]

void MountainCarEnvironment::OpenGLDraw ( const MountainCarState ,
const MountainCarState ,
float   
) const
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.

Member Data Documentation

◆ accelerationFactor

double MountainCarEnvironment::accelerationFactor
private

Definition at line 76 of file MountainCar.h.

Referenced by ApplyAction(), and MountainCarEnvironment().

◆ goalPosition

double MountainCarEnvironment::goalPosition
private

Definition at line 75 of file MountainCar.h.

Referenced by GoalTest(), and MountainCarEnvironment().

◆ gravityFactor

double MountainCarEnvironment::gravityFactor
private

Definition at line 77 of file MountainCar.h.

Referenced by ApplyAction(), and MountainCarEnvironment().

◆ hillPeakFrequency

double MountainCarEnvironment::hillPeakFrequency
private

Definition at line 78 of file MountainCar.h.

Referenced by GetHeightAtPosition(), GetSlope(), and MountainCarEnvironment().

◆ maxPosition

double MountainCarEnvironment::maxPosition
private

Definition at line 72 of file MountainCar.h.

Referenced by ApplyAction(), MountainCarEnvironment(), and OpenGLDraw().

◆ maxVelocity

double MountainCarEnvironment::maxVelocity
private

Definition at line 74 of file MountainCar.h.

Referenced by ApplyAction(), and MountainCarEnvironment().

◆ minPosition

double MountainCarEnvironment::minPosition
private

Definition at line 71 of file MountainCar.h.

Referenced by ApplyAction(), MountainCarEnvironment(), and OpenGLDraw().

◆ minVelocity

double MountainCarEnvironment::minVelocity
private

Definition at line 73 of file MountainCar.h.

Referenced by ApplyAction(), and MountainCarEnvironment().


The documentation for this class was generated from the following files: