Reset the microgrid and flush the log. Returns ------- dict[str, list[float]] Observations from resetting the modules as well as the flushed balance log.
(self)
| 205 | return trajectory_func |
| 206 | |
| 207 | def reset(self): |
| 208 | """ |
| 209 | Reset the microgrid and flush the log. |
| 210 | |
| 211 | Returns |
| 212 | ------- |
| 213 | dict[str, list[float]] |
| 214 | Observations from resetting the modules as well as the flushed balance log. |
| 215 | """ |
| 216 | self._set_trajectory() |
| 217 | return { |
| 218 | **{name: [module.reset() for module in module_list] for name, module_list in self.modules.iterdict()}, |
| 219 | **{"balance": self._balance_logger.flush(), |
| 220 | "other": self._microgrid_logger.flush()} |
| 221 | } |
| 222 | |
| 223 | def _set_trajectory(self): |
| 224 | if self.trajectory_func is not None: |