mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-09-25 09:16:39 +00:00
Fix sampling bug (#1761)
This commit is contained in:
@@ -99,7 +99,7 @@ class Box(Space):
|
||||
size=low_bounded[low_bounded].shape) + self.low[low_bounded]
|
||||
|
||||
sample[upp_bounded] = -self.np_random.exponential(
|
||||
size=upp_bounded[upp_bounded].shape) - self.high[upp_bounded]
|
||||
size=upp_bounded[upp_bounded].shape) + self.high[upp_bounded]
|
||||
|
||||
sample[bounded] = self.np_random.uniform(low=self.low[bounded],
|
||||
high=high[bounded],
|
||||
|
@@ -91,7 +91,7 @@ def test_sample(space):
|
||||
elif space.is_bounded("below"):
|
||||
expected_mean = 1 + space.low
|
||||
elif space.is_bounded("above"):
|
||||
expected_mean = -1 - space.high
|
||||
expected_mean = -1 + space.high
|
||||
else:
|
||||
expected_mean = 0.
|
||||
elif isinstance(space, Discrete):
|
||||
|
Reference in New Issue
Block a user