LoadModule.step#

LoadModule.step(action, normalized=True)[source]#

Take one step in the module, attempting to draw or send action amount of energy.

Parameters#

actionfloat or np.ndarray, shape (1,)

The amount of energy to draw or send.

If normalized, the action is assumed to be normalized and is un-normalized into the range [BaseModule.min_act, BaseModule.max_act].

If the unnormalized action is positive, the module acts as a source and provides energy to the microgrid. Otherwise, the module acts as a sink and absorbs energy.

If the unnormalized action implies acting as a sink and is_sink is False – or the converse – an AssertionError is raised.

normalizedbool, default True

Whether action is normalized. If True, action is assumed to be normalized and is un-normalized into the range [BaseModule.min_act, BaseModule.max_act].

Raises#

AssertionError

If action implies acting as a source and module is not a source. Likewise if action implies acting as a sink and module is not a sink.

Returns#

observationnp.ndarray

State of the module after taking action action.

rewardfloat

Reward/cost after taking the action.

donebool

Whether the module terminates.

infodict

Additional information from this step. Will include either``provided_energy`` or absorbed_energy as a key, denoting the amount of energy this module provided to or absorbed from the microgrid.