NEST  2.6.0,not_revisioned_source_dir@0
Classes | Public Member Functions | Private Attributes | List of all members
nest::SliceRingBuffer Class Reference

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

#include <slice_ring_buffer.h>

Classes

struct  SpikeInfo
 Information about spike. More...
 

Public Member Functions

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

Private Attributes

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

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:

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

nest::SliceRingBuffer::SliceRingBuffer ( )

Member Function Documentation

void nest::SliceRingBuffer::add_refractory ( const long_t  stamp,
const double_t  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 assert(), nest::names::max, nest::SliceRingBuffer::SpikeInfo::ps_offset_, refract_, and nest::SliceRingBuffer::SpikeInfo::stamp_.

Referenced by nest::iaf_psc_delta_canon::update().

void nest::SliceRingBuffer::add_spike ( const delay  rel_delivery,
const long_t  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 assert(), nest::Scheduler::get_slice_modulo(), and queue_.

Referenced by nest::parrot_neuron_ps::handle(), and nest::iaf_psc_delta_canon::handle().

void nest::SliceRingBuffer::clear ( )

Clear buffer.

References nest::names::clear.

Referenced by nest::parrot_neuron_ps::init_buffers_().

void nest::SliceRingBuffer::discard_events ( )

Discard all events in current slice.

References nest::Scheduler::get_slice_modulo().

bool nest::SliceRingBuffer::get_next_spike ( const long_t  req_stamp,
double_t ps_offset,
double_t 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.
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. If several spikes coincide, the sum of their weights is returned a single spike.

References assert(), deliver_, nest::names::max, nest::SliceRingBuffer::SpikeInfo::ps_offset_, refract_, and nest::SliceRingBuffer::SpikeInfo::stamp_.

Referenced by nest::parrot_neuron_ps::update(), and nest::iaf_psc_delta_canon::update().

void nest::SliceRingBuffer::prepare_delivery ( )

Prepare for spike delivery in current slice by sorting.

References nest::Scheduler::get_slice_modulo().

Referenced by nest::parrot_neuron_ps::update(), and nest::iaf_psc_delta_canon::update().

void nest::SliceRingBuffer::resize ( )

Resize the buffer according to min_delay and max_delay.

References nest::names::clear, nest::Scheduler::get_max_delay(), and nest::Scheduler::get_min_delay().

Referenced by nest::parrot_neuron_ps::init_buffers_().

Member Data Documentation

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

slot to deliver from

Referenced by get_next_spike().

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

entire queue, one slot per min_delay block within max_delay

Referenced by add_spike().

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: