Skip to content

Instantly share code, notes, and snippets.

@korymath
Created April 28, 2016 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save korymath/01e10f6dc7a440c97734419074266866 to your computer and use it in GitHub Desktop.
Save korymath/01e10f6dc7a440c97734419074266866 to your computer and use it in GitHub Desktop.
import gym
env = gym.make('CartPole-v0')
env.monitor.start('/tmp/cartpole-experiment-1', force=True)
for i_episode in xrange(101):
observation = env.reset()
for t in xrange(100):
env.render()
print observation
action = env.action_space.sample()
observation, reward, done, info = env.step(action)
if done:
print "Episode finished after {} timesteps".format(t+1)
break
env.monitor.close()
# Basic Random Cart Pole Performance
run the basic cart pole code in the tutorial
@korymath
Copy link
Author

Basic tutorial how-to for the cart pole domain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment