Petting Zoo Wrapper¶
Parameters¶
- class agilerl.wrappers.pettingzoo_wrappers.PettingZooAutoResetParallelWrapper(env: ParallelEnv[AgentID, ObsType, ActionType])¶
Wrapper to automatically reset the environment when all agents terminate or truncate.
- Parameters:
env (ParallelEnv[AgentID, ObsType, ActionType]) – The environment to wrap
- action_space(agent: AgentID) spaces.Space¶
Return the action space for the given agent.
- Parameters:
agent (str) – Agent ID
- Returns:
Action space
- Return type:
spaces.Space
- observation_space(agent: AgentID) spaces.Space¶
Return the observation space for the given agent.
- Parameters:
agent (str) – Agent ID
- Returns:
Observation space
- Return type:
spaces.Space
- reset(seed: int | None = None, options: dict | None = None) tuple[dict[AgentID, ObsType], dict[AgentID, dict]]¶
Reset the environment and return the initial observations and info.
- property state: ndarray¶
Return the state of the environment.
- Returns:
State of the environment
- Return type:
np.ndarray
- step(actions: dict[AgentID, ActionType]) tuple[dict[AgentID, ObsType], dict[AgentID, float], dict[AgentID, bool], dict[AgentID, bool], dict[AgentID, dict]]¶
Step the environment and return the observations, rewards, terminations, truncations, and info.
- property unwrapped: ParallelEnv¶
Return the unwrapped environment.
- Returns:
Unwrapped environment
- Return type:
ParallelEnv