Skip to content

Commit

Permalink
Fix negative value sampling in MultiDiscrete with non-zero start (#562)
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Towers <[email protected]>
  • Loading branch information
Rayerdyne and pseudo-rnd-thoughts authored Jul 3, 2023
1 parent f399319 commit 6126e5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gymnasium/spaces/multi_discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ def _apply_mask(

return np.array(_apply_mask(mask, self.nvec, self.start), dtype=self.dtype)

return (self.np_random.random(self.nvec.shape) * self.nvec + self.start).astype(
return (self.np_random.random(self.nvec.shape) * self.nvec).astype(
self.dtype
)
) + self.start

def contains(self, x: Any) -> bool:
"""Return boolean specifying if x is a valid member of this space."""
Expand Down

0 comments on commit 6126e5f

Please sign in to comment.