sustaingym.envs.cogen.env
#
This module implements the CogenEnv class
Module Contents#
Classes#
This environment's API is known to be compatible with Gymnasium v0.28, v0.29. |
- class sustaingym.envs.cogen.env.CogenEnv(renewables_magnitude: float = 0.0, ramp_penalty: float = 2.0, supply_imbalance_penalty: float = 1000, constraint_violation_penalty: float = 1000, forecast_horizon: int = 3, forecast_noise_std: float = 0.0)[source]#
Bases:
gymnasium.Env
This environment’s API is known to be compatible with Gymnasium v0.28, v0.29.
Actions:
Type: Dict(Box(1), Discrete(2), Discrete(2), Box(1), Box(1), Discrete(2), Discrete(2), Box(1), Box(1), Discrete(2), Discrete(2), Box(1), Box(1), Box(1), Discrete(12, start=1)) Action Min Max GT1_PWR (MW) 41.64 168.27 GT1_PAC_FFU (binary) 0 1 GT1_EVC_FFU (binary) 0 1 HR1_HPIP_M_PROC (klb/hr) 403.16 819.57 GT2_PWR (MW) 41.49 168.41 GT2_PAC_FFU (binary) 0 1 GT2_EVC_FFU (binary) 0 1 HR2_HPIP_M_PROC (klb/hr) 396.67 817.35 GT3_PWR (MW) 46.46 172.44 GT3_PAC_FFU (binary) 0 1 GT3_EVC_FFU (binary) 0 1 HR3_HPIP_M_PROC (klb/hr) 439.00 870.27 ST_PWR (MW) 25.65 83.54 IPPROC_M (klb/hr) -1218.23 -318.05 CT_NrBays (int) 1 12
Observation:
Type: Dict(Box(1), Action_Dict, Box(forecast_horizon + 1), Box(forecast_horizon + 1), Box(forecast_horizon + 1), Box(forecast_horizon + 1), Box(forecast_horizon + 1), Box(forecast_horizon + 1), Box(forecast_horizon + 1)) Observation Min Max Time (fraction of day) 0 1 Previous action (dict) see above see above Temperature forecast (F) 32 115 Pressure forecast (psia) 14 15 Humidity forecast (fraction) 0 1 Target net power (MW) 0 700 Target process steam (klb/hr) 0 1300 Electricity price ($/MWh) 0 1500 Natural gas price ($/MMBtu) 0 7
- Parameters:
renewables_magnitude (float) – wind generation capacity
ramp_penalty (float) – magnitude of penalty for generator ramping
supply_imbalance_penalty (float) – magnitude of penalty for energy/steam supply-demand imbalance
constraint_violation_penalty (float) – magnitude of penalty for other constraint violations
forecast_horizon (int) – number of forecast steps to include in observation
forecast_noise_std (float) – standard deviation of noise on future forecast steps
- reset(*, seed: int | None = None, options: dict[str, Any] | None = None) tuple[dict[str, Any], dict[str, Any]] [source]#
Initialize or restart an episode.
- Parameters:
seed (int | None) – optional seed vaue for controlling seed of np.random attributes
return_info – determines if returned observation includes additional info or not (not implemented)
options (dict[str, Any] | None) – includes optional settings like reward type (not implemented)
- Returns:
obs – initial state
info – initial info dict
- Return type:
tuple[dict[str, Any], dict[str, Any]]
- step(action: dict[str, Any]) tuple[dict[str, Any], float, bool, bool, dict[str, Any]] [source]#
Run one timestep of the Cogen environment’s dynamics.
- Parameters:
action (dict[str, Any]) – an action provided by the environment
- Returns:
obs – new state
reward – reward
terminated – termination flag
truncated – always
False
, since there is no intermediate stopping conditioninfo – info dict
- Return type:
tuple[dict[str, Any], float, bool, bool, dict[str, Any]]