Browse Source

refactored has_key for python3

refactoring
sp 5 months ago
parent
commit
70c1e63107
  1. 2
      examples/shields/rl/sb3utils.py

2
examples/shields/rl/sb3utils.py

@ -36,7 +36,7 @@ class MiniGridSbShieldingWrapper(gym.core.Wrapper):
def step(self, action): def step(self, action):
obs, rew, done, truncated, info = self.env.step(action) obs, rew, done, truncated, info = self.env.step(action)
info["no_shield_action"] = not self.shield.has_key(self.env.get_symbolic_state())
info["no_shield_action"] = not self.shield.__contains__(self.env.get_symbolic_state())
return obs, rew, done, truncated, info return obs, rew, done, truncated, info
def parse_sb3_arguments(): def parse_sb3_arguments():

Loading…
Cancel
Save