SequentialVectorEnv¶
- class maze.train.parallelization.vector_env.sequential_vector_env.SequentialVectorEnv(env_factories: List[Callable[[], MazeEnv]], logging_prefix: str | None = None)¶
Creates a simple wrapper for multiple environments, calling each environment in sequence on the current Python process. This is useful for computationally simple environment such as
cartpole-v1, as the overhead of multiprocess or multi-thread outweighs the environment computation time. This can also be used for RL methods that require a vectorized environment, but that you want a single environments to train with.- Parameters:
env_factories – A list of functions that will create the environments
- get_actor_rewards() numpy.ndarray | None¶
(overrides
StructuredVectorEnv)Stack actor rewards from encapsulated environments.
- reset() Dict[str, numpy.ndarray]¶
VectorEnv implementation
- step(actions: Dict[str, int | numpy.ndarray]) Tuple[Dict[str, numpy.ndarray], numpy.ndarray, numpy.ndarray, Iterable[Dict[Any, Any]]]¶
Step the environments with the given actions.
- Parameters:
actions – the list of actions for the respective envs.
- Returns:
observations, rewards, dones, information-dicts all in env-aggregated form.