garage.sampler.vec_env_executor module¶
Environment wrapper that runs multiple environments.
-
class
VecEnvExecutor
(envs, max_path_length)[source]¶ Bases:
object
Environment wrapper that runs multiple environments.
Parameters: -
action_space
¶ Read the action space.
Returns: The action space. Return type: gym.Space
-
observation_space
¶ Read the observation space.
Returns: The observation space. Return type: gym.Space
-
reset
()[source]¶ Reset all environments.
Returns: Observations of shape \((K, O*)\) Return type: np.ndarray
-
step
(action_n)[source]¶ Step all environments using the provided actions.
Inserts an environment infor ‘vec_env_executor.complete’ containing the episode end signal (time limit reached or done signal from environment).
Parameters: action_n (np.ndarray) – Array of actions. Returns: - Tuple containing:
- observations (np.ndarray)
- rewards (np.ndarray)
- dones (np.ndarray): The done signal from the environment.
- env_infos (dict[str, np.ndarray])
- completes (np.ndarray): whether or not the path is complete.
- A path is complete at some time-step N if the done signal has been received at that or before N, or if max_path_length N >= max_path_length.
Return type: tuple
-