Allows remote control (via IP) of a running Brian script
Initialisation arguments:
Once this object has been created, use a RemoteControlClient to issue commands.
Example usage
Main simulation code includes a line like this:
server = RemoteControlServer()
In an IPython shell you can do something like this:
client = RemoteControlClient()
spikes = client.evaluate('M.spikes')
i, t = zip(*spikes)
plot(t, i, '.')
client.execute('stop()')
Used to remotely control (via IP) a running Brian script
Initialisation arguments:
Use a RemoteControlServer on the simulation you want to control.
Has the following methods:
Executes the specified code in the server process. If it raises an exception, the server process will catch it and reraise it in the client process.
Evaluate the code in the server process and return the result. If it raises an exception, the server process will catch it and reraise it in the client process.
Sets the variable name (a string) to the given value (can be an array, etc.). Note that the variable is set in the local namespace, not the global one, and so this cannot be used to modify global namespace variables. To do that, set a local namespace variable and then call execute() with an instruction to change the global namespace variable.
Temporarily stop the simulation in the server process, continue simulation with the :meth:’go’ method.
Continue a simulation that was paused.
Stop a simulation, equivalent to execute('stop()').
Example usage
Main simulation code includes a line like this:
server = RemoteControlServer()
In an IPython shell you can do something like this:
client = RemoteControlClient()
spikes = client.evaluate('M.spikes')
i, t = zip(*spikes)
plot(t, i, '.')
client.execute('stop()')