pymgrid.envs.DiscreteMicrogridEnv#
- class pymgrid.envs.DiscreteMicrogridEnv(modules, add_unbalanced_module=True, loss_load_cost=10, overgeneration_cost=2)[source]#
A discrete env that implements priority lists as actions on a microgrid.
The environment deploys fixed controllable modules to the extent necessary to zero out the net load (load minus renewable generation).
Methods
close()Override close in your subclass to perform any necessary cleanup.
dump([stream])Save a microgrid to a YAML buffer.
from_microgrid(microgrid)Construct an RL environment from a microgrid.
from_nonmodular(nonmodular)Convert to Microgrid from old-style NonModularMicrogrid.
from_normalized(data_dict[, act, obs])De-normalize an action or observation.
from_scenario([microgrid_number])Load one of the pymgrid25 benchmark microgrids.
get_empty_action([sample_flex_modules])Get an action for the microgrid with no values set.
Get the forecast horizon of timeseries modules contained in the microgrid.
get_log([as_frame, drop_singleton_key])Collect a log of controls and responses of the microgrid.
Get all of the priority lists for the microgrid.
load(stream)Load a microgrid from a yaml buffer.
reset()Reset the microgrid and flush the log.
run(control[, normalized])Run the microgrid for a single step.
sample_action([strict_bound, ...])Get a random action within the microgrid's action space.
set_forecast_horizon(value)set_forecaster(forecaster[, ...])Set the forecaster for timeseries modules in the microgrid.
step(action)Run one timestep of the environment's dynamics.
Convert Microgrid to old-style NonModularMicrogrid.
to_normalized(data_dict[, act, obs])Normalize an action or observation.
Attributes
Space object corresponding to valid actions.
List of all controllable modules in the microgrid.
List of all fixed modules in the microgrid.
Whether the environment's spaces are flat.
List of all flex modules in the microgrid.
Microgrid's log as a DataFrame.
List of all modules in the microgrid.
View of the module container.
Number of modules in the microgrid.
Returns the environment's internal
_np_randomthat if not set will initialise with a random seed.Space object corresponding to valid observations.
State of the microgrid as a dict.
State of the microgrid as a pandas Series.
Tag used for yaml serialization.
List of priority lists.