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

Method reset

src/pymgrid/modules/base/base_module.py:68–80  ·  view source on GitHub ↗

Reset the module to step zero and flush the log. Returns ------- np.ndarray Normalized observation after resetting.

(self)

Source from the content-addressed store, hash-verified

66 unnormalized_high=unnormalized_high)
67
68 def reset(self):
69 """
70 Reset the module to step zero and flush the log.
71
72 Returns
73 -------
74 np.ndarray
75 Normalized observation after resetting.
76
77 """
78 self._update_step(reset=True)
79 self._logger.flush()
80 return self.to_normalized(self.state, obs=True)
81
82 def _raise_error(self, ask_value, available_value, as_source=False, as_sink=False, lower_bound=False):
83 assert as_source + as_sink == 1, 'Must act as either source or sink but not both or neither.'

Callers

nothing calls this directly

Calls 3

_update_stepMethod · 0.95
to_normalizedMethod · 0.95
flushMethod · 0.80

Tested by

no test coverage detected