api.config.shared_info_provider

Classes

SharedInfoProvider

The shared information provider. This class is responsible for managing shared information across all config objects.

Module Contents

class api.config.shared_info_provider.SharedInfoProvider

Bases: Generic[api.typing.AgentID, api.typing.StateType]

The shared information provider. This class is responsible for managing shared information across all config objects.

abstract create(shared_info: Dict[str, Any]) Dict[str, Any]

Function to be called before anything else each time the environment is set to a particular state, either via set_state, reset or __init__.

Parameters:

shared_info – The previous shared information dictionary

abstract set_state(agents: List[api.typing.AgentID], initial_state: api.typing.StateType, shared_info: Dict[str, Any]) Dict[str, Any]

Function to be called each time the environment is set to a particular state (either via set_state or reset), right after the transition engine is called.

Parameters:
  • agents – List of AgentIDs for which this SharedInfoProvider will manage the SharedInfo

  • initial_state – The initial state of the environment

  • shared_info – The previous shared information dictionary

abstract step(agents: List[api.typing.AgentID], state: api.typing.StateType, shared_info: Dict[str, Any]) Dict[str, Any]

Function to be called each time the environment is stepped, right after the transition engine is called.

Parameters:
  • agents – List of AgentIDs for which this SharedInfoProvider should manage the SharedInfo

  • state – The new state of the environment

  • shared_info – The previous shared information dictionary