Implementation of Continuous Mountain Car task. More...
Classes | |
struct | Action |
Implementation of action of Continuous Mountain Car. More... | |
class | State |
Implementation of state of Continuous Mountain Car. More... | |
Public Member Functions | |
ContinuousMountainCar (const double positionMin=-1.2, const double positionMax=0.6, const double positionGoal=0.45, const double velocityMin=-0.07, const double velocityMax=0.07, const double duration=0.0015, const double doneReward=100, const size_t maxSteps=0) | |
Construct a Continuous Mountain Car instance using the given constant. More... | |
State | InitialSample () |
Initial position is randomly generated within [-0.6, -0.4]. More... | |
bool | IsTerminal (const State &state) const |
Whether given state is a terminal state. More... | |
size_t | MaxSteps () const |
Get the maximum number of steps allowed. More... | |
size_t & | MaxSteps () |
Set the maximum number of steps allowed. More... | |
double | Sample (const State &state, const Action &action, State &nextState) |
Dynamics of Continuous Mountain Car. More... | |
double | Sample (const State &state, const Action &action) |
Dynamics of Continuous Mountain Car. More... | |
size_t | StepsPerformed () const |
Get the number of steps performed. More... | |
Implementation of Continuous Mountain Car task.
Definition at line 29 of file continuous_mountain_car.hpp.
|
inline |
Construct a Continuous Mountain Car instance using the given constant.
positionMin | Minimum legal position. |
positionMax | Maximum legal position. |
positionGoal | Final target position. |
velocityMin | Minimum legal velocity. |
velocityMax | Maximum legal velocity. |
duration | Time Duration for which force is applied on the car. |
doneReward | Reward recieved by the agent on success. |
maxSteps | The number of steps after which the episode terminates. If the value is 0, there is no limit. |
Definition at line 105 of file continuous_mountain_car.hpp.
|
inline |
Initial position is randomly generated within [-0.6, -0.4].
Initial velocity is 0.
Definition at line 185 of file continuous_mountain_car.hpp.
References ContinuousMountainCar::State::Position(), mlpack::math::Random(), and ContinuousMountainCar::State::Velocity().
|
inline |
Whether given state is a terminal state.
state | desired state. |
Definition at line 200 of file continuous_mountain_car.hpp.
References Log::Info, and ContinuousMountainCar::State::Position().
Referenced by ContinuousMountainCar::Sample().
|
inline |
Get the maximum number of steps allowed.
Definition at line 220 of file continuous_mountain_car.hpp.
|
inline |
Set the maximum number of steps allowed.
Definition at line 222 of file continuous_mountain_car.hpp.
Dynamics of Continuous Mountain Car.
Get reward and next state based on current state and current action.
state | The current state. |
action | The current action. |
nextState | The next state. |
Definition at line 132 of file continuous_mountain_car.hpp.
References ContinuousMountainCar::Action::action, mlpack::math::ClampRange(), ContinuousMountainCar::IsTerminal(), ContinuousMountainCar::State::Position(), and ContinuousMountainCar::State::Velocity().
Referenced by ContinuousMountainCar::Sample().
Dynamics of Continuous Mountain Car.
Get reward based on current state and current action.
state | The current state. |
action | The current action. |
Definition at line 173 of file continuous_mountain_car.hpp.
References ContinuousMountainCar::Sample().
|
inline |
Get the number of steps performed.
Definition at line 217 of file continuous_mountain_car.hpp.