-
Notifications
You must be signed in to change notification settings - Fork 3
/
testwatch.hoc
59 lines (50 loc) · 1.07 KB
/
testwatch.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{load_file("nrngui.hoc")}
{load_file("defvar.hoc")}
load_file("common.hoc")
begintemplate Cell
public soma, syn, stim, hhabs
create soma
objref syn, stim[21], hhabs, r
proc init() {local i, x
r = new Random()
r.Random123($1, 0, 0)
r.uniform(2,5)
soma {
nseg=1
diam = 10 L = 3
hhabs = new hhwatch(0.5)
gna_hhwatch = .002
gk_hhwatch = .001
gpas_hhwatch = .0005
x = 0
for i=0, 20 {
x += r.uniform(2,5)
stim[i] = new IClamp(.5)
stim[i].del = x
stim[i].amp = r.uniform(.2, .3)
stim[i].dur = 0.1
}
}
}
endtemplate Cell
ncell = 10
objref cell, cells, nc, netcons, st, stims, nil
pnm = new ParallelNetManager(0)
pc = pnm.pc
tvec = new Vector()
idvec = new Vector()
cells = new List()
for (gid = pc.id; gid < ncell; gid += pc.nhost) {
pc.set_gid2node(gid, pc.id)
cell = new Cell(gid, ncell)
cell.soma pc.cell(gid, new NetCon(&cell.soma.v(.5), nil))
cells.append(cell)
}
pc.spike_record(-1, tvec, idvec)
cvode.cache_efficient(1)
pc.set_maxstep(10)
stdinit()
prun("")
spike2file("watch")
pc.barrier()
quit()