-
Notifications
You must be signed in to change notification settings - Fork 3
/
testvecplay.hoc
59 lines (50 loc) · 1.15 KB
/
testvecplay.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
create soma
objref syn, stim, ramps_t, ramps_i, r
proc init() {local tt, x
r = new Random()
r.Random123($1, 0, 0)
ramps_t = new Vector()
ramps_i = new Vector()
for (tt=0; tt < 100; tt = tt + 5) {
x = r.uniform(.5, 1.5)
ramps_t.append(tt, tt+x, tt+x, tt+5)
ramps_i.append(0, .01+.001*($1+1), 0, -.001)
}
soma {
nseg=1
diam = 1 L = 1
insert hh
stim = new IClamp(.5)
stim.amp= 0
stim.dur = 1e9
ramps_i.play(stim, &stim.amp, ramps_t, 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))
//cell.syn.noiseFromRandom123(gid,2,3)
cells.append(cell)
}
pc.spike_record(-1, tvec, idvec)
cvode.cache_efficient(1)
pc.set_maxstep(10)
stdinit()
prun("")
spike2file("vecplay")
pc.barrier()
quit()