-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExpSynStim.hoc
43 lines (32 loc) · 1.06 KB
/
ExpSynStim.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
37
38
39
40
41
42
43
if (name_declared("pkgversions") != 4 ) { execute("strdef pkgversions") }
sprint(pkgversions,"%sExpSynStim = $Revision: 1.4 $, ",pkgversions)
/*
ExpSynStim - exponential synapse with netstim stimulus
ess = new ExpSynStim() - creates ExpSynStim ess
ess.loc(x) - locates at x on the current section
ess.get_loc() - returns relative location along the section
ess.get_distance() - returns distance from origin specified by distance()
*/
begintemplate ExpSynStim
public loc, get_loc, get_distance
public expsyn, netcon, netstim
objref expsyn, netcon, netstim
proc init() {
expsyn = new ExpSyn(0.5)
netstim = new NetStim(0.5)
netcon = new NetCon(netstim,expsyn)
}
proc loc() {
expsyn.loc($1)
}
func get_loc() {
x = expsyn.get_loc()
pop_section() // needed to keep the stack in order
return x
}
func get_distance() {
dist = distance(expsyn.get_loc()) // Seems to work, though not documented
pop_section() // needed to keep the stack in order
return dist
}
endtemplate ExpSynStim