kneasle / wheatley

An AI for Ringing Room that can ring any number of bells to increase the scope of practices.
https://pypi.org/project/wheatley/
MIT License
15 stars 13 forks source link

Allow ringing sessions to be recorded and played back as test cases #191

Open kneasle opened 3 years ago

kneasle commented 3 years ago

This would provide an excellent mechanism for testing Wheatley's performance, since if we mocked the Tower class and make the sleep function just increment a counter then we can simulate Wheatley ringing for huge amounts of time.

If someone else wants to have a crack at this then they're very welcome, but if I had to do it I'd probably do something like:

  1. Move all the knowledge of timing (i.e. time.time() and time.sleep()) into the Tower class so that it can be mocked easily.
  2. Make some kind of running mode which records the events passing through the Tower class and records them to some format (probably JSON)
  3. Make a mocked version of Tower which never interacts with RR but instead replays any given simulation using mocked sleep and time functions to go wayyyy faster than real time.
annag42 commented 3 years ago

A record-and-playback feature could also be used for other purposes than just testing, such as for inclusion in pre-recorded worship services, or even semi-live demonstrations (playbacks) for (spatially-) distributed listeners of a single online tower.

It might be useful to somehow indicate visually to onlookers (casual, non-participating listeners, watching the playback ringingroom) a status message that a recording or playback is in session, when it is.

kneasle commented 3 years ago

A record-and-playback feature could also be used for other purposes than just testing, such as for inclusion in pre-recorded worship services, or even semi-live demonstrations (playbacks) for (spatially-) distributed listeners of a single online tower.

Agreed. Real-time playback wouldn't be super useful for testing Wheatley, but once we have some kind of recording format it would be really easy to play them back to Ringing Room (we probably don't even need Wheatley - we could just ring the bells directly using WebSocket or a library like belltower).