SpikeQueue class

(Shortest import: from brian2.synapses.spikequeue import SpikeQueue)

class brian2.synapses.spikequeue.SpikeQueue(source_start, source_end)[source]

Bases: object

Data structure saving the spikes and taking care of delays.

Attributes

_dt

The dt used for storing the spikes (will be set in prepare)

_source_end

The end of the source indices (for subgroups)

_source_start

The start of the source indices (for subgroups)

currenttime

The current time (in time steps)

n

number of events in each time step

Methods

advance()

Advances by one timestep

peek()

Returns the all the synaptic events corresponding to the current time, as an array of synapse indexes.

prepare(delays, dt, synapse_sources)

Prepare the data structures

push(sources)

Push spikes to the queue.

Details

_dt

The dt used for storing the spikes (will be set in prepare)

_source_end

The end of the source indices (for subgroups)

_source_start

The start of the source indices (for subgroups)

currenttime

The current time (in time steps)

n

number of events in each time step

advance()[source]

Advances by one timestep

peek()[source]

Returns the all the synaptic events corresponding to the current time, as an array of synapse indexes.

prepare(delays, dt, synapse_sources)[source]

Prepare the data structures

This is called every time the network is run. The size of the of the data structure (number of rows) is adjusted to fit the maximum delay in delays, if necessary. A flag is set if delays are homogeneous, in which case insertion will use a faster method implemented in insert_homogeneous.

push(sources)[source]

Push spikes to the queue.