malib.rollout.envs.open_spiel package

malib.rollout.envs.open_spiel.env_desc_gen(**config)[source]

Submodules

malib.rollout.envs.open_spiel.env module

malib.rollout.envs.open_spiel.env.ActionSpace(action_spec: Dict) Space[source]

Analyzes accepted action spec and returns a truncated action space. :param action_spec: The raw action spec in dict. :type action_spec: types.Dict

Returns:

The trucated action space.

Return type:

gym.Space

malib.rollout.envs.open_spiel.env.ObservationSpace(observation_spec: Dict, **kwargs) Dict[source]

Analyzes accepted observation spec and returns a truncated observation space. :param observation_spec: The raw obsevation spec in dict. :type observation_spec: Dict

Returns:

The truncated observation space in Dict.

Return type:

gym.spaces.Dict

class malib.rollout.envs.open_spiel.env.OpenSpielEnv(**configs)[source]

Bases: Environment

property action_spaces: Dict[str, Space]

A dict of agent action spaces

close()[source]
property observation_spaces: Dict[str, Space]

A dict of agent observation spaces

property possible_agents: List[str]

Return a list of environment agent ids

reset(max_step: Optional[int] = None)[source]

Reset environment and the episode info handler here.

seed(seed: Optional[int] = None)[source]
time_step(actions: Dict[str, Any]) Tuple[Dict[str, Any], Dict[str, float], Dict[str, bool], Dict[str, Any]][source]

Environment stepping logic.

Parameters:

actions (Dict[AgentID, Any]) – Agent action dict.

Raises:

NotImplementedError – Not implmeneted error

Returns:

A 4-tuples, listed as (observations, rewards, dones, infos)

Return type:

Tuple[Dict[AgentID, Any], Dict[AgentID, float], Dict[AgentID, bool], Dict[AgentID, Any]]