From 46c64c90d051fde7739979f62fcab094f56d0429 Mon Sep 17 00:00:00 2001 From: Petros Christodoulou Date: Fri, 24 Jul 2020 22:22:41 +0100 Subject: [PATCH] fixed simplex initialisation seeding bug (#9660) Co-authored-by: Petros Christodoulou --- rllib/utils/spaces/simplex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rllib/utils/spaces/simplex.py b/rllib/utils/spaces/simplex.py index 94daed091..1e18f6aac 100644 --- a/rllib/utils/spaces/simplex.py +++ b/rllib/utils/spaces/simplex.py @@ -33,9 +33,10 @@ class Simplex(gym.Space): self.concentration = [1] * self.dim super().__init__(shape, dtype) - self.np_random = np.random.RandomState() def seed(self, seed=None): + if self.np_random is None: + self.np_random = np.random.RandomState() self.np_random.seed(seed) def sample(self):