예제 #1
0
파일: test_sac.py 프로젝트: hngenc/ray
 def __init__(self, config):
     if config.get("simplex_actions", False):
         self.action_space = Simplex((2, ))
     else:
         self.action_space = Box(0.0, 1.0, (1, ))
     self.observation_space = Box(0.0, 1.0, (1, ))
     self.max_steps = config.get("max_steps", 100)
     self.state = None
     self.steps = None
예제 #2
0
    def test_simplex_space(self):
        space = Simplex(shape=(3, 4), concentration=np.array((1, 2, 1)))

        d = gym_space_to_dict(space)
        sp = gym_space_from_dict(d)

        _assert_array_equal(self.assertEqual, space.shape, sp.shape)
        _assert_array_equal(self.assertAlmostEqual, space.concentration,
                            sp.concentration)
        self.assertEqual(space.dtype, sp.dtype)
예제 #3
0
 def _simplex(d: Dict) -> Simplex:
     return Simplex(**__common(d))