Created
August 4, 2018 18:26
-
-
Save AurelianTactics/d753699240e21d239ac0cdef2bf2521d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MultiEnv(gym.Env): | |
def __init__(self, env_config): | |
# pick actual env based on worker and env indexes | |
#print("worker index is {}".format(env_config.worker_index)) | |
#print("testing vector_index {}".format(env_config.vector_index)) | |
#BustAMove.Challengeplay0 | |
challenge_level = env_config.worker_index % 5 | |
self.env = sonic_on_ray.make(game='BustAMove-Snes', state='BustAMove.Challengeplay{}'.format(challenge_level)) #BustAMove.1pplay.Level10 | |
self.action_space = self.env.action_space | |
self.observation_space = self.env.observation_space | |
def reset(self): | |
return self.env.reset() | |
def step(self, action): | |
return self.env.step(action) | |
register_env("multienv", lambda c: MultiEnv(c)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment