MCPcopy Create free account
hub / github.com/ahalev/python-microgrid / update

Method update

src/pymgrid/modules/load_module.py:90–97  ·  view source on GitHub ↗
(self, external_energy_change, as_source=False, as_sink=False)

Source from the content-addressed store, hash-verified

88 return _min_obs, _max_obs, np.array([]), np.array([])
89
90 def update(self, external_energy_change, as_source=False, as_sink=False):
91 assert as_sink or external_energy_change == 0.0, f'step() was called with positive energy (source) for ' \
92 f'module {self} but module is not a source and ' \
93 f'can only be called with negative energy.'
94
95 info = {'absorbed_energy': self.current_load}
96
97 return 0.0, self._done(), info
98
99 def sample_action(self, strict_bound=False):
100 return np.array([])

Callers 12

to_dictMethod · 0.45
get_attrsMethod · 0.45
dir_additionsMethod · 0.45
_add_emptyFunction · 0.45
_add_to_parametersFunction · 0.45
_add_to_df_statusFunction · 0.45
_add_genset_polynomFunction · 0.45
_log_actionMethod · 0.45
_get_log_dictMethod · 0.45
__call__Method · 0.45
get_gensetFunction · 0.45
get_batteryFunction · 0.45

Calls 1

_doneMethod · 0.80

Tested by 2

get_gensetFunction · 0.36
get_batteryFunction · 0.36