From 7266c2603b4fb3c9dcfb0592d7a01a351fbf2c03 Mon Sep 17 00:00:00 2001 From: Adam Hall Date: Wed, 4 Oct 2023 15:41:39 -0400 Subject: [PATCH] Changed instances of randint to integers as per issue #137 --- safe_control_gym/controllers/mpc/gp_mpc.py | 2 +- safe_control_gym/envs/disturbances.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/safe_control_gym/controllers/mpc/gp_mpc.py b/safe_control_gym/controllers/mpc/gp_mpc.py index 6d36aed3e..d19529322 100644 --- a/safe_control_gym/controllers/mpc/gp_mpc.py +++ b/safe_control_gym/controllers/mpc/gp_mpc.py @@ -712,7 +712,7 @@ def learn(self, self.train_iterations + validation_iterations, random_state=self.seed) input_samples = np.array(input_samples) # not being used currently - seeds = self.env.np_random.randint(0, 99999, size=self.train_iterations + validation_iterations) + seeds = self.env.np_random.integers(0, 99999, size=self.train_iterations + validation_iterations) for i in range(self.train_iterations + validation_iterations): # For random initial state training. #init_state = init_state_samples[i,:] diff --git a/safe_control_gym/envs/disturbances.py b/safe_control_gym/envs/disturbances.py index c27d2a66c..2f58b8f03 100644 --- a/safe_control_gym/envs/disturbances.py +++ b/safe_control_gym/envs/disturbances.py @@ -100,7 +100,7 @@ def reset(self, env ): if self.step_offset is None: - self.current_step_offset = self.np_random.randint(self.max_step) + self.current_step_offset = self.np_random.integers(self.max_step) else: self.current_step_offset = self.step_offset self.current_peak_step = int(self.current_step_offset + self.duration / 2) @@ -146,7 +146,7 @@ def reset(self, env ): if self.step_offset is None: - self.current_step_offset = self.np_random.randint(self.max_step) + self.current_step_offset = self.np_random.integers(self.max_step) else: self.current_step_offset = self.step_offset