GensetModule.step#
- GensetModule.step(action, normalized=True)[source]#
Take one step in the module, attempting to draw a certain amount of energy from the genset.
Parameters#
- actionfloat or np.ndarray, shape (2,)
Two-dimensional vector containing two values. The first value is used to passed to
GensetModule.update_status()while the second is the amount of energy to draw from the genset.If
normalized, the amount of energy is assumed to be normalized and is un-normalized into the range [GensetModule.min_act,GensetModule.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_sinkis False – or the converse – anAssertionErroris raised.Warning
The first element in
actionis not denormalized before being passed toGensetModule.update_status(), regardless of the value ofnormalized.- normalizedbool, default True
Whether
actionis normalized. If True, action is assumed to be normalized and is un-normalized into the range [GensetModule.min_act,GensetModule.max_act].
Raises#
- AssertionError
If action implies acting as a sink, or
action[0]in outside of[0, 1].
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.