Microgrid#

Constructor#

Microgrid(modules[, add_unbalanced_module, ...])

Microgrid class, used to define and simulate an environment with a variety of modules.

Methods#

Microgrid.run(control[, normalized])

Microgrid.reset()

Reset the microgrid and flush the log.

Microgrid.sample_action([strict_bound, ...])

Get a random action within the microgrid's action space.

Microgrid.get_log([as_frame, ...])

Collect a log of controls and responses of the microgrid.

Microgrid.get_forecast_horizon()

Get the forecast horizon of timeseries modules contained in the microgrid.

Microgrid.get_empty_action([sample_flex_modules])

Get an action for the microgrid with no values set.

Serialization/IO/Conversion#

Microgrid.load(stream)

Load a microgrid from a yaml buffer.

Microgrid.dump([stream])

Save a microgrid to a YAML buffer.

Microgrid.from_nonmodular(nonmodular)

Convert to Microgrid from old-style NonModularMicrogrid.

Microgrid.from_scenario([microgrid_number])

Load one of the pymgrid25 benchmark microgrids.

Microgrid.to_nonmodular()

Convert Microgrid to old-style NonModularMicrogrid.