Skip to content
Snippets Groups Projects
Commit d13f6606 authored by Eric Hambro's avatar Eric Hambro
Browse files

Move wrappers to envs/

parent 23f06985
No related branches found
No related tags found
No related merge requests found
import aicrowd_gym
import nle
from gym.wrappers import TimeLimit from gym.wrappers import TimeLimit
from envs.nethack_make_function import nethack_make_fn
def create_env():
"""This is the environment that will be assessed by AIcrowd."""
return aicrowd_gym.make("NetHackChallenge-v0")
def addtimelimitwrapper_fn(): def addtimelimitwrapper_fn():
""" """
An example of how to add wrappers to the nethack_make_fn An example of how to add wrappers to the nethack_make_fn
Should return a gym env which wraps the nethack gym env Should return a gym env which wraps the nethack gym env
""" """
env = nethack_make_fn() env = create_env()
env = TimeLimit(env, max_episode_steps=10_000_000) env = TimeLimit(env, max_episode_steps=10_000_000)
return env return env
\ No newline at end of file
...@@ -2,7 +2,7 @@ from agents.random_batched_agent import RandomAgent ...@@ -2,7 +2,7 @@ from agents.random_batched_agent import RandomAgent
from agents.torchbeast_agent import TorchBeastAgent from agents.torchbeast_agent import TorchBeastAgent
# from agents.rllib_batched_agent import RLlibAgent # from agents.rllib_batched_agent import RLlibAgent
from submission_wrappers import addtimelimitwrapper_fn from envs.wrappers import addtimelimitwrapper_fn
################################################ ################################################
# Import your own agent code # # Import your own agent code #
...@@ -28,7 +28,7 @@ class SubmissionConfig: ...@@ -28,7 +28,7 @@ class SubmissionConfig:
## Add a function that creates your nethack env ## Add a function that creates your nethack env
## Mainly this is to add wrappers ## Mainly this is to add wrappers
## Add your wrappers to wrappers.py and change the name here ## Add your wrappers to envs/wrappers.py and change the name here
## IMPORTANT: Don't "call" the function, only provide the name ## IMPORTANT: Don't "call" the function, only provide the name
submission_env_make_fn = addtimelimitwrapper_fn submission_env_make_fn = addtimelimitwrapper_fn
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment