From a4d360f474d69b3be2c62b891804eec0952c9913 Mon Sep 17 00:00:00 2001 From: sp Date: Sat, 10 Feb 2024 12:38:18 +0100 Subject: [PATCH] do not allowed movement when shield is empty --- examples/shields/rl/sb3utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/shields/rl/sb3utils.py b/examples/shields/rl/sb3utils.py index 25b7c51..c2aa564 100644 --- a/examples/shields/rl/sb3utils.py +++ b/examples/shields/rl/sb3utils.py @@ -24,7 +24,7 @@ class MiniGridSbShieldingWrapper(gym.core.Wrapper): try: return self.shield[self.env.get_symbolic_state()] except: - return [1.0] * 3 + [1.0] * 4 + return [0.0] * 3 + [1.0] * 4 def reset(self, *, seed=None, options=None): obs, infos = self.env.reset(seed=seed, options=options)