2022-09-13 20:27:34 +01:00
|
|
|
---
|
|
|
|
title: Vector
|
|
|
|
---
|
|
|
|
|
2023-12-22 14:48:22 +00:00
|
|
|
# Vectorize
|
2023-11-07 13:27:25 +00:00
|
|
|
|
|
|
|
```{toctree}
|
|
|
|
:hidden:
|
|
|
|
vector/wrappers
|
|
|
|
vector/async_vector_env
|
|
|
|
vector/sync_vector_env
|
|
|
|
vector/utils
|
|
|
|
```
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2022-10-12 15:58:01 +01:00
|
|
|
## Gymnasium.vector.VectorEnv
|
|
|
|
|
2022-09-13 20:27:34 +01:00
|
|
|
```{eval-rst}
|
2022-10-12 15:58:01 +01:00
|
|
|
.. autoclass:: gymnasium.vector.VectorEnv
|
|
|
|
```
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2022-10-12 15:58:01 +01:00
|
|
|
### Methods
|
|
|
|
```{eval-rst}
|
|
|
|
.. automethod:: gymnasium.vector.VectorEnv.step
|
2023-12-22 14:48:22 +00:00
|
|
|
.. automethod:: gymnasium.vector.VectorEnv.reset
|
|
|
|
.. automethod:: gymnasium.vector.VectorEnv.render
|
2022-10-12 15:58:01 +01:00
|
|
|
.. automethod:: gymnasium.vector.VectorEnv.close
|
|
|
|
```
|
|
|
|
|
|
|
|
### Attributes
|
2022-09-13 20:27:34 +01:00
|
|
|
|
|
|
|
```{eval-rst}
|
2023-11-07 13:27:25 +00:00
|
|
|
.. autoattribute:: gymnasium.vector.VectorEnv.num_envs
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
The number of sub-environments in the vector environment.
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
.. autoattribute:: gymnasium.vector.VectorEnv.action_space
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
The (batched) action space. The input actions of `step` must be valid elements of `action_space`.
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
.. autoattribute:: gymnasium.vector.VectorEnv.observation_space
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
The (batched) observation space. The observations returned by `reset` and `step` are valid elements of `observation_space`.
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
.. autoattribute:: gymnasium.vector.VectorEnv.single_action_space
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
The action space of a sub-environment.
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
.. autoattribute:: gymnasium.vector.VectorEnv.single_observation_space
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2023-12-22 14:48:22 +00:00
|
|
|
The observation space of a sub-environment.
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
.. autoattribute:: gymnasium.vector.VectorEnv.spec
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
The ``EnvSpec`` of the environment normally set during :py:meth:`gymnasium.make_vec`
|
2023-12-22 14:48:22 +00:00
|
|
|
|
2024-04-11 11:58:53 +02:00
|
|
|
.. autoattribute:: gymnasium.vector.VectorEnv.metadata
|
|
|
|
|
|
|
|
The metadata of the environment containing rendering modes, rendering fps, etc
|
|
|
|
|
2023-12-22 14:48:22 +00:00
|
|
|
.. autoattribute:: gymnasium.vector.VectorEnv.render_mode
|
|
|
|
|
|
|
|
The render mode of the environment which should follow similar specifications to `Env.render_mode`.
|
|
|
|
|
|
|
|
.. autoattribute:: gymnasium.vector.VectorEnv.closed
|
|
|
|
|
|
|
|
If the vector environment has been closed already.
|
2022-10-12 15:58:01 +01:00
|
|
|
```
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
### Additional Methods
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2022-10-12 15:58:01 +01:00
|
|
|
```{eval-rst}
|
2023-11-07 13:27:25 +00:00
|
|
|
.. autoproperty:: gymnasium.vector.VectorEnv.unwrapped
|
|
|
|
.. autoproperty:: gymnasium.vector.VectorEnv.np_random
|
2024-02-26 13:00:18 +01:00
|
|
|
.. autoproperty:: gymnasium.vector.VectorEnv.np_random_seed
|
2022-10-12 15:58:01 +01:00
|
|
|
```
|
2022-09-13 20:27:34 +01:00
|
|
|
|
2023-11-07 13:27:25 +00:00
|
|
|
## Making Vector Environments
|
2022-09-13 20:27:34 +01:00
|
|
|
|
|
|
|
```{eval-rst}
|
2023-11-07 13:27:25 +00:00
|
|
|
To create vector environments, gymnasium provides :func:`gymnasium.make_vec` as an equivalent function to :func:`gymnasium.make`.
|
2022-09-13 20:27:34 +01:00
|
|
|
```
|