-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlasSynStim.hoc
36 lines (30 loc) · 986 Bytes
/
PlasSynStim.hoc
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
if (name_declared("pkgversions") != 4 ) { execute("strdef pkgversions") }
sprint(pkgversions,"%sPlasSynStim = $Revision: 1.4 $, ",pkgversions)
begintemplate PlasSynStim
public loc, get_loc, get_distance
public ps, ns, ncf, ncb
objref ps, ns, ncf, ncb
proc init() {
ps = new PlasSyn(0.5)
ns = new NetStim(0.5)
ncf = new NetCon(ns, ps) // Forward connection
ncb = new NetCon(&v(0.5), ps, 0, 1, 0) // Backward connection
ncf.weight[1] = 1 // Type 1 is presynaptic
ncb.weight[1] = 0 // Type 0 is postsynaptic
}
proc loc() {
ps.loc($1)
ncb = new NetCon(&v(0.5), ps, 0, 1, 0)
ncb.weight[1] = 0
}
func get_loc() {
x = ps.get_loc()
pop_section() // needed to keep the stack in order
return x
}
func get_distance() {
dist = distance(ps.get_loc()) // Seems to work, though not documented
pop_section() // needed to keep the stack in order
return dist
}
endtemplate PlasSynStim