Skip to content

Instantly share code, notes, and snippets.

@Danaze
Created August 25, 2020 16:17
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 Danaze/044878390d41726990f9f179b7a47659 to your computer and use it in GitHub Desktop.
Save Danaze/044878390d41726990f9f179b7a47659 to your computer and use it in GitHub Desktop.
gym cartpole environment observations and actions
import numpy as np
import gym
env = gym.make("CartPole-v1")
# there are two actions
print("number of actions: " + np.str(env.action_space.n))
# check the observations bounds for each (position, velocity, angle, angular velocity)
for _ in range(4):
print (env.observation_space.high[_])
print (env.observation_space.low[_])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment