docs/Python-PettingZoo-API-Documentation.md
<a name="mlagents_envs.envs.pettingzoo_env_factory"></a>
<a name="mlagents_envs.envs.pettingzoo_env_factory.PettingZooEnvFactory"></a>
class PettingZooEnvFactory()
<a name="mlagents_envs.envs.pettingzoo_env_factory.PettingZooEnvFactory.env"></a>
| env(seed: Optional[int] = None, **kwargs: Union[List, int, bool, None]) -> UnityAECEnv
Creates the environment with env_id from unity's default_registry and wraps it in a UnityToPettingZooWrapper
Arguments:
seed: The seed for the action spaces of the agents.kwargs: Any argument accepted by UnityEnvironmentclass except file_name<a name="mlagents_envs.envs.unity_aec_env"></a>
<a name="mlagents_envs.envs.unity_aec_env.UnityAECEnv"></a>
class UnityAECEnv(UnityPettingzooBaseEnv, AECEnv)
Unity AEC (PettingZoo) environment wrapper.
<a name="mlagents_envs.envs.unity_aec_env.UnityAECEnv.__init__"></a>
| __init__(env: BaseEnv, seed: Optional[int] = None)
Initializes a Unity AEC environment wrapper.
Arguments:
env: The UnityEnvironment that is being wrapped.seed: The seed for the action spaces of the agents.<a name="mlagents_envs.envs.unity_aec_env.UnityAECEnv.step"></a>
| step(action: Any) -> None
Sets the action of the active agent and get the observation, reward, done and info of the next agent.
Arguments:
action: The action for the active agent<a name="mlagents_envs.envs.unity_aec_env.UnityAECEnv.observe"></a>
| observe(agent_id)
Returns the observation an agent currently can make. last() calls this function.
<a name="mlagents_envs.envs.unity_aec_env.UnityAECEnv.last"></a>
| last(observe=True)
returns observation, cumulative reward, done, info for the current agent (specified by self.agent_selection)
<a name="mlagents_envs.envs.unity_parallel_env"></a>
<a name="mlagents_envs.envs.unity_parallel_env.UnityParallelEnv"></a>
class UnityParallelEnv(UnityPettingzooBaseEnv, ParallelEnv)
Unity Parallel (PettingZoo) environment wrapper.
<a name="mlagents_envs.envs.unity_parallel_env.UnityParallelEnv.__init__"></a>
| __init__(env: BaseEnv, seed: Optional[int] = None)
Initializes a Unity Parallel environment wrapper.
Arguments:
env: The UnityEnvironment that is being wrapped.seed: The seed for the action spaces of the agents.<a name="mlagents_envs.envs.unity_parallel_env.UnityParallelEnv.reset"></a>
| reset() -> Dict[str, Any]
Resets the environment.
<a name="mlagents_envs.envs.unity_pettingzoo_base_env"></a>
<a name="mlagents_envs.envs.unity_pettingzoo_base_env.UnityPettingzooBaseEnv"></a>
class UnityPettingzooBaseEnv()
Unity Petting Zoo base environment.
<a name="mlagents_envs.envs.unity_pettingzoo_base_env.UnityPettingzooBaseEnv.observation_spaces"></a>
| @property
| observation_spaces() -> Dict[str, spaces.Space]
Return the observation spaces of all the agents.
<a name="mlagents_envs.envs.unity_pettingzoo_base_env.UnityPettingzooBaseEnv.observation_space"></a>
| observation_space(agent: str) -> Optional[spaces.Space]
The observation space of the current agent.
<a name="mlagents_envs.envs.unity_pettingzoo_base_env.UnityPettingzooBaseEnv.action_spaces"></a>
| @property
| action_spaces() -> Dict[str, spaces.Space]
Return the action spaces of all the agents.
<a name="mlagents_envs.envs.unity_pettingzoo_base_env.UnityPettingzooBaseEnv.action_space"></a>
| action_space(agent: str) -> Optional[spaces.Space]
The action space of the current agent.
<a name="mlagents_envs.envs.unity_pettingzoo_base_env.UnityPettingzooBaseEnv.side_channel"></a>
| @property
| side_channel() -> Dict[str, Any]
The side channels of the environment. You can access the side channels
of an environment with env.side_channel[<name-of-channel>].
<a name="mlagents_envs.envs.unity_pettingzoo_base_env.UnityPettingzooBaseEnv.reset"></a>
| reset()
Resets the environment.
<a name="mlagents_envs.envs.unity_pettingzoo_base_env.UnityPettingzooBaseEnv.seed"></a>
| seed(seed=None)
Reseeds the environment (making the resulting environment deterministic).
reset() must be called after seed(), and before step().
<a name="mlagents_envs.envs.unity_pettingzoo_base_env.UnityPettingzooBaseEnv.render"></a>
| render(mode="human")
NOT SUPPORTED.
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).
<a name="mlagents_envs.envs.unity_pettingzoo_base_env.UnityPettingzooBaseEnv.close"></a>
| close() -> None
Close the environment.