Petting Zoo Wrapper¶
Parameters¶
- class agilerl.wrappers.pettingzoo_wrappers.PettingZooAutoResetParallelWrapper(env: ParallelEnv[AgentID, ObsType, ActionType])¶
- action_space(agent: str) Space ¶
Takes in agent and returns the action space for that agent.
MUST return the same value for the same agent name
Default implementation is to return the action_spaces dict
- observation_space(agent: str) Space ¶
Takes in agent and returns the observation space for that agent.
MUST return the same value for the same agent name
Default implementation is to return the observation_spaces dict
- render() None | ndarray | str | list ¶
Displays a rendered frame from the environment, if supported.
Alternate render modes in the default environments are ‘rgb_array’ which returns a numpy array and is supported by all environments outside of classic, and ‘ansi’ which returns the strings printed (specific to classic environments).
- reset(seed: int | None = None, options: dict | None = None) tuple[dict[str, ObsType], dict[str, dict]] ¶
Resets the environment.
And returns a dictionary of observations (keyed by the agent name)
- property state: ndarray¶
Returns the state.
State returns a global view of the environment appropriate for centralized training decentralized execution methods like QMIX
- step(actions: dict[str, ActionType]) tuple[dict[str, ObsType], dict[str, float], dict[str, bool], dict[str, bool], dict[str, dict]] ¶
Receives a dictionary of actions keyed by the agent name.
Returns the observation dictionary, reward dictionary, terminated dictionary, truncated dictionary and info dictionary, where each dictionary is keyed by the agent.