June 2018
Intermediate to advanced
318 pages
9h 24m
English
Let's see how to simulate a basic cart pole environment:
import gym
env = gym.make('CartPole-v0')
env.reset()
for _ in range(1000): env.render() env.step(env.action_space.sample())
The complete code is as follows:
import gym env = gym.make('CartPole-v0')env.reset() for _ in range(1000): env.render() env.step(env.action_space.sample())
If you run the preceding program, you can see the output, which shows the cart pole environment:
OpenAI Gym provides a lot of simulation ...
Read now
Unlock full access