CARLsim
4.1.0
CARLsim: a GPU-accelerated SNN simulator
|
Go to the documentation of this file.
60 spikeMonitorCorePtr_ = spikeMonitorCorePtr;
64 delete spikeMonitorCorePtr_;
70 std::string funcName =
"clear()";
73 spikeMonitorCorePtr_->
clear();
77 std::string funcName =
"getPopMeanFiringRate()";
84 std::string funcName =
"getPopStdFiringRate()";
91 std::string funcName =
"getPopNumSpikes()";
96 "This function is not yet supported in this mode.");
102 std::string funcName =
"getMaxFiringRate()";
109 std::string funcName =
"getMinFiringRate()";
116 std::string funcName =
"getAllFiringRates()";
123 std::string funcName =
"getNeuronMeanFiringRate()";
131 std::string funcName =
"getNeuronNumSpikes()";
136 "This function is not yet supported in this mode.");
143 std::string funcName =
"getNumNeuronsWithFiringRate()";
151 std::stringstream funcName; funcName <<
"getPercentNeuronsWithFiringRate(" << min <<
"," << max <<
")";
161 std::string funcName =
"getNumSilentNeurons()";
168 std::string funcName =
"getPercentSilentNeurons()";
175 std::string funcName =
"getSpikeVector2D()";
183 std::string funcName =
"getAllFiringRatesSorted()";
194 std::string funcName =
"print()";
197 spikeMonitorCorePtr_->
print(printSpikeTimes);
201 std::string funcName =
"startRecording()";
208 std::string funcName =
"stopRecording()";
215 std::string funcName =
"getRecordingTotalTime()";
222 std::string funcName =
"getRecordingLastStartTime()";
229 std::string funcName =
"getRecordingStartTime()";
236 std::string funcName =
"getRecordingStopTime()";
251 return spikeMonitorCorePtr_->
getMode();
257 "This function call is not yet supported.");
259 spikeMonitorCorePtr_->
setMode(mode);
263 std::string funcName =
"setLogFile";
266 std::string fileNameLower = fileName;
267 std::transform(fileNameLower.begin(), fileNameLower.end(), fileNameLower.begin(), ::tolower);
269 if (fileNameLower ==
"null") {
273 fid = fopen(fileName.c_str(),
"wb");
276 std::string fileError =
" Double-check file permissions and make sure directory exists.";
@ CANNOT_BE_LARGER
parameter cannot have larger vaule than some vaule
@ AER
mode in which spike information is collected in AER format
long int getRecordingLastStartTime()
returns the timestamp of the last startRecording in ms
@ CANNOT_BE_ON
parameter cannot be on
void clear()
Truncates the 2D spike vector.
float getPercentSilentNeurons()
returns the percentage of total neurons in group that are silent.
void setPersistentData(bool persistentData)
Sets PersistentMode either on (true) or off (false)
~SpikeMonitor()
SpikeMonitor destructor.
long int getRecordingStartTime()
retunrs the timestamp of the first startRecording in ms
bool isRecording()
Recording status (true=recording, false=not recording)
float getMinFiringRate()
returns the smallest recorded firing rate
int getPopNumSpikes()
Returns the total number of spikes in the group.
float getMinFiringRate()
returns the smallest neuronal mean firing rate in the group
std::vector< float > getAllFiringRates()
Returns the average firing rate of all the neurons in the group as a vector of floats.
void print(bool printSpikeTimes=true)
prints the 2D spike vector.
void stopRecording()
Ends a recording period.
long int getRecordingLastStartTime()
Returns the simulation time (ms) of the last call to startRecording()
SpikeMonitor(SpikeMonitorCore *spikeMonitorCorePtr)
SpikeMonitor constructor.
SpikeMonMode getMode()
Returns the current SpikeMonitor mode.
void print(bool printSpikeTimes)
prints the AER vector in human-readable format
bool isRecording()
returns recording status
int getPopNumSpikes()
returns the total number of recorded spikes in the group
bool getPersistentData()
returns status of PersistentData mode
@ MUST_BE_ON
parameter must be on
float getPopStdFiringRate()
Returns the standard deviation of firing rates in the entire neuronal population.
long int getRecordingStartTime()
Returns the simulation time (ms) of the first call to startRecording()
float getPopMeanFiringRate()
Returns the mean firing rate of the entire neuronal population.
@ FILE_CANNOT_OPEN
could not open file
float getPopStdFiringRate()
computes the standard deviation of firing rates in the group
void setMode(SpikeMonMode mode)
sets recording mode
std::vector< std::vector< int > > getSpikeVector2D()
returns the 2D spike vector
std::vector< float > getAllFiringRates()
returns a list of firing rates for all neurons in the group (sorted by neuron ID ascending)
bool getPersistentData()
Returns a flag that indicates whether PersistentMode is on (true) or off (false)
float getPopMeanFiringRate()
returns the recorded mean firing rate of the group
long int getRecordingStopTime()
returns the timestamp of stopRecording
void stopRecording()
stops recording AER data
float getPercentNeuronsWithFiringRate(float min, float max)
returns the percentage of total neurons in that are in the range specified by the user,...
long int getRecordingTotalTime()
returns the total recorded time in ms
float getNeuronMeanFiringRate(int neurId)
returns the mean firing rate of a specific neuron in the group
float getPercentSilentNeurons()
returns percentage of neurons that didn't spike during recording
int getNumSilentNeurons()
returns the number of neurons that are silent.
int getNumNeuronsWithFiringRate(float min, float max)
returns number of neurons whose firing rate was in [min,max] during recording
@ CAN_ONLY_BE_CALLED_IN_MODE
function can only be called in certain mode
@ UNKNOWN
an unknown error
std::vector< float > getAllFiringRatesSorted()
returns a list of firing rates for all neurons in the group (sorted by firing rate ascending)
long int getRecordingStopTime()
Returns the simulation time (ms) of the last call to stopRecording()
int getNumSilentNeurons()
returns number of neurons that didn't spike while recording
SpikeMonMode
SpikeMonitor mode.
void startRecording()
Starts a new recording period.
void setLogFile(const std::string &logFileName)
Sets the name of the spike file binary.
void clear()
deletes data from the 2D spike vector
SpikeMonMode getMode()
returns recording mode
int getNumNeuronsWithFiringRate(float min, float max)
Returns the number of neurons that fall within this particular min/max range (inclusive).
int getNeuronNumSpikes(int neurId)
returns the total number of spikes of a specific neuron in the group
long int getRecordingTotalTime()
Returns the total recording time (ms)
int getNeuronNumSpikes(int neurId)
returns the number of recorded spikes of a specific neuron
void setSpikeFileId(FILE *spikeFileId)
sets pointer to spike file
std::vector< float > getAllFiringRatesSorted()
Returns all the neuronal mean firing rates in ascending order.
float getNeuronMeanFiringRate(int neurId)
returns the recorded mean firing rate for a specific neuron
static void assertTrue(bool statement, errorType errorIfAssertionFails, std::string errorFunc, std::string errorMsgPrefix="", std::string errorMsgSuffix="")
simple wrapper for assert statement
@ CANNOT_BE_NEGATIVE
parameter cannot have negative value (opposite to "must be", but includes zero)
float getMaxFiringRate()
returns the largest neuronal mean firing rate in the group
std::vector< std::vector< int > > getSpikeVector2D()
returns the 2D AER vector
float getMaxFiringRate()
returns the largest recorded firing rate
void setPersistentData(bool persistentData)
sets status of PersistentData mode
float getPercentNeuronsWithFiringRate(float min, float max)
returns percentage of neurons whose firing rate was in [min,max] during recording
void setMode(SpikeMonMode mode=AER)
Sets the current SpikeMonitor mode.
void startRecording()
starts recording AER data