NEST main@caf0ae8
 
Loading...
Searching...
No Matches
nest::SliceRingBuffer Class Reference

Queue for all spikes arriving into a neuron. More...

#include <slice_ring_buffer.h>

Collaboration diagram for nest::SliceRingBuffer:
[legend]

Classes

struct  SpikeInfo
 Information about spike. More...
 

Public Member Functions

 SliceRingBuffer ()
 
void add_spike (const long rel_delivery, const long stamp, const double ps_offset, const double weight)
 Add spike to queue.
 
void add_refractory (const long stamp, const double ps_offset)
 Add refractory event to queue.
 
void prepare_delivery ()
 Prepare for spike delivery in current slice by sorting.
 
void discard_events ()
 Discard all events in current slice.
 
bool get_next_spike (const long req_stamp, bool accumulate_simultaneous, double &ps_offset, double &weight, bool &end_of_refract)
 Return next spike.
 
void clear ()
 Clear buffer.
 
void resize ()
 Resize the buffer according to min_delay and max_delay.
 

Private Attributes

std::vector< std::vector< SpikeInfo > > queue_
 entire queue, one slot per min_delay block within max_delay
 
std::vector< SpikeInfo > * deliver_
 slot to deliver from
 
SpikeInfo refract_
 pseudo-event for return from refractoriness
 

Detailed Description

Queue for all spikes arriving into a neuron.

Spikes are stored unsorted on arrival, but are sorted when prepare_delivery() is called. They can then be retrieved one by one in correct temporal order. Coinciding spikes are combined into one, see get_next_spike().

Data is organized as follows:

  • The time of the next return from refractoriness is stored in a separate variable and checked explicitly; otherwise, we'd have to re-sort data during updating.
  • We have a pseudo-ring of Nbuff=ceil((min_del+max_del)/min_del) elements. Each element is a vector storing incoming spikes that are due during a given time slice.
Note
The following assumptions underlie the handling of pseudo-events for return from refractoriness:
  • There is at most one such event per time step (value of time stamp).

Constructor & Destructor Documentation

◆ SliceRingBuffer()

nest::SliceRingBuffer::SliceRingBuffer ( )

Member Function Documentation

◆ add_refractory()

void nest::SliceRingBuffer::add_refractory ( const long  stamp,
const double  ps_offset 
)
inline

Add refractory event to queue.

The refractory event is actually stored as a pseudo-event.

Parameters
stampDelivery time
ps_offsetPrecise timing offset of spike time

References nest::SliceRingBuffer::SpikeInfo::ps_offset_, refract_, and nest::SliceRingBuffer::SpikeInfo::stamp_.

Referenced by nest::iaf_psc_delta_ps::update(), nest::iaf_psc_alpha_ps::update(), nest::iaf_psc_exp_ps::update(), and nest::iaf_psc_exp_ps_lossless::update().

Here is the caller graph for this function:

◆ add_spike()

void nest::SliceRingBuffer::add_spike ( const long  rel_delivery,
const long  stamp,
const double  ps_offset,
const double  weight 
)
inline

Add spike to queue.

Parameters
rel_deliveryrelative delivery time
stampDelivery time
ps_offsetPrecise timing offset of spike time
weightWeight of spike.

References nest::KernelManager::event_delivery_manager, nest::EventDeliveryManager::get_slice_modulo(), nest::kernel(), and queue_.

Referenced by nest::iaf_psc_alpha_ps::handle(), nest::iaf_psc_delta_ps::handle(), nest::iaf_psc_exp_ps::handle(), nest::iaf_psc_exp_ps_lossless::handle(), and nest::parrot_neuron_ps::handle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

void nest::SliceRingBuffer::clear ( )

Clear buffer.

References queue_.

Referenced by nest::iaf_psc_alpha_ps::init_buffers_(), nest::iaf_psc_delta_ps::init_buffers_(), nest::iaf_psc_exp_ps::init_buffers_(), nest::iaf_psc_exp_ps_lossless::init_buffers_(), nest::parrot_neuron_ps::init_buffers_(), and resize().

Here is the caller graph for this function:

◆ discard_events()

void nest::SliceRingBuffer::discard_events ( )

Discard all events in current slice.

References deliver_, nest::KernelManager::event_delivery_manager, nest::EventDeliveryManager::get_slice_modulo(), nest::kernel(), and queue_.

Here is the call graph for this function:

◆ get_next_spike()

bool nest::SliceRingBuffer::get_next_spike ( const long  req_stamp,
bool  accumulate_simultaneous,
double &  ps_offset,
double &  weight,
bool &  end_of_refract 
)
inline

Return next spike.

Parameters
req_stampRequest spike with this stamp. Queue should never contain spikes with smaller stamps. Spikes with larger stamps are left in queue.
accumulate_simultaneousIf true, return summed weight of simultaneous input spikes, otherwise return one spike at a time.
ps_offsetPS-sense offset of spike time
weightSpike weight
end_of_refractTrue if spike is pseudo-spike marking end of refractory period
Returns
true if spike available, false otherwise
Note
If return from refractoriness coincides with a spike, return from refractoriness is returned.

References deliver_, nest::SliceRingBuffer::SpikeInfo::ps_offset_, refract_, and nest::SliceRingBuffer::SpikeInfo::stamp_.

Referenced by nest::iaf_psc_alpha_ps::get_next_event_(), nest::iaf_psc_delta_ps::update(), nest::parrot_neuron_ps::update(), nest::iaf_psc_exp_ps::update(), and nest::iaf_psc_exp_ps_lossless::update().

Here is the caller graph for this function:

◆ prepare_delivery()

void nest::SliceRingBuffer::prepare_delivery ( )

Prepare for spike delivery in current slice by sorting.

References deliver_, nest::KernelManager::event_delivery_manager, nest::EventDeliveryManager::get_slice_modulo(), nest::kernel(), and queue_.

Referenced by nest::iaf_psc_delta_ps::update(), nest::parrot_neuron_ps::update(), nest::iaf_psc_alpha_ps::update(), nest::iaf_psc_exp_ps::update(), and nest::iaf_psc_exp_ps_lossless::update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resize()

void nest::SliceRingBuffer::resize ( )

Resize the buffer according to min_delay and max_delay.

References clear(), nest::KernelManager::connection_manager, nest::ConnectionManager::get_max_delay(), nest::ConnectionManager::get_min_delay(), nest::kernel(), and queue_.

Referenced by nest::iaf_psc_alpha_ps::init_buffers_(), nest::iaf_psc_delta_ps::init_buffers_(), nest::iaf_psc_exp_ps::init_buffers_(), nest::iaf_psc_exp_ps_lossless::init_buffers_(), and nest::parrot_neuron_ps::init_buffers_().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ deliver_

std::vector< SpikeInfo >* nest::SliceRingBuffer::deliver_
private

slot to deliver from

Referenced by discard_events(), get_next_spike(), and prepare_delivery().

◆ queue_

std::vector< std::vector< SpikeInfo > > nest::SliceRingBuffer::queue_
private

entire queue, one slot per min_delay block within max_delay

Referenced by add_spike(), clear(), discard_events(), prepare_delivery(), and resize().

◆ refract_

SpikeInfo nest::SliceRingBuffer::refract_
private

pseudo-event for return from refractoriness

Referenced by add_refractory(), and get_next_spike().


The documentation for this class was generated from the following files: