-
Notifications
You must be signed in to change notification settings - Fork 1
/
hc1.mod
60 lines (50 loc) · 885 Bytes
/
hc1.mod
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
COMMENT
Hair cell version 1
Fires as Poisson process with rate constant tau
ENDCOMMENT
VERBATIM
double du_dev0();
double dexp_dev(double);
ENDVERBATIM
NEURON {
ARTIFICIAL_CELL hc1
RANGE tau, xp, yp, zp, del
}
PARAMETER {
idebug = 0
tau = 200 (ms)
xp = 0 : x,y location
yp = 0
zp = 0
del = 0
}
ASSIGNED {
}
INITIAL {
if( del > 0 ) {
net_send( del,3)
}
net_send( 0, 1 )
}
NET_RECEIVE( weight ){
LOCAL wait
if( idebug ) {
printf( "Net_receive hc1: t %g flag %g", t, flag )
if( flag == 0 ){ printf( " weight %g", weight ) }
printf( "\n" )
}
if( flag == 1 && tau > 0 ){
wait = dexp_dev( 1/tau )
net_send( wait, 2 )
}
if( flag == 2 ){
net_event( t )
wait = dexp_dev( 1/tau )
net_send( wait, 2 )
}
if( flag == 3 ){ : self-event from del > 0
net_event(t)
: wait=del
: net_send(wait,2)
}
}