Skip to content

Instantly share code, notes, and snippets.

@Danaze
Created Aug 25, 2020
Embed
What would you like to do?
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