mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-07-31 13:54:31 +00:00
Update URL links and Space documentation summaries (#18)
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
# Spaces
|
||||
|
||||
```{toctree}
|
||||
:hidden:
|
||||
spaces/fundamental
|
||||
spaces/composite
|
||||
spaces/utils
|
||||
```
|
||||
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Space
|
||||
```
|
||||
@@ -28,77 +36,30 @@ Each space implements the following functions:
|
||||
|
||||
## Fundamental Spaces
|
||||
|
||||
### Box
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Box
|
||||
.. currentmodule:: gymnasium.spaces
|
||||
|
||||
.. automethod:: is_bounded
|
||||
.. automethod:: sample
|
||||
```
|
||||
|
||||
### Discrete
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Discrete
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
||||
|
||||
### MultiBinary
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.MultiBinary
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
||||
|
||||
### MultiDiscrete
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.MultiDiscrete
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
||||
|
||||
### Text
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Text
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
||||
* :py:class:`Box` - Supports continuous (and discrete) vectors or matrices, used for vector observations, images, etc
|
||||
* :py:class:`Discrete` - Supports a single discrete number of values with an optional start for the values
|
||||
* :py:class:`MultiDiscrete` - Supports single or matrices of binary values, used for holding down a button or if an agent has an object
|
||||
* :py:class:`MultiBinary` - Supports multiple discrete values with multiple axes, used for controller actions
|
||||
* :py:class:`Text` - Supports strings, used for passing agent messages, mission details, etc
|
||||
```
|
||||
|
||||
## Composite Spaces
|
||||
|
||||
### Dict
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Dict
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
||||
|
||||
### Graph
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Graph
|
||||
|
||||
.. automethod:: sample
|
||||
* :py:class:`Dict` - Supports a dictionary of keys and subspaces, used for a fixed number of unordered spaces
|
||||
* :py:class:`Tuple` - Supports a tuple of subspaces, used for multiple for a fixed number of ordered spaces
|
||||
* :py:class:`Sequence` - Supports a variable number of instances of a single subspace, used for entities spaces or selecting a variable number of actions
|
||||
* :py:class:`Graph` - Supports graph based actions or observations with discrete or continuous nodes and edge values.
|
||||
```
|
||||
|
||||
### Sequence
|
||||
## Utils
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Sequence
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
||||
|
||||
### Tuple
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Tuple
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
||||
* :py:class:`utils.flatdim` - The number of dimensions the flattened space will contain
|
||||
* :py:class:`utils.flatten_space` - Flattens a space for which the `flattened` space instances will contain
|
||||
* :py:class:`utils.flatten` - Flattens an instance of a space that is contained within the flattened version of the space
|
||||
* :py:class:`utils.unflatten` - The reverse of the `flatten_space` function
|
||||
```
|
||||
|
33
docs/api/spaces/composite.md
Normal file
33
docs/api/spaces/composite.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Composite Spaces
|
||||
|
||||
## Dict
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Dict
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
||||
|
||||
## Tuple
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Tuple
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
||||
|
||||
## Sequence
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Sequence
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
||||
|
||||
## Graph
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Graph
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
46
docs/api/spaces/fundamental.md
Normal file
46
docs/api/spaces/fundamental.md
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: Fundamental Spaces
|
||||
---
|
||||
|
||||
# Fundamental Spaces
|
||||
|
||||
## Box
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Box
|
||||
|
||||
.. automethod:: is_bounded
|
||||
.. automethod:: sample
|
||||
```
|
||||
|
||||
## Discrete
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Discrete
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
||||
|
||||
## MultiBinary
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.MultiBinary
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
||||
|
||||
## MultiDiscrete
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.MultiDiscrete
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
||||
|
||||
## Text
|
||||
|
||||
```{eval-rst}
|
||||
.. autoclass:: gymnasium.spaces.Text
|
||||
|
||||
.. automethod:: sample
|
||||
```
|
@@ -51,7 +51,7 @@ There are three common things you might want a wrapper to do:
|
||||
Such wrappers can be easily implemented by inheriting from `ActionWrapper`, `ObservationWrapper`, or `RewardWrapper` and implementing the
|
||||
respective transformation. If you need a wrapper to do more complicated tasks, you can inherit from the `Wrapper` class directly.
|
||||
The code that is presented in the following sections can also be found in
|
||||
the [gymnasium-examples](https://github.com/Farama-Foundation/gymnasium-examples) repository
|
||||
the [gym-examples](https://github.com/Farama-Foundation/gym-examples) repository
|
||||
|
||||
## ActionWrapper
|
||||
If you would like to apply a function to the action before passing it to the base environment,
|
||||
|
Reference in New Issue
Block a user