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

#include <CartPole.hh>

Inheritance diagram for CartPole:
Inheritance graph

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 LENGTH
const bool noisy
float & poleAngle
float & poleVel
float RAD_T_DEG
std::vector< float > s
float TAU

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]

Definition at line 53 of file CartPole.hh.

Constructor & Destructor Documentation

Creates a deterministic CartPole domain.

randRandom number generator used solely for random initial states.

Definition at line 9 of file

CartPole::CartPole ( Random rand,
bool  stochastic 

Creates a Cart-Pole domain, possibly with noise.

randRandom number generator
stochasticnoisy transitions?

Definition at line 23 of file

CartPole::~CartPole ( ) [virtual]

Definition at line 36 of file

Member Function Documentation

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

Implements Environment.

Definition at line 105 of file

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

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

Implements Environment.

Definition at line 223 of file

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

Implements Environment.

Definition at line 243 of file

int CartPole::getNumActions ( ) [virtual]

Implements Environment.

Definition at line 169 of file

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

Reimplemented from Environment.

Definition at line 184 of file

void CartPole::reset ( void  ) [virtual]

Implements Environment.

Definition at line 137 of file

float CartPole::reward ( ) [private]

Definition at line 119 of file

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

Implements Environment.

Definition at line 38 of file

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

Set the state vector (for debug purposes)

Reimplemented from Environment.

Definition at line 174 of file

bool CartPole::terminal ( ) const [virtual]

Implements Environment.

Definition at line 130 of file

float CartPole::transition ( float  force)

Calculate the new state and reward for the given force

Definition at line 45 of file

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:

autogenerated on Thu Jun 6 2019 22:00:24