Skip to content

Commit

Permalink
Merge pull request #8 from rradules/hotfix/remove-orderenforcing-from…
Browse files Browse the repository at this point in the history
…-conversions

Remove order enforcing
  • Loading branch information
ffelten authored Oct 24, 2023
2 parents 852953d + 61f0764 commit 59c3ce7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 0 additions & 3 deletions momadm_benchmarks/envs/beach_domain/beach_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ def env(**kwargs):
env = raw_env(**kwargs)
# this wrapper helps error handling for discrete action spaces
env = wrappers.AssertOutOfBoundsWrapper(env)
# Provides a wide vareity of helpful user errors
# Strongly recommended
env = wrappers.OrderEnforcingWrapper(env)
return env


Expand Down
6 changes: 2 additions & 4 deletions momadm_benchmarks/utils/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
parallel_to_aec_wrapper,
)
from pettingzoo.utils.env import AECEnv, ParallelEnv
from pettingzoo.utils.wrappers import OrderEnforcingWrapper

from momadm_benchmarks.utils.env import MOAECEnv, MOParallelEnv

Expand All @@ -23,7 +22,7 @@ def mo_aec_to_parallel(aec_env: AECEnv) -> ParallelEnv:
In the case of an existing parallel environment wrapped using a `parallel_to_aec_wrapper`, this function will return the original parallel environment.
Otherwise, it will apply the `aec_to_parallel_wrapper` to convert the environment.
"""
if isinstance(aec_env, OrderEnforcingWrapper) and isinstance(aec_env.env, parallel_to_aec_wrapper):
if isinstance(aec_env.env, parallel_to_aec_wrapper):
return aec_env.env.env
else:
par_env = mo_aec_to_parallel_wrapper(aec_env)
Expand All @@ -40,8 +39,7 @@ def mo_parallel_to_aec(par_env: ParallelEnv) -> AECEnv:
return par_env.aec_env
else:
aec_env = mo_parallel_to_aec_wrapper(par_env)
ordered_env = OrderEnforcingWrapper(aec_env)
return ordered_env
return aec_env


class mo_aec_to_parallel_wrapper(aec_to_parallel_wrapper, MOParallelEnv):
Expand Down

0 comments on commit 59c3ce7

Please sign in to comment.