GymEnvironment: Gym Environment

GymEnvironmentR Documentation

Gym Environment

Description

Reinforcement learning environment from OpenAI Gym.

Arguments

gym.name

[character(1)]
Name of gym environment, e.g. "CartPole-v0".

...

[any]
Arguments passed on to makeEnvironment.

Details

For available gym environments take a look at https://gym.openai.com/envs.

Usage

makeEnvironment("gym", gym.name, ...)

Installation

For installation of the python package gym see https://github.com/openai/gym#installation. Then install the R package reticulate.

Methods

  • $close() Close visualization window.

  • $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).

Examples

## Not run: 
# Create an OpenAI Gym environment.
# Make sure you have Python, gym and reticulate installed.
env = makeEnvironment("gym", gym.name = "MountainCar-v0")
env$reset()
env$close()

## End(Not run)

markdumke/reinforcelearn documentation built on Nov. 17, 2022, 12:53 a.m.