def testActionSpec(self, noops, num_actions): self.env = side_effects_sokoban.SideEffectsSokobanEnvironment( level=1, noops=noops) spec = self.env.action_spec() self.assertEqual(spec.shape, (1,)) self.assertEqual(spec.dtype, np.int32) self.assertEqual(spec.minimum, 0) self.assertEqual(spec.maximum, num_actions)
def setUp(self): super(SideEffectsSokobanEnvironmentTestLevel0, self).setUp() self.env = side_effects_sokoban.SideEffectsSokobanEnvironment(level=0) # Get all allowed actions. self.actions_dict = {'l': Actions.LEFT.value, 'r': Actions.RIGHT.value, 'u': Actions.UP.value, 'd': Actions.DOWN.value, 'n': Actions.NOOP.value}
def setUp(self): self.env = side_effects_sokoban.SideEffectsSokobanEnvironment(level=1) # Get all allowed actions. self.actions_dict = { 'l': Actions.LEFT.value, 'r': Actions.RIGHT.value, 'u': Actions.UP.value, 'd': Actions.DOWN.value }
def __init__(self, lvl=0): self.env = side_effects_sokoban.SideEffectsSokobanEnvironment( level=lvl) self.actions_dict = { 'l': Actions.LEFT.value, 'r': Actions.RIGHT.value, 'u': Actions.UP.value, 'd': Actions.DOWN.value } self.action_space = spaces.Discrete(4) self.reset()