| import abc | |
| class Subscriber(abc.ABC): | |
| """Subscribes to events in the runtime. | |
| Subscribers can be used to save data, visualize, etc. | |
| """ | |
| def on_episode_start(self) -> None: | |
| """Called when an episode starts.""" | |
| def on_step(self, observation: dict, action: dict) -> None: | |
| """Append a step to the episode.""" | |
| def on_episode_end(self) -> None: | |
| """Called when an episode ends.""" | |