#include <RobotCarVel.hh>
Public Member Functions | |
virtual float | apply (int action) |
float | bound (float val, float min, float max) |
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 () |
experience | getRandomVelSeed (float target) |
virtual std::vector< experience > | getSeedings () |
virtual void | reset () |
RobotCarVel (Random &rand, bool randomVel, bool upVel, bool tenToSix, bool lag) | |
virtual const std::vector < float > & | sensation () const |
void | setSensation (std::vector< float > newS) |
virtual bool | terminal () const |
virtual | ~RobotCarVel () |
Protected Types | |
enum | car_action_t { NOTHING, THROTTLE_UP, THROTTLE_DOWN, BRAKE_UP, BRAKE_DOWN } |
Private Attributes | |
int | actNum |
float | brakePosVel |
float & | brakeTarget |
float & | currVel |
std::vector< float > | hidden |
const bool | lag |
const bool | randomVel |
Random & | rng |
std::vector< float > | s |
float & | targetVel |
const bool | tenToSix |
float & | throttleTarget |
float & | trueBrake |
float & | trueThrottle |
const bool | upVel |
This class defines a domain that is a simulation of velocity control for the Austin Robot Technology autonomous vehicle.
Definition at line 20 of file RobotCarVel.hh.
enum RobotCarVel::car_action_t [protected] |
Definition at line 61 of file RobotCarVel.hh.
RobotCarVel::RobotCarVel | ( | Random & | rand, |
bool | randomVel, | ||
bool | upVel, | ||
bool | tenToSix, | ||
bool | lag | ||
) |
Creates a RobotCarVel domain.
rand | Random number generator |
randomVel | Use random starting and target velocities |
upVel | For specific velocity pair (not random), do target > starting vel |
tenToSix | Use 10 and 6 m/s for specific velocity pair, rather than 7 and 2 |
lag | Implements lag on the brake actuator to fully model the real vehicle. |
Definition at line 14 of file RobotCarVel.cc.
RobotCarVel::~RobotCarVel | ( | ) | [virtual] |
Definition at line 34 of file RobotCarVel.cc.
float RobotCarVel::apply | ( | int | action | ) | [virtual] |
Implements Environment.
Definition at line 40 of file RobotCarVel.cc.
float RobotCarVel::bound | ( | float | val, |
float | min, | ||
float | max | ||
) |
Bound a value between the given min and max.
Definition at line 302 of file RobotCarVel.cc.
experience RobotCarVel::getExp | ( | float | s0, |
float | s1, | ||
float | s2, | ||
float | s3, | ||
int | a | ||
) |
Get an example experience for the given state-action.
Definition at line 241 of file RobotCarVel.cc.
void RobotCarVel::getMinMaxFeatures | ( | std::vector< float > * | minFeat, |
std::vector< float > * | maxFeat | ||
) | [virtual] |
Implements Environment.
Definition at line 283 of file RobotCarVel.cc.
void RobotCarVel::getMinMaxReward | ( | float * | minR, |
float * | maxR | ||
) | [virtual] |
Implements Environment.
Definition at line 294 of file RobotCarVel.cc.
int RobotCarVel::getNumActions | ( | ) | [virtual] |
Implements Environment.
Definition at line 167 of file RobotCarVel.cc.
experience RobotCarVel::getRandomVelSeed | ( | float | target | ) |
Get an experience seed at a random velocity for the given target velocity.
Definition at line 229 of file RobotCarVel.cc.
std::vector< experience > RobotCarVel::getSeedings | ( | ) | [virtual] |
Reimplemented from Environment.
Definition at line 182 of file RobotCarVel.cc.
void RobotCarVel::reset | ( | void | ) | [virtual] |
Implements Environment.
Definition at line 130 of file RobotCarVel.cc.
const std::vector< float > & RobotCarVel::sensation | ( | ) | const [virtual] |
Implements Environment.
Definition at line 36 of file RobotCarVel.cc.
void RobotCarVel::setSensation | ( | std::vector< float > | newS | ) | [virtual] |
Set the state vector for debug purposes.
Reimplemented from Environment.
Definition at line 172 of file RobotCarVel.cc.
bool RobotCarVel::terminal | ( | ) | const [virtual] |
Implements Environment.
Definition at line 124 of file RobotCarVel.cc.
int RobotCarVel::actNum [private] |
Definition at line 83 of file RobotCarVel.hh.
float RobotCarVel::brakePosVel [private] |
Definition at line 82 of file RobotCarVel.hh.
float& RobotCarVel::brakeTarget [private] |
Definition at line 75 of file RobotCarVel.hh.
float& RobotCarVel::currVel [private] |
Definition at line 71 of file RobotCarVel.hh.
std::vector<float> RobotCarVel::hidden [private] |
Definition at line 68 of file RobotCarVel.hh.
const bool RobotCarVel::lag [private] |
Definition at line 80 of file RobotCarVel.hh.
const bool RobotCarVel::randomVel [private] |
Definition at line 77 of file RobotCarVel.hh.
Random& RobotCarVel::rng [private] |
Definition at line 65 of file RobotCarVel.hh.
std::vector<float> RobotCarVel::s [private] |
Definition at line 67 of file RobotCarVel.hh.
float& RobotCarVel::targetVel [private] |
Definition at line 70 of file RobotCarVel.hh.
const bool RobotCarVel::tenToSix [private] |
Definition at line 79 of file RobotCarVel.hh.
float& RobotCarVel::throttleTarget [private] |
Definition at line 74 of file RobotCarVel.hh.
float& RobotCarVel::trueBrake [private] |
Definition at line 73 of file RobotCarVel.hh.
float& RobotCarVel::trueThrottle [private] |
Definition at line 72 of file RobotCarVel.hh.
const bool RobotCarVel::upVel [private] |
Definition at line 78 of file RobotCarVel.hh.