Learn R Programming

reinforcelearn (version 0.2.1)

MountainCar: Mountain Car

Description

The classical mountain car problem for reinforcement learning.

Arguments

...

[any] Arguments passed on to makeEnvironment.

Format

An object of class R6ClassGenerator of length 24.

Usage

makeEnvironment("MountainCar", ...) makeEnvironment("MountainCarContinuous", ...)

Methods

  • $step(action) Take action in environment. Returns a list with state, reward, done.

  • $reset() Resets the done flag of the environment and returns an initial state. Useful when starting a new episode.

  • $visualize() Visualizes the environment (if there is a visualization function).

Details

The classical Mountain Car task the action is one of 0, 1, 2, in the continuous version the action is in [-1, 1].

Examples

Run this code
# NOT RUN {
env = makeEnvironment("mountain.car")
env$reset()
env$step(1L)

env = makeEnvironment("mountain.car.continuous")
env$reset()
env$step(0.62)
# }

Run the code above in your browser using DataLab