0

OpenAIuniverse是一个很棒的库,因为代码

# 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”环境,如何使用其他环境?

4

1 回答 1

0

只需转到此页面: https ://universe.openai.com/envs#flash_games

选择一个游戏,复制游戏名称:flashgames.HarvestDay-v0

并在您的代码中替换它: env = gym.make('flashgames.DuskDrive-v0')

于 2017-04-23T01:44:08.630 回答