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

#include <CartPole.hh>

Inheritance diagram for CartPole:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual float apply (int action)
 CartPole (Random &rand)
 CartPole (Random &rand, bool stochastic)
experience getExp (float s0, float s1, float s2, float s3, 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 ()
virtual void reset ()
virtual const std::vector
< float > & 
sensation () const
void setSensation (std::vector< float > newS)
virtual bool terminal () const
float transition (float force)
virtual ~CartPole ()

Protected Types

enum  car_action_t { LEFT, RIGHT }

Private Member Functions

float reward ()

Private Attributes

float & cartPos
float & cartVel
float DEG_T_RAD
float FORCE_MAG
float FOURTHIRDS
float GRAVITY
float LENGTH
float MASSCART
float MASSPOLE
const bool noisy
float & poleAngle
float POLEMASS_LENGTH
float & poleVel
float RAD_T_DEG
Randomrng
std::vector< float > s
float TAU
float TOTAL_MASS

Detailed Description

This class defines the Cart-Pole balancing domain.

Definition at line 14 of file CartPole.hh.


Member Enumeration Documentation

enum CartPole::car_action_t [protected]
Enumerator:
LEFT 
RIGHT 

Definition at line 53 of file CartPole.hh.


Constructor & Destructor Documentation

Creates a deterministic CartPole domain.

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

Definition at line 9 of file CartPole.cc.

CartPole::CartPole ( Random rand,
bool  stochastic 
)

Creates a Cart-Pole domain, possibly with noise.

Parameters:
randRandom number generator
stochasticnoisy transitions?

Definition at line 23 of file CartPole.cc.

CartPole::~CartPole ( ) [virtual]

Definition at line 36 of file CartPole.cc.


Member Function Documentation

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

Implements Environment.

Definition at line 105 of file CartPole.cc.

experience CartPole::getExp ( float  s0,
float  s1,
float  s2,
float  s3,
int  a 
)

Get an experience for the given state-action

Definition at line 201 of file CartPole.cc.

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

Implements Environment.

Definition at line 223 of file CartPole.cc.

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

Implements Environment.

Definition at line 243 of file CartPole.cc.

int CartPole::getNumActions ( ) [virtual]

Implements Environment.

Definition at line 169 of file CartPole.cc.

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

Reimplemented from Environment.

Definition at line 184 of file CartPole.cc.

void CartPole::reset ( void  ) [virtual]

Implements Environment.

Definition at line 137 of file CartPole.cc.

float CartPole::reward ( ) [private]

Definition at line 119 of file CartPole.cc.

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

Implements Environment.

Definition at line 38 of file CartPole.cc.

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

Set the state vector (for debug purposes)

Reimplemented from Environment.

Definition at line 174 of file CartPole.cc.

bool CartPole::terminal ( ) const [virtual]

Implements Environment.

Definition at line 130 of file CartPole.cc.

float CartPole::transition ( float  force)

Calculate the new state and reward for the given force

Definition at line 45 of file CartPole.cc.


Member Data Documentation

float& CartPole::cartPos [private]

Definition at line 76 of file CartPole.hh.

float& CartPole::cartVel [private]

Definition at line 77 of file CartPole.hh.

float CartPole::DEG_T_RAD [private]

Definition at line 68 of file CartPole.hh.

float CartPole::FORCE_MAG [private]

Definition at line 64 of file CartPole.hh.

float CartPole::FOURTHIRDS [private]

Definition at line 67 of file CartPole.hh.

float CartPole::GRAVITY [private]

Definition at line 57 of file CartPole.hh.

float CartPole::LENGTH [private]

Definition at line 61 of file CartPole.hh.

float CartPole::MASSCART [private]

Definition at line 58 of file CartPole.hh.

float CartPole::MASSPOLE [private]

Definition at line 59 of file CartPole.hh.

const bool CartPole::noisy [private]

Definition at line 71 of file CartPole.hh.

float& CartPole::poleAngle [private]

Definition at line 78 of file CartPole.hh.

float CartPole::POLEMASS_LENGTH [private]

Definition at line 63 of file CartPole.hh.

float& CartPole::poleVel [private]

Definition at line 79 of file CartPole.hh.

float CartPole::RAD_T_DEG [private]

Definition at line 69 of file CartPole.hh.

Random& CartPole::rng [private]

Definition at line 72 of file CartPole.hh.

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

Definition at line 74 of file CartPole.hh.

float CartPole::TAU [private]

Definition at line 65 of file CartPole.hh.

float CartPole::TOTAL_MASS [private]

Definition at line 60 of file CartPole.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