Browse Source

do not allowed movement when shield is empty

refactoring
sp 10 months ago
parent
commit
a4d360f474
  1. 2
      examples/shields/rl/sb3utils.py

2
examples/shields/rl/sb3utils.py

@ -24,7 +24,7 @@ class MiniGridSbShieldingWrapper(gym.core.Wrapper):
try: try:
return self.shield[self.env.get_symbolic_state()] return self.shield[self.env.get_symbolic_state()]
except: except:
return [1.0] * 3 + [1.0] * 4
return [0.0] * 3 + [1.0] * 4
def reset(self, *, seed=None, options=None): def reset(self, *, seed=None, options=None):
obs, infos = self.env.reset(seed=seed, options=options) obs, infos = self.env.reset(seed=seed, options=options)

Loading…
Cancel
Save