Public Member Functions | Protected Types | Private Member Functions | Private Attributes
MountainCar Class Reference

#include <MountainCar.hh>

Inheritance diagram for MountainCar:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual float apply (int action)
experience getExp (float s0, float s1, int a)
virtual void getMinMaxFeatures (std::vector< float > *minFeat, std::vector< float > *maxFeat)
virtual void getMinMaxReward (float *minR, float *maxR)
virtual int getNumActions ()
virtual std::vector< experiencegetSeedings ()
 MountainCar (Random &rand)
 MountainCar (Random &rand, bool stochastic, bool lin, int delay)
virtual void reset ()
virtual const std::vector
< float > & 
sensation () const
void setSensation (std::vector< float > newS)
virtual bool terminal () const
virtual ~MountainCar ()

Protected Types

enum  car_action_t { REVERSE, ZERO, FORWARD }

Private Member Functions

float bound (float val, float min, float max)
float reward ()

Private Attributes

int delay
const bool linear
const bool noisy
float & pos
std::deque< float > posHistory
Randomrng
std::vector< float > s
float & vel
std::deque< float > velHistory

Detailed Description

This class defines the Mountain Car domain, with possible action delays or linearized transition dynamics.

Definition at line 18 of file MountainCar.hh.


Member Enumeration Documentation

enum MountainCar::car_action_t [protected]
Enumerator:
REVERSE 
ZERO 
FORWARD 

Definition at line 56 of file MountainCar.hh.


Constructor & Destructor Documentation

Creates a deterministic MountainCar domain.

Parameters:
randRandom number generator used solely for random initial states.

Definition at line 10 of file MountainCar.cc.

MountainCar::MountainCar ( Random rand,
bool  stochastic,
bool  lin,
int  delay 
)

Creates a Mountain Car domain.

Parameters:
randRandom number generator
stochasticif transitions are noisy
lincreate linearized transition dynamics
delay# of steps to delay state observations

Definition at line 24 of file MountainCar.cc.

Definition at line 37 of file MountainCar.cc.


Member Function Documentation

float MountainCar::apply ( int  action) [virtual]

Implements Environment.

Definition at line 45 of file MountainCar.cc.

float MountainCar::bound ( float  val,
float  min,
float  max 
) [private]

Definition at line 87 of file MountainCar.cc.

experience MountainCar::getExp ( float  s0,
float  s1,
int  a 
)

Get an experience for the given state-action

Definition at line 181 of file MountainCar.cc.

void MountainCar::getMinMaxFeatures ( std::vector< float > *  minFeat,
std::vector< float > *  maxFeat 
) [virtual]

Implements Environment.

Definition at line 204 of file MountainCar.cc.

void MountainCar::getMinMaxReward ( float *  minR,
float *  maxR 
) [virtual]

Implements Environment.

Definition at line 218 of file MountainCar.cc.

int MountainCar::getNumActions ( ) [virtual]

Implements Environment.

Definition at line 139 of file MountainCar.cc.

std::vector< experience > MountainCar::getSeedings ( ) [virtual]

Reimplemented from Environment.

Definition at line 154 of file MountainCar.cc.

void MountainCar::reset ( void  ) [virtual]

Implements Environment.

Definition at line 114 of file MountainCar.cc.

float MountainCar::reward ( ) [private]

Definition at line 96 of file MountainCar.cc.

const std::vector< float > & MountainCar::sensation ( ) const [virtual]

Implements Environment.

Definition at line 39 of file MountainCar.cc.

void MountainCar::setSensation ( std::vector< float >  newS) [virtual]

Set the state vector (for debug purposes)

Reimplemented from Environment.

Definition at line 144 of file MountainCar.cc.

bool MountainCar::terminal ( ) const [virtual]

Implements Environment.

Definition at line 107 of file MountainCar.cc.


Member Data Documentation

int MountainCar::delay [private]

Definition at line 71 of file MountainCar.hh.

const bool MountainCar::linear [private]

Definition at line 70 of file MountainCar.hh.

const bool MountainCar::noisy [private]

Definition at line 63 of file MountainCar.hh.

float& MountainCar::pos [private]

Definition at line 68 of file MountainCar.hh.

std::deque<float> MountainCar::posHistory [private]

Definition at line 60 of file MountainCar.hh.

Definition at line 64 of file MountainCar.hh.

std::vector<float> MountainCar::s [private]

Definition at line 66 of file MountainCar.hh.

float& MountainCar::vel [private]

Definition at line 69 of file MountainCar.hh.

std::deque<float> MountainCar::velHistory [private]

Definition at line 61 of file MountainCar.hh.


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


rl_env
Author(s):
autogenerated on Thu Jun 6 2019 22:00:24