
Last chance! 50% off unlimited learning
Sale ends in
Reinforcement learning environment from OpenAI Gym.
[character(1)
]
Name of gym environment, e.g. "CartPole-v0"
.
[any
] Arguments passed on to makeEnvironment.
makeEnvironment("gym", gym.name, ...)
For installation of the python package gym
see
https://github.com/openai/gym#installation.
Then install the R package reticulate
.
$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).
For available gym environments take a look at https://gym.openai.com/envs.
# 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()
# }
Run the code above in your browser using DataLab