OpenAI的universe
是一个很棒的库,因为代码
# coding: utf-8
import gym
import universe # register the universe environments
env = gym.make('flashgames.DuskDrive-v0')
env.configure(remotes=1) # automatically creates a local docker container
observation_n = env.reset()
while True:
action_n = [[('KeyEvent', 'ArrowUp', True)] for ob in observation_n] # your agent here
observation_n, reward_n, done_n, info = env.step(action_n)
env.render()
提供了“DuskDrive-v0”环境,我如何使用其他环境?
答案 0 :(得分:0)
转到此页面: https://universe.openai.com/envs#flash_games
选择游戏,复制游戏标题: flashgames.HarvestDay-V0
并在您的代码中替换它: env = gym.make(' flashgames.DuskDrive-v0')