sustaingym.envs.cogen.multiagent_env
#
This module implements the CogenEnv class
Module Contents#
Classes#
Multi-agent version of CogenEnv following the PettingZoo API (v1.24.1). |
- class sustaingym.envs.cogen.multiagent_env.MultiAgentCogenEnv(renewables_magnitude: float = 0.0, ramp_penalty: float = 2.0, supply_imbalance_penalty: float = 1000, constraint_violation_penalty: float = 1000, forecast_horizon: int = 12, forecast_noise_std: float = 0.1)[source]#
Bases:
pettingzoo.utils.env.ParallelEnv
Multi-agent version of CogenEnv following the PettingZoo API (v1.24.1).
- Parameters:
renewables_magnitude (float) –
ramp_penalty (float) –
supply_imbalance_penalty (float) –
constraint_violation_penalty (float) –
forecast_horizon (int) –
forecast_noise_std (float) –
- step(actions: dict[str, dict[str, numpy.ndarray]]) tuple[dict[str, numpy.ndarray], dict[str, float], dict[str, bool], dict[str, bool], dict[str, dict]] [source]#
Run one timestep of the Cogen environment’s dynamics.
- Parameters:
action – an action provided by the environment
actions (dict[str, dict[str, numpy.ndarray]]) –
- Returns:
obss – dict mapping agent_id to observation
rewards – dict mapping agent_id to reward
terminateds – dict mapping agent_id to terminated
truncateds – dict mapping agent_id to truncated
infos – dict mapping agent_id to info
- Return type:
tuple[dict[str, numpy.ndarray], dict[str, float], dict[str, bool], dict[str, bool], dict[str, dict]]
- reset(seed: int | None = None, options: dict | None = None) tuple[dict[str, numpy.ndarray], dict[str, dict[str, Any]]] [source]#
Resets the environment.
- Parameters:
seed (int | None) –
options (dict | None) –
- Return type:
tuple[dict[str, numpy.ndarray], dict[str, dict[str, Any]]]