1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
.. currentmodule:: brian
.. index::
pair: example usage; stop
pair: example usage; RemoteControlClient
.. _example-misc_remotecontrolclient:
Example: remotecontrolclient (misc)
===================================
Example of using :class:`RemoteControlServer` and :class:`RemoteControlClient`
to control a simulation as it runs in Brian.
Run the script remotecontrolserver.py before running this.
::
from brian import *
import time
client = RemoteControlClient()
time.sleep(1)
subplot(121)
plot(*client.evaluate('(M.times, M.values)'))
client.execute('G.I = 1.1')
time.sleep(1)
subplot(122)
plot(*client.evaluate('(M.times, M.values)'))
client.stop()
show()
|