metarl.sampler.vec_env_executor module¶
Environment wrapper that runs multiple environments.
-
class
VecEnvExecutor(envs, max_path_length)[source]¶ Bases:
objectEnvironment 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])
Return type: tuple
-