Guest User

Untitled

a guest
Oct 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import gym
  2. env = gym.make('CartPole-v1')
  3. env.reset()
  4. for step_index in range(1000):
  5. env.render()
  6. action = env.action_space.sample()
  7. observation, reward, done, info = env.step(action)
  8. print("Step {}:".format(step_index))
  9. print("action: {}".format(action))
  10. print("observation: {}".format(observation))
  11. print("reward: {}".format(reward))
  12. print("done: {}".format(done))
  13. print("info: {}".format(info))
  14. if done:
  15. break
Add Comment
Please, Sign In to add comment