Auryn simulator
v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
|
Delay object for spikes which is synchronized between nodes using the SyncBuffer formalism implemented in System. More...
#include <SpikeDelay.h>
Public Member Functions | |
SpikeDelay (int delaysteps=MINDELAY) | |
The default constructor. More... | |
virtual | ~SpikeDelay () |
The default destructor. More... | |
void | set_delay (int delay) |
Set delay in number of timesteps. More... | |
int | get_delay () |
Get delay time in AurynTime. More... | |
void | set_clock_ptr (AurynTime *clock) |
Internal function to set clock pointer. More... | |
void | insert_spike (NeuronID i, AurynTime ahead) |
Allows to insert spikes so many time steps ahead with less than max delay. More... | |
void | insert_spike_and_attrib (NeuronID i, AurynState attr, AurynTime ahead) |
Allows to insert spikes with a single attribute so many time steps ahead with less than max delay. More... | |
void | push_back (NeuronID i) |
Allows to use SpikeDelay like a queue. More... | |
void | push_back (NeuronID i, AurynState attr) |
Like push_back, but also allows to add an attribute. More... | |
void | push_back (SpikeContainer *sc) |
Pushes all elemens from given SpikeContainer into the delay. More... | |
int | get_num_attributes () |
Returns the number of spike attributes per spike. More... | |
void | inc_num_attributes (int x) |
Internally used by SyncBuffer to submit x attributes with spikes in this delay. More... | |
SpikeContainer * | get_spikes (unsigned int pos=1) |
Returns the spikes at a given delay position. More... | |
SpikeContainer * | get_spikes_immediate () |
Returns the spikes stored into the delay within this very same time step. More... | |
AttributeContainer * | get_attributes (unsigned int pos=1) |
Like get_spikes but returns the spike attributes. More... | |
AttributeContainer * | get_attributes_immediate () |
Like get_spikes_immediate but returns the spike attributes. More... | |
void | print () |
Print delay contents for debugging . More... | |
void | clear () |
Friends | |
class | boost::serialization::access |
Delay object for spikes which is synchronized between nodes using the SyncBuffer formalism implemented in System.
A simple list class to store spikes (numbers of type NeuronID). Memory allocation is only done when the container needs to grow. The class never shrinks thus optimizing performance but not memory efficiency.
SpikeDelay::SpikeDelay | ( | int | delaysteps = MINDELAY | ) |
The default constructor.
void SpikeDelay::clear | ( | ) |
AttributeContainer * SpikeDelay::get_attributes | ( | unsigned int | pos = 1 | ) |
AttributeContainer * SpikeDelay::get_attributes_immediate | ( | ) |
Like get_spikes_immediate but returns the spike attributes.
int SpikeDelay::get_num_attributes | ( | ) |
SpikeContainer * SpikeDelay::get_spikes | ( | unsigned int | pos = 1 | ) |
Returns the spikes at a given delay position.
pos == 1 corresponds to the maximum delay of the SpikeDelay and at least to MINDELAY+1. pos == 2 corresponds to the maximum delay -1, and so forth ...
SpikeContainer * SpikeDelay::get_spikes_immediate | ( | ) |
Returns the spikes stored into the delay within this very same time step.
void SpikeDelay::inc_num_attributes | ( | int | x | ) |
Internally used by SyncBuffer to submit x attributes with spikes in this delay.
Allows to insert spikes so many time steps ahead with less than max delay.
i | Neuron id of the spike |
ahead | Time steps in AurynTime in the future where to insert the spike in the delay |
void SpikeDelay::insert_spike_and_attrib | ( | NeuronID | i, |
AurynState | attr, | ||
AurynTime | ahead | ||
) |
Allows to insert spikes with a single attribute so many time steps ahead with less than max delay.
i | Neuron id of the spike |
attr | The spike attribute to insert |
ahead | Time steps in AurynTime in the future where to insert the spike in the delay |
void SpikeDelay::print | ( | ) |
Print delay contents for debugging .
void SpikeDelay::push_back | ( | NeuronID | i | ) |
Allows to use SpikeDelay like a queue.
This pushes into get_spikes_immediate()
void SpikeDelay::push_back | ( | NeuronID | i, |
AurynState | attr | ||
) |
Like push_back, but also allows to add an attribute.
This pushes into get_spikes_immediate()
void SpikeDelay::push_back | ( | SpikeContainer * | sc | ) |
Pushes all elemens from given SpikeContainer into the delay.
This pushes into get_spikes_immediate()
void SpikeDelay::set_clock_ptr | ( | AurynTime * | clock | ) |
Internal function to set clock pointer.
Sets internal clock pointer to system wide clock pointer. It is used by the System class
void SpikeDelay::set_delay | ( | int | delay | ) |
Set delay in number of timesteps.
This allows to set the size of the delay in timesteps. The delay has to be at least of size MINDELAY.
|
friend |