September 2018
Intermediate to advanced
296 pages
9h 10m
English
Any gym environment can be initialized and run by using a simple interface. Let's start by importing the gym library, as follows:
import gym
environment = gym.make('CartPole-v0')
environment.reset()
for dummy in range(100): environment.render() environment.step(environment.action_space.sample())
Also, change the action space at every step, to see CartPole moving. Running the preceding program should produce a visualization. The scene should start with a visualization, ...
Read now
Unlock full access