GridModule.update#
- GridModule.update(external_energy_change, as_source=False, as_sink=False)[source]#
Update the state of the module given an energy request.
Parameters#
- external_energy_changefloat >= 0 or None
Amount of energy to provide or absorb. A non-negative number.
- as_sourcebool
Whether the module is acting as a source.
- as_sink
Whether the module is acting as a sink.
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.