File: examples-misc_remotecontrolserver.txt

package info (click to toggle)
brian 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, stretch
  • size: 23,436 kB
  • sloc: python: 68,707; cpp: 29,040; ansic: 5,182; sh: 111; makefile: 61
file content (36 lines) | stat: -rw-r--r-- 859 bytes parent folder | download | duplicates (2)
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
.. currentmodule:: brian

.. index::
   pair: example usage; RecentStateMonitor
   pair: example usage; NeuronGroup
   pair: example usage; RemoteControlServer
   pair: example usage; run

.. _example-misc_remotecontrolserver:

Example: remotecontrolserver (misc)
===================================

Example of using :class:`RemoteControlServer` and :class:`RemoteControlClient`
to control a simulation as it runs in Brian.

After running this script, run remotecontrolclient.py or paste the code from
that script into an IPython shell for interactive control.

::

    from brian import *
    
    eqs = '''
    dV/dt = (I-V)/(10*ms)+0.1*xi*(2/(10*ms))**.5 : 1
    I : 1
    '''
    
    G = NeuronGroup(3, eqs, reset=0, threshold=1)
    M = RecentStateMonitor(G, 'V', duration=50*ms)
    
    server = RemoteControlServer()
    
    run(1e10*second)