Dummy Vectorized Environments¶
Lightweight wrappers that expose a single environment through a
VectorEnv-like API, adding a leading batch dimension of size 1.
- class agilerl.vector.dummy_vec_env.DummyVecEnv(env: Env)¶
Wraps a single
gymnasium.Envwith aVectorEnv-like API.Observations returned by
reset()andstep()always carry a leading batch dimension of size 1, and actions are expected to have the same leading dimension (which is stripped before forwarding to the underlying environment).Episodes auto-reset following the gymnasium >= 1.0 next-step convention (matching
gymnasium.vector.SyncVectorEnv): the step after a termination/truncation resets the environment and returns the reset observation with zero reward and both done flagsFalse.- Parameters:
env (gymnasium.Env) – The environment to wrap.
- render() tuple[RenderFrame, ...] | None¶
Render the environment.
- Returns:
Render output from the wrapped environment.
- Return type:
tuple[gymnasium.core.RenderFrame, …] | None
- reset(*, seed: int | None = None, options: dict[str, Any] | None = None) tuple[ndarray[tuple[int, ...], dtype[_ScalarType_co]], dict[str, Any]]¶
Reset the environment and return batched observation.
- step(actions: ndarray[tuple[int, ...], dtype[_ScalarType_co]]) tuple[ndarray[tuple[int, ...], dtype[_ScalarType_co]], ndarray[tuple[int, ...], dtype[_ScalarType_co]], ndarray[tuple[int, ...], dtype[_ScalarType_co]], ndarray[tuple[int, ...], dtype[_ScalarType_co]], dict[str, Any]]¶
Take a step in the environment.
If the previous step ended the episode, the environment is reset instead (next-step autoreset) and the reset observation is returned with zero reward and
Falsedone flags.