Skip to content

Commit

Permalink
Merge pull request RatInABox-Lab#29 from TomGeorge1234/1.x
Browse files Browse the repository at this point in the history
Various merges made into 1.x
  • Loading branch information
TomGeorge1234 authored Mar 16, 2023
2 parents 7e9cb2d + e032f7a commit 75c3444
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ratinabox/Environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ def sample_positions(self, n=10, method="uniform_jitter"):
elif self.dimensionality == "2D":

if method == "random":
positions = np.random.uniform(size=(n, 2))
positions[:, 0] *= self.extent[1] - self.extent[0]
positions[:, 1] *= self.extent[3] - self.extent[2]
positions = np.zeros((n, 2))
positions[:, 0] = np.random.uniform(self.extent[0], self.extent[1], size=n)
positions[:, 1] = np.random.uniform(self.extent[2], self.extent[3], size=n)
elif method[:7] == "uniform":
ex = self.extent
area = (ex[1] - ex[0]) * (ex[3] - ex[2])
Expand Down

0 comments on commit 75c3444

Please sign in to comment.