GridModule.as_sink#
- GridModule.as_sink(energy_excess)[source]#
Act as an energy sink to the microgrid.
Microgrid will attempt to provide
energy_excessamount of energy. Examples of this include charging a battery, exporting from a grid, or meeting a load.It is assumed that
energy_excess>=0.Parameters#
- energy_excessfloat
Amount of energy that the microgrid is attempting to dissipate. Must be non-negative.
Returns#
- rewardfloat
Reward/cost after attempting the absorb the energy excess.
- donebool
Whether the module terminates.
- infodict
Additional information from this step. Will include``absorbed_energy`` as a key, denoting the amount of energy this module provided to the microgrid.
Raises#
- AssertionError
If
energy_excess<0or the module is not a sink.