-
Notifications
You must be signed in to change notification settings - Fork 1
/
connect.hoc
38 lines (37 loc) · 1022 Bytes
/
connect.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
proc connect_cells() {local i, j
for i=0, nmitral-1 {
for j=0, ngranule-1 {
mgconnect(i, j)
}
}
}
// connect mitral $1 to granule $2 based on mitral position and granule
// position. Only connect if secden long enough to reach granule
proc mgconnect() {local mp, gp, delta, x localobj mgrs
mp = mitral_x.x[$1]
gp = len*($2+.5)/ngranule
delta = gp - mp
if (abs(delta) > Lsec) { return }
x = delta/Lsec
if (delta >= 0) { // use secden[0]
mgrs = mk_mgrs($1, "secden[0]", x, $2, "dend[0]", 1)
}else{ // use secden[1]
mgrs = mk_mgrs($1, "secden[1]", -x, $2, "dend[0]", 1)
}
// store position and relation info in synapse to aid in
// selection and movie making
if (object_id(mgrs)) {
if (mgrs.mexist) {
mgrs.fi.mgid = mgrs.mitral_gid
mgrs.fi.ggid = mgrs.granule_gid
mgrs.fi.srcgid = mgrs.gd_gid
mgrs.fi.x = gp
}
if (mgrs.gexist) {
mgrs.ampanmda.mgid = mgrs.mitral_gid
mgrs.ampanmda.ggid = mgrs.granule_gid
mgrs.ampanmda.srcgid = mgrs.md_gid
mgrs.ampanmda.x = gp
}
}
}