sustaingym.envs.building.multiagent_env#

The module implements a multi-agent version of the building environment.

Module Contents#

Classes#

MultiAgentBuildingEnv

Multi-agent building environment.

class sustaingym.envs.building.multiagent_env.MultiAgentBuildingEnv(parameters: dict[str, Any])[source]#

Bases: pettingzoo.ParallelEnv

Multi-agent building environment.

Each agent controls the AC unit in a single zone. Agent IDs are integers.

This environment’s API is known to be compatible with PettingZoo v1.24.1

Parameters:
  • parameters (dict[str, Any]) – dict of parameters for the environment (see BuildingEnv)

  • global_obs – whether each agent observes the global state or only the temperature of its own zone

# attributes required by pettingzoo.ParallelEnv
agents#

list[int], agent IDs, indices of zones with AC units

possible_agents#

list[int], same as agents

observation_spaces#

dict[int, spaces.Box], observation space for each agent

action_spaces#

dict[int, spaces.Box], action space for each agent

# attributes specific to MultiAgentBuildingEnv
single_env#

BuildingEnv

periods_delay#

int, time periods of delay for inter-agent communication

step(actions: collections.abc.Mapping[int, numpy.ndarray]) tuple[dict[int, numpy.ndarray], dict[int, float], dict[int, bool], dict[int, bool], dict[int, dict[str, Any]]][source]#

Returns: obss, rewards, terminateds, truncateds, infos

Parameters:

actions (collections.abc.Mapping[int, numpy.ndarray]) –

Return type:

tuple[dict[int, numpy.ndarray], dict[int, float], dict[int, bool], dict[int, bool], dict[int, dict[str, Any]]]

reset(seed: int | None = None, options: dict | None = None) tuple[dict[int, numpy.ndarray], dict[int, dict[str, Any]]][source]#

Resets the environment.

Parameters:
  • seed (int | None) –

  • options (dict | None) –

Return type:

tuple[dict[int, numpy.ndarray], dict[int, dict[str, Any]]]

render() None[source]#

Render environment.

Return type:

None

close() None[source]#

Close the environment.

Return type:

None

state() numpy.ndarray[source]#
Return type:

numpy.ndarray

observation_space(agent: int) gymnasium.spaces.Space[source]#
Parameters:

agent (int) –

Return type:

gymnasium.spaces.Space

action_space(agent: int) gymnasium.spaces.Box | gymnasium.spaces.Discrete[source]#
Parameters:

agent (int) –

Return type:

gymnasium.spaces.Box | gymnasium.spaces.Discrete