diff --git a/gym/spaces/box.py b/gym/spaces/box.py index 03aea7864..f12e0322e 100644 --- a/gym/spaces/box.py +++ b/gym/spaces/box.py @@ -7,6 +7,9 @@ class Box(gym.Space): """ A box in R^n. I.e., each coordinate is bounded. + + Example usage: + self.action_space = spaces.Box(low=-10, high=10, shape=(1,)) """ def __init__(self, low, high, shape=None): """ diff --git a/gym/spaces/discrete.py b/gym/spaces/discrete.py index f883a7d2e..92ad720bb 100644 --- a/gym/spaces/discrete.py +++ b/gym/spaces/discrete.py @@ -6,6 +6,9 @@ from gym.spaces import prng class Discrete(gym.Space): """ {0,1,...,n-1} + + Example usage: + self.observation_space = spaces.Discrete(2) """ def __init__(self, n): self.n = n diff --git a/gym/spaces/tuple_space.py b/gym/spaces/tuple_space.py index e0f392878..3985a6c98 100644 --- a/gym/spaces/tuple_space.py +++ b/gym/spaces/tuple_space.py @@ -3,6 +3,9 @@ from gym import Space class Tuple(Space): """ A tuple (i.e., product) of simpler spaces + + Example usage: + self.observation_space = spaces.Tuple((spaces.Discrete(2), spaces.Discrete(3))) """ def __init__(self, spaces): self.spaces = spaces