CARLsim
3.1.3
CARLsim: a GPU-accelerated SNN simulator
|
a periodic SpikeGenerator (constant ISI) creating spikes at a certain rate More...
#include <periodic_spikegen.h>
Public Member Functions | |
PeriodicSpikeGenerator (bool spikeAtZero=true) | |
PeriodicSpikeGenerator constructor. More... | |
~PeriodicSpikeGenerator () | |
default destructor More... | |
unsigned int | nextSpikeTime (CARLsim *sim, int grpId, int nid, unsigned int currentTime, unsigned int lastScheduledSpikeTime, unsigned int endOfTimeSlice) |
schedules the next spike time More... | |
void | setRates (float rateHz) |
Sets the spike rate of all neurons in the group. More... | |
void | setRates (std::vector< float > ratesHz) |
Sets the spike rate on a neuron-by-neuron basis. More... | |
Public Member Functions inherited from SpikeGenerator | |
virtual | ~SpikeGenerator () |
This class implements a period SpikeGenerator that schedules spikes with a constant inter-spike-interval. The firing rate can be set per neuron or per group. For example, a PeriodicSpikeGenerator with all rates=10Hz will schedule spikes for each neuron in the group at t=100, t=200, t=300 ms, etc. If spikeAtZero is set to true, then the first spike will be scheduled at t=0.
Otherwise, if rates are given in a vector, one rate per neuron in the group is assumed.
Definition at line 21 of file periodic_spikegen.h.
PeriodicSpikeGenerator | ( | bool | spikeAtZero = true | ) |
[in] | spikeAtZero | a boolean flag to indicate whether to insert the first spike at t=0 |
|
virtual |
This function schedules the next spike time, given the currentTime and the lastScheduledSpikeTime. It implements the virtual function of the base class.
[in] | sim | pointer to a CARLsim object |
[in] | grpId | current group ID for which to schedule spikes |
[in] | nid | current neuron ID for which to schedule spikes |
[in] | currentTime | current time (ms) at which spike scheduler is called |
[in] | lastScheduledSpikeTime | the last time (ms) at which a spike was scheduled for this nid, grpId |
[in] | endOfTimeSlice | the end of the time slice (ms) for which to schedule spikes |
Implements SpikeGenerator.
void setRates | ( | float | rateHz | ) |
The spike rate of every neuron in the group will be set to rateHz
.
[in] | rateHz | the firing rate (Hz) to be applied to all neurons in the group |
void setRates | ( | std::vector< float > | ratesHz | ) |
This sets the spike rate of every neuron in the group to a value specified in the vector. One entry per neuron is assumed.
[in] | ratesHz | A vector specifying the firing rate (Hz) for every neuron in the group |