SpikeGeneratorGroup class

(Shortest import: from brian2 import SpikeGeneratorGroup)

class brian2.input.spikegeneratorgroup.SpikeGeneratorGroup(N, indices, times, dt=None, clock=None, period=0 * second, when='thresholds', order=0, sorted=False, name='spikegeneratorgroup*', codeobj_class=None)[source]

Bases: Group, CodeRunner, SpikeSource

A group emitting spikes at given times.

Attributes

_neuron_index

Array of spiking neuron indices.

_previous_dt

Remember the dt we used the last time when we checked the spike bins to not repeat the work for multiple runs with the same dt

_spike_time

Array of spiking neuron times.

_spikes_changed

"Dirty flag" that will be set when spikes are changed after the before_run check

spikes

The spikes returned by the most recent thresholding operation.

Methods

before_run(run_namespace)

Optional method to prepare the object before a run.

set_spikes(indices, times[, period, sorted])

Change the spikes that this group will generate.

Details

_neuron_index

Array of spiking neuron indices.

_previous_dt

Remember the dt we used the last time when we checked the spike bins to not repeat the work for multiple runs with the same dt

_spike_time

Array of spiking neuron times.

_spikes_changed

“Dirty flag” that will be set when spikes are changed after the before_run check

spikes

The spikes returned by the most recent thresholding operation.

before_run(run_namespace)[source]

Optional method to prepare the object before a run.

Called by Network.after_run before the main simulation loop starts.

set_spikes(indices, times, period=0 * second, sorted=False)

Change the spikes that this group will generate.

This can be used to set the input for a second run of a model based on the output of a first run (if the input for the second run is already known before the first run, then all the information should simply be included in the initial SpikeGeneratorGroup initializer call, instead).