CARLsim  5.0.0
CARLsim: a GPU-accelerated SNN simulator
SpikeBuffer Class Reference

Circular buffer for delivering spikes. More...

#include <spike_buffer.h>

Classes

class  Impl
 
class  SpikeIterator
 Iterator to loop over the scheduled spikes at a certain delay. More...
 
struct  SpikeNode
 linked list to hold the corresponding neuron Id and delivery delay for each spike More...
 

Public Member Functions

 SpikeBuffer (int minDelay, int maxDelay)
 SpikeBuffer Constructor. More...
 
 ~SpikeBuffer ()
 SpikeBuffer Destructor. More...
 
SpikeIterator back ()
 pointer to the back of the spike buffer More...
 
SpikeIterator front (int stepOffset=0)
 pointer to the front of the spike buffer More...
 
size_t length ()
 retrieve actual length of the buffer More...
 
void reset (int minDelay, int maxDelay)
 Reset buffer data. More...
 
void schedule (int neurId, int grpId, unsigned short int delay)
 Schedule a spike. More...
 
void step ()
 advance to next time step More...
 

Detailed Description

This class implements a ring buffer for spike delivery. Spikes are scheduled to be delivered at a time t + delay using SpikeBuffer::schedule. All scheduled spikes can then be retrieved by iterating over the list, from first element SpikeIterator::front until SpikeIterator::back.

Since
v4.0

Definition at line 66 of file spike_buffer.h.

Constructor & Destructor Documentation

◆ SpikeBuffer()

SpikeBuffer ( int  minDelay,
int  maxDelay 
)

A SpikeBuffer is used to schedule and deliver spikes after a certain delay t + delay. Spikes are scheduled to be delivered at a time t + delay using SpikeBuffer::schedule. All scheduled spikes can then be retrieved by iterating over the list, from first element SpikeIterator::front until SpikeIterator::back.

Parameters
[in]minDelayMinimum delay (in number of time steps) the buffer can handle
[in]maxDelayMaximum delay (in number of time steps) the buffer can handle

Definition at line 215 of file spike_buffer.cpp.

◆ ~SpikeBuffer()

The destructor deallocates all scheduled spikes.

Definition at line 217 of file spike_buffer.cpp.

Member Function Documentation

◆ back()

Definition at line 225 of file spike_buffer.cpp.

◆ front()

SpikeBuffer::SpikeIterator front ( int  stepOffset = 0)

Definition at line 224 of file spike_buffer.cpp.

◆ length()

size_t length ( )

Definition at line 223 of file spike_buffer.cpp.

◆ reset()

void reset ( int  minDelay,
int  maxDelay 
)

This method resets all allocated data. Must be called at the beginning of a simulation.

Parameters
[in]minDelayMinimum delay (in number of time steps) the buffer can handle
[in]maxDelayMaximum delay (in number of time steps) the buffer can handle

Definition at line 222 of file spike_buffer.cpp.

◆ schedule()

void schedule ( int  neurId,
int  grpId,
unsigned short int  delay 
)

This method schedules a spike to be delivered to neuron with ID neurID, after a delay of t + delay time steps.

Parameters
[in]neurIdcorresponding neuron ID
[in]delayscheduling delay (in number of time steps)

Definition at line 220 of file spike_buffer.cpp.

◆ step()

void step ( )

Definition at line 221 of file spike_buffer.cpp.


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