2022-05-10 17:18:06 +02:00
|
|
|
"""This module implements various spaces.
|
|
|
|
|
|
|
|
Spaces describe mathematical sets and are used in Gym to specify valid actions and observations.
|
|
|
|
Every Gym environment must have the attributes ``action_space`` and ``observation_space``.
|
|
|
|
If, for instance, three possible actions (0,1,2) can be performed in your environment and observations
|
|
|
|
are vectors in the two-dimensional unit cube, the environment code may contain the following two lines::
|
|
|
|
|
|
|
|
self.action_space = spaces.Discrete(3)
|
|
|
|
self.observation_space = spaces.Box(0, 1, shape=(2,))
|
|
|
|
"""
|
2016-05-30 18:07:59 -07:00
|
|
|
from gym.spaces.box import Box
|
2022-03-31 12:50:38 -07:00
|
|
|
from gym.spaces.dict import Dict
|
2016-05-30 18:07:59 -07:00
|
|
|
from gym.spaces.discrete import Discrete
|
2017-02-04 23:36:32 -08:00
|
|
|
from gym.spaces.multi_binary import MultiBinary
|
2022-03-31 12:50:38 -07:00
|
|
|
from gym.spaces.multi_discrete import MultiDiscrete
|
|
|
|
from gym.spaces.space import Space
|
2019-03-25 00:28:23 +01:00
|
|
|
from gym.spaces.tuple import Tuple
|
2022-03-31 12:50:38 -07:00
|
|
|
from gym.spaces.utils import flatdim, flatten, flatten_space, unflatten
|
2019-03-24 19:29:43 +01:00
|
|
|
|
2021-07-29 02:26:34 +02:00
|
|
|
__all__ = [
|
|
|
|
"Space",
|
|
|
|
"Box",
|
|
|
|
"Discrete",
|
|
|
|
"MultiDiscrete",
|
|
|
|
"MultiBinary",
|
|
|
|
"Tuple",
|
|
|
|
"Dict",
|
|
|
|
"flatdim",
|
|
|
|
"flatten_space",
|
|
|
|
"flatten",
|
|
|
|
"unflatten",
|
|
|
|
]
|