The SpikeMonitor class allows a user record spike data from a particular neuron group. First the method CARLsim::setSpikeMonitor must be called with the group ID of the desired group as an argument. The setSpikeMonitor call returns a pointer to a SpikeMonitor object which can be queried for spike data.
There are two different modes that define what information is collected exactly.
- AER: AER mode will collect the exact spike times of all neurons in the group and store them in a 2D spike spike vector. The first dimension of the vector is neuron id, the second dimension is spike times. Each element spkVector[i] is thus a vector of all spike times for the i-th neuron in the group. This mode is activated by default. Because of the sheer amount of information, it is unwise to run this mode for extended periods of time. Note that recording in this mode may significantly slow down your simulation.
- COUNT: SpikeCount mode will only collect spike count information, such as the number of spikes per neuron. This mode cannot retrieve exact spike times. Thus it is not possible to calculate some of the more elaborate metrics, such as spike-time correlations.
Spike data will not be recorded until the SpikeMonitor member function startRecording() is called. Before any metrics can be computed, the user must call stopRecording(). In general, a new recording period (the time period between startRecording and stopRecording calls) can be started at any point in time, and can last any number of milliseconds. The SpikeMonitor has a PersistentMode, which is off by default. When PersistentMode is off, only the last recording period will be considered. When PersistentMode is on, all the recording periods will be considered. By default, PersistentMode can be switched on/off by calling setPersistentData(bool). The total time over which the metric is calculated can be retrieved by calling getRecordingTotalTime().
The above configurations do not affect the generation of the .dat spike file. That file will always contain all the spikes of all the neurons in the group, for the entire simulation.
SpikeMonitor objects should only be used after setupNetwork has been called. SpikeMonitor objects will be deallocated automatically.
Example usage:
For additional information on how to use the SpikeMonitor object, please see Examples/spikeInfo.
- TODO:
- finish documentation
Definition at line 123 of file spike_monitor.h.
This function starts a new recording period. From that moment onward, the 2D spike vector will be populated with all the spikes of all the neurons in the group. Before any metrics can be computed, the user must call stopRecording(). Recording periods must be ended with stopRecording(). In general, a new recording period can be started at any point in time, and can last any number of milliseconds. If PersistentMode is off, only the last recording period will be considered. If PersistentMode is on, all the recording periods will be considered. By default, PersistentMode is off, and can be switched on by calling setPersistentData(bool). The total time over which the metric is calculated can be retrieved by calling getRecordingTotalTime().
Definition at line 202 of file spike_monitor.cpp.
This function ends a recording period, at which point the 2D spike vector will no longer be populated with spikes. In general, a recording period can be ended at any point in time, and last any number of milliseconds. From this moment onward, a variety of metrics can be computed, which are based on the spikes found in the 2D spike vector. It is also possible to retrieve the raw spike vector itself by calling getSpikeVector2D(). If PersistentMode is off, only the last recording period will be considered. If PersistentMode is on, all the recording periods will be considered. By default, PersistentMode is off, and can be switched on by calling setPersistentData(bool). The total time over which the metric is calculated can be retrieved by calling getRecordingTotalTime().
Definition at line 209 of file spike_monitor.cpp.