hive.envs.pettingzoo.pettingzoo module
- class hive.envs.pettingzoo.pettingzoo.PettingZooEnv(env_name, env_family, num_players, **kwargs)[source]
Bases:
BaseEnv
PettingZoo environment from https://github.com/PettingZoo-Team/PettingZoo
For now, we only support environments from PettingZoo with discrete actions.
- Parameters
- create_env_spec(env_name, **kwargs)[source]
Each family of environments have their own type of observations and actions. You can add support for more families here by modifying obs_dim and act_dim.
- reset()[source]
Resets the state of the environment.
- Returns
The initial observation of the new episode. turn (int): The index of the agent which should take turn.
- Return type
observation
- step(action)[source]
Run one time-step of the environment using the input action.
- Parameters
action – An element of environment’s action space.
- Returns
Indicates the next state that is an element of environment’s observation space. reward: A reward achieved from the transition. done (bool): Indicates whether the episode has ended. turn (int): Indicates which agent should take turn. info (dict): Additional custom information.
- Return type
observation