CARLsim
5.0.0
CARLsim: a GPU-accelerated SNN simulator
|
Go to the documentation of this file.
61 spikeMonitorCorePtr_ = spikeMonitorCorePtr;
65 delete spikeMonitorCorePtr_;
71 std::string funcName =
"clear()";
74 spikeMonitorCorePtr_->
clear();
78 std::string funcName =
"getPopMeanFiringRate()";
85 std::string funcName =
"getPopStdFiringRate()";
92 std::string funcName =
"getPopNumSpikes()";
97 "This function is not yet supported in this mode.");
103 std::string funcName =
"getMaxFiringRate()";
110 std::string funcName =
"getMinFiringRate()";
117 std::string funcName =
"getAllFiringRates()";
124 std::string funcName =
"getNeuronMeanFiringRate()";
132 std::string funcName =
"getNeuronNumSpikes()";
137 "This function is not yet supported in this mode.");
144 std::string funcName =
"getNumNeuronsWithFiringRate()";
152 std::stringstream funcName; funcName <<
"getPercentNeuronsWithFiringRate(" << min <<
"," << max <<
")";
162 std::string funcName =
"getNumSilentNeurons()";
169 std::string funcName =
"getPercentSilentNeurons()";
176 std::string funcName =
"getSpikeVector2D()";
184 std::string funcName =
"getAllFiringRatesSorted()";
195 std::string funcName =
"print()";
198 spikeMonitorCorePtr_->
print(printSpikeTimes);
202 std::string funcName =
"startRecording()";
209 std::string funcName =
"stopRecording()";
216 std::string funcName =
"getRecordingTotalTime()";
223 std::string funcName =
"getRecordingLastStartTime()";
230 std::string funcName =
"getRecordingStartTime()";
237 std::string funcName =
"getRecordingStopTime()";
252 return spikeMonitorCorePtr_->
getMode();
258 "This function call is not yet supported.");
260 spikeMonitorCorePtr_->
setMode(mode);
264 std::string funcName =
"setLogFile";
267 std::string fileNameLower = fileName;
268 std::transform(fileNameLower.begin(), fileNameLower.end(), fileNameLower.begin(), ::tolower);
270 if (fileNameLower ==
"null") {
274 fid = fopen(fileName.c_str(),
"wb");
277 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