Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Nengo GUI integration #28
This adds a few more tweaks on top of #27 (which this PR is based on) that were needed to get it to stop and restart fine in nengo_gui. So now you can do
The Simulator will now attempt to stop any snips that are running if it is closed. Unfortunately, I can't figure out a way to actually stop the execution, so the model will still run for however many timesteps were requested, but at least the snips won't cause the execution to halt (to wait for new input).
This means that we can't have nengo_gui do something like sim.run(1000) and expect it to work well. That'll work fine once, but the moment you interrupt it, the chip will be unresponsive until it has run 1000000 time steps.
So, to get around this problem, we need to let nengo_gui users specify this maximum run time. The easiest thing I could think of was to add a magic variable max_loihi_time. It defaults to 1.0 and if you set it in your gui code, it'll use whatever you say.
To run this, you need nengo_gui branch loihi.
If anyone has stumbled across a way to tell loihi to stop its execution in the middle of a run, let me know! :) Barring that, I think this is the best we can do.
[EDIT: ] This PR probably needs to be re-thought in light of the changes to the communication protocol between chip and host introduced in #26