File: fornetcon.mod

package info (click to toggle)
neuron 8.2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,760 kB
  • sloc: cpp: 149,571; python: 58,465; ansic: 50,329; sh: 3,510; xml: 213; pascal: 51; makefile: 35; sed: 5
file content (40 lines) | stat: -rw-r--r-- 744 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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
: Each NetCon maintains a count of external events.
: And time of last external event
: On each internal event all connecting NetCon get the internal event count.
: And time of last external event

NEURON {
  POINT_PROCESS ForNetConTest
  RANGE tbegin
}

UNITS {
}

PARAMETER {
  tbegin = 0 (ms)
}

INITIAL {
  net_send(tbegin, 1)
}

NET_RECEIVE(w, npre, tpre (ms), npost, tpost (ms)) {
  INITIAL {
    npre=0  tpre=-1  npost=0  tpost=-1
  }

  if (flag == 0) { : external (pre) event
    npre = npre + 1
    tpre = t
  }

  if (flag == 1) { : internal (post) event
    FOR_NETCONS(w, fnpre, ftpre (ms), fnpost, ftpost (ms)) {
      fnpost = fnpost + 1
      ftpost = t
    }
    net_send(3, 1) : in 3 ms another 1 event
    net_event(t)
  }
}