From 908685b2f51a0eff1c6bb8438c0aaa9b8898aef9 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 28 Aug 2022 21:35:13 +0200 Subject: [PATCH] Fix: Random observation used wrong rng (now use numpy, not generating) --- columbus/observables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/columbus/observables.py b/columbus/observables.py index 3187a98..9d8348b 100644 --- a/columbus/observables.py +++ b/columbus/observables.py @@ -139,7 +139,7 @@ class RayObservable(Observable): self.rays = np.zeros((self.num_rays+self.include_rand, self.num_chans)) if self.include_rand: for c in range(self.num_chans): - self.rays[-1, c] = self.env.random() + self.rays[-1, c] = np.random.rand() for r, (hx, hy) in enumerate(self._get_ray_heads()): occ_dist = self.num_steps for c, entity_type in enumerate(self.chans): @@ -250,7 +250,7 @@ class StateObservable(Observable): obs.append(self.env.agent.speed[0]) obs.append(self.env.agent.speed[1]) if self.include_rand: - obs.append(self.env.random()) + obs.append(np.random.rand()) self.obs = obs return np.array(obs)