📄 mountaincarrand.txt
字号:
class MountainCarRand
Class that implements the randomized variant of the Mountain-Car task, based on the formulation from the book "Reinforcement Learning: An Introdunction" by R. Sutton & A. Borto". The implementation is based on the proposed standard C++ interface classes. This class inherits from the class MountainCar. Can be used as an implementation of the abstract base class Environment.
Synopsys: #include "mountain_car_rand.h"
Link: mountain_car_rand.cpp
mountain_car.cpp
sarepr.cpp
environment.cpp
random_numbers.cpp
Public methods:
class MountainCarRand(double ActVar=0, double PosVar=0)
Constructor. Creates an instance of the Randomized Mountain Car task, where actions (-1) and (+1) throttle have zero-mean Gaussian noise with variance ActVar and position state variable has zero-mean Gaussian noise with variance PosVar. Both arguments have defualt values zero. With zero variances, the task is equivalent to the original deterministic version.
void transition(const Action& action, State& s_new, double& r_new, bool& terminal)
Reimplements the corresponding function of the base class MountainCar and is an implementation of the corresponding pure virtual function of the base abstract class Environment.
Functionality:
Implements a transtion from CurrentState (base class' data member) in responce to the action specified by action argument. Zero-mean Gaussian noise is added to (-1) and (+1) throttle action and to the position state variable with variance that have been specified as arguments to the constructor of the object;
updates base class' data members CurrentState, CurrentAction and reward;
returns values to the agent
s_new - new state;
r_new - reward after performed transition;
terminal - an indication of whether the new state s_new is terminal (boolean true or false value).
~MountainCarRand()
Destructor.
All other functions of the base class MountainCar.
--------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -