CARLsim
6.1.0
CARLsim: a GPU-accelerated SNN simulator
|
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... | |
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.
Definition at line 67 of file spike_buffer.h.
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.
[in] | minDelay | Minimum delay (in number of time steps) the buffer can handle |
[in] | maxDelay | Maximum delay (in number of time steps) the buffer can handle |
Definition at line 216 of file spike_buffer.cpp.
~SpikeBuffer | ( | ) |
The destructor deallocates all scheduled spikes.
Definition at line 218 of file spike_buffer.cpp.
SpikeBuffer::SpikeIterator back | ( | ) |
Definition at line 226 of file spike_buffer.cpp.
SpikeBuffer::SpikeIterator front | ( | int | stepOffset = 0 | ) |
Definition at line 225 of file spike_buffer.cpp.
size_t length | ( | ) |
Definition at line 224 of file spike_buffer.cpp.
void reset | ( | int | minDelay, |
int | maxDelay | ||
) |
This method resets all allocated data. Must be called at the beginning of a simulation.
[in] | minDelay | Minimum delay (in number of time steps) the buffer can handle |
[in] | maxDelay | Maximum delay (in number of time steps) the buffer can handle |
Definition at line 223 of file spike_buffer.cpp.
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.
[in] | neurId | corresponding neuron ID |
[in] | delay | scheduling delay (in number of time steps) |
Definition at line 221 of file spike_buffer.cpp.
void step | ( | ) |
Definition at line 222 of file spike_buffer.cpp.