Skip to content

Commit 1987428

Browse files
committed
remove dead code
1 parent fb62f26 commit 1987428

1 file changed

Lines changed: 0 additions & 67 deletions

File tree

examples/split_examples/pynnBrunnelSplit.py

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -23,73 +23,6 @@
2323
# exec('import pyNN.%s as pynn' % simulator_Name)
2424

2525

26-
def poisson_generator(rate, rng, t_start=0.0, t_stop=1000.0, array=True,
27-
debug=False):
28-
"""
29-
Returns a SpikeTrain whose spikes are a realization of a Poisson process
30-
with the given rate (Hz) and stopping time t_stop (milliseconds).
31-
32-
Note: t_start is always 0.0, thus all realizations are as if
33-
they spiked at t=0.0, though this spike is not included in the SpikeList.
34-
35-
Inputs:
36-
rate - the rate of the discharge (in Hz)
37-
t_start - the beginning of the SpikeTrain (in ms)
38-
t_stop - the end of the SpikeTrain (in ms)
39-
array - if True, a numpy array of sorted spikes is returned,
40-
rather than a SpikeTrain object.
41-
42-
Examples:
43-
>> gen.poisson_generator(50, 0, 1000)
44-
>> gen.poisson_generator(20, 5000, 10000, array=True)
45-
46-
See also:
47-
inh_poisson_generator, inh_gamma_generator,
48-
inh_adaptingmarkov_generator
49-
"""
50-
51-
n = (t_stop - t_start) / 1000.0 * rate
52-
number = np.ceil(n + 3 * np.sqrt(n))
53-
if number < 100:
54-
number = min(5 + np.ceil(2 * n), 100)
55-
56-
if number > 0:
57-
isi = rng.exponential(1.0 / rate, number) * 1000.0
58-
if number > 1:
59-
spikes = np.add.accumulate(isi)
60-
else:
61-
spikes = isi
62-
else:
63-
spikes = np.array([])
64-
65-
spikes += t_start
66-
i = np.searchsorted(spikes, t_stop)
67-
68-
extra_spikes = []
69-
if i == len(spikes):
70-
# ISI buf overrun
71-
72-
t_last = spikes[-1] + rng.exponential(1.0 / rate, 1)[0] * 1000.0
73-
74-
while (t_last < t_stop):
75-
extra_spikes.append(t_last)
76-
t_last += rng.exponential(1.0 / rate, 1)[0] * 1000.0
77-
78-
spikes = np.concatenate((spikes, extra_spikes))
79-
80-
if debug:
81-
print("ISI buf overrun handled. len(spikes)=%d,"
82-
" len(extra_spikes)=%d" % (len(spikes), len(extra_spikes)))
83-
84-
else:
85-
spikes = np.resize(spikes, (i,))
86-
87-
if debug:
88-
return spikes, extra_spikes
89-
else:
90-
return [round(x) for x in spikes]
91-
92-
9326
# Total number of neurons
9427
Neurons = 1000
9528
sim_time = 1000.0

0 commit comments

Comments
 (0)