Simulator - randyhook/knynet GitHub Wiki
Before we deal with actual robots, meaning, multiple pieces of real world hardware (some that are mobile) with their own sensors, we need to run our theories through a simulator.
images/simulator-subclassing.png
The Simulator Class
The Simulator class runs the main loop of the program. The main loop runs simulation scripts and tells the simulated bots to update themselves. It also provides an interface for interacting with the simulation.
Simulation Scripts
Scripts are set up to generate events for the simulation at specified times. Because we are not interacting with the real world, these scripts will include SensoryEncoded data that would normally be generated by processing incoming SensoryData with an Agency (as explained here).
Supporting Simulator Classes
Where needed, supporting Simulator classes will be derived from their real world counterparts and used during the simulation. For example, in the simulation we will be sending SensoryEncoded data instead of raw SensoryData directly to an Agent. Therefore, we derive SimAgent from Agent to handle this scenario. This allows us to develop algorithms for the real robots during the entire project and simply subclass for the simulator when necessary.