Skip to content

Commit

Permalink
Revert files in openrl folder
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjuno committed Dec 20, 2023
1 parent 753fba7 commit 693d2e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
25 changes: 8 additions & 17 deletions openrl/envs/common/build_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,13 @@ def _make_env() -> Env:
new_kwargs["env_num"] = env_num
if id.startswith("ALE/") or id in gym.envs.registry.keys():
new_kwargs.pop("cfg", None)
if "envpool" in new_kwargs:
# for now envpool doesnt support any render mode
# envpool also doesnt stores the id anywhere
new_kwargs.pop("envpool")
env = make(
id,
**new_kwargs,
)
env.unwrapped.spec.id = id
else:
env = make(
id,
render_mode=env_render_mode,
disable_env_checker=_disable_env_checker,
**new_kwargs,
)

env = make(
id,
render_mode=env_render_mode,
disable_env_checker=_disable_env_checker,
**new_kwargs,
)

if wrappers is not None:
if callable(wrappers):
Expand All @@ -78,4 +69,4 @@ def _make_env() -> Env:
return _make_env

env_fns = [create_env(env_id, env_num, need_env_id) for env_id in range(env_num)]
return env_fns
return env_fns
3 changes: 2 additions & 1 deletion openrl/envs/common/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def make(
env_fns = make_single_agent_drone_envs(
id=id, env_num=env_num, render_mode=convert_render_mode, **kwargs
)

elif id.startswith("snakes_"):
from openrl.envs.snake import make_snake_envs

Expand Down Expand Up @@ -172,4 +173,4 @@ def make(
vec_info_class = VecInfoFactory.get_vec_info_class(vec_info_class, env)
env = VecMonitorWrapper(vec_info_class, env)

return env
return env

0 comments on commit 693d2e1

Please sign in to comment.