#include <MountainCar.hh>

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< experience > | getSeedings () |
| 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 |
| Random & | rng |
| std::vector< float > | s |
| float & | vel |
| std::deque< float > | velHistory |
This class defines the Mountain Car domain, with possible action delays or linearized transition dynamics.
Definition at line 18 of file MountainCar.hh.
enum MountainCar::car_action_t [protected] |
Definition at line 56 of file MountainCar.hh.
| MountainCar::MountainCar | ( | Random & | rand | ) |
Creates a deterministic MountainCar domain.
| rand | Random 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.
| rand | Random number generator |
| stochastic | if transitions are noisy |
| lin | create linearized transition dynamics |
| delay | # of steps to delay state observations |
Definition at line 24 of file MountainCar.cc.
| MountainCar::~MountainCar | ( | ) | [virtual] |
Definition at line 37 of file MountainCar.cc.
| 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.
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.
Random& MountainCar::rng [private] |
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.