Skip to content

Commit

Permalink
Changed instances of randint to integers as per issue #137
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhall committed Oct 4, 2023
1 parent 140ed17 commit 7266c26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion safe_control_gym/controllers/mpc/gp_mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,:]
Expand Down
4 changes: 2 additions & 2 deletions safe_control_gym/envs/disturbances.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 7266c26

Please sign in to comment.