File: operations.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 (20 lines) | stat: -rw-r--r-- 526 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
.. currentmodule:: brian

User-defined operations
=======================

In addition to neuron models, the user can provide functions that are to be called every timestep
during the simulation, using the decorator :func:`network_operation`::

  @network_operation
  def myoperation():
      do_something_every_timestep()

The operation may be called at regular intervals by defining a clock::

  myclock=Clock(dt=1*ms)
  
  @network_operation(myclock)
  def myoperation():
      do_something_every_ms()