📜  open ai gym - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:06.595000             🧑  作者: Mango

代码示例1
import gym
env = gym.make("CartPole-v1")
observation = env.reset()
for _ in range(1000):
  env.render()
  action = env.action_space.sample() # your agent here (this takes random actions)
  observation, reward, done, info = env.step(action)

  if done:
    observation = env.reset()
env.close()