62 spikeMonitorCorePtr_ = spikeMonitorCorePtr;
66 delete spikeMonitorCorePtr_;
72 std::string funcName =
"clear()";
75 spikeMonitorCorePtr_->
clear();
79 std::string funcName =
"getPopMeanFiringRate()";
86 std::string funcName =
"getPopStdFiringRate()";
93 std::string funcName =
"getPopNumSpikes()";
98 "This function is not yet supported in this mode.");
104 std::string funcName =
"getMaxFiringRate()";
111 std::string funcName =
"getMinFiringRate()";
118 std::string funcName =
"getAllFiringRates()";
125 std::string funcName =
"getNeuronMeanFiringRate()";
133 std::string funcName =
"getNeuronNumSpikes()";
138 "This function is not yet supported in this mode.");
145 std::string funcName =
"getNumNeuronsWithFiringRate()";
153 std::stringstream funcName; funcName <<
"getPercentNeuronsWithFiringRate(" << min <<
"," << max <<
")";
163 std::string funcName =
"getNumSilentNeurons()";
170 std::string funcName =
"getPercentSilentNeurons()";
177 std::string funcName =
"getSpikeVector2D()";
185 std::string funcName =
"getAllFiringRatesSorted()";
196 std::string funcName =
"print()";
199 spikeMonitorCorePtr_->
print(printSpikeTimes);
203 std::string funcName =
"startRecording()";
210 std::string funcName =
"stopRecording()";
217 std::string funcName =
"getRecordingTotalTime()";
224 std::string funcName =
"getRecordingLastStartTime()";
231 std::string funcName =
"getRecordingStartTime()";
238 std::string funcName =
"getRecordingStopTime()";
253 return spikeMonitorCorePtr_->
getMode();
259 "This function call is not yet supported.");
261 spikeMonitorCorePtr_->
setMode(mode);
265 std::string funcName =
"setLogFile";
268 std::string fileNameLower = fileName;
269 std::transform(fileNameLower.begin(), fileNameLower.end(), fileNameLower.begin(), ::tolower);
271 if (fileNameLower ==
"null") {
275 fid = fopen(fileName.c_str(),
"wb");
278 std::string fileError =
" Double-check file permissions and make sure directory exists.";
float getNeuronMeanFiringRate(int neurId)
returns the mean firing rate of a specific neuron in the group
void startRecording()
Starts a new recording period.
int getNumNeuronsWithFiringRate(float min, float max)
returns number of neurons whose firing rate was in [min,max] during recording
void clear()
deletes data from the 2D spike vector
SpikeMonMode
SpikeMonitor mode.
void setMode(SpikeMonMode mode)
sets recording mode
std::vector< float > getAllFiringRates()
returns a list of firing rates for all neurons in the group (sorted by neuron ID ascending) ...
int getNumSilentNeurons()
returns number of neurons that didn't spike while recording
std::vector< float > getAllFiringRatesSorted()
Returns all the neuronal mean firing rates in ascending order.
int getNumSilentNeurons()
returns the number of neurons that are silent.
std::vector< float > getAllFiringRates()
Returns the average firing rate of all the neurons in the group as a vector of floats.
long int getRecordingStopTime()
returns the timestamp of stopRecording
float getPercentSilentNeurons()
returns percentage of neurons that didn't spike during recording
float getPopMeanFiringRate()
Returns the mean firing rate of the entire neuronal population.
std::vector< float > getAllFiringRatesSorted()
returns a list of firing rates for all neurons in the group (sorted by firing rate ascending) ...
long int getRecordingTotalTime()
returns the total recorded time in ms
std::vector< std::vector< int > > getSpikeVector2D()
returns the 2D spike vector
SpikeMonMode getMode()
returns recording mode
float getPercentSilentNeurons()
returns the percentage of total neurons in group that are silent.
parameter cannot have larger vaule than some vaule
float getPercentNeuronsWithFiringRate(float min, float max)
returns percentage of neurons whose firing rate was in [min,max] during recording ...
float getNeuronMeanFiringRate(int neurId)
returns the recorded mean firing rate for a specific neuron
int getNeuronNumSpikes(int neurId)
returns the total number of spikes of a specific neuron in the group
float getMinFiringRate()
returns the smallest neuronal mean firing rate in the group
int getNeuronNumSpikes(int neurId)
returns the number of recorded spikes of a specific neuron
SpikeMonitor(SpikeMonitorCore *spikeMonitorCorePtr)
SpikeMonitor constructor.
std::vector< std::vector< int > > getSpikeVector2D()
returns the 2D AER vector
void startRecording()
starts recording AER data
void stopRecording()
Ends a recording period.
float getPopStdFiringRate()
Returns the standard deviation of firing rates in the entire neuronal population. ...
void setSpikeFileId(FILE *spikeFileId)
sets pointer to spike file
float getMaxFiringRate()
returns the largest recorded firing rate
int getNumNeuronsWithFiringRate(float min, float max)
Returns the number of neurons that fall within this particular min/max range (inclusive).
void setPersistentData(bool persistentData)
sets status of PersistentData mode
float getMaxFiringRate()
returns the largest neuronal mean firing rate in the group
void print(bool printSpikeTimes=true)
prints the 2D spike vector.
mode in which spike information is collected in AER format
static void assertTrue(bool statement, errorType errorIfAssertionFails, std::string errorFunc, std::string errorMsgPrefix="", std::string errorMsgSuffix="")
simple wrapper for assert statement
long int getRecordingStartTime()
retunrs the timestamp of the first startRecording in ms
long int getRecordingLastStartTime()
returns the timestamp of the last startRecording in ms
int getPopNumSpikes()
Returns the total number of spikes in the group.
~SpikeMonitor()
SpikeMonitor destructor.
bool isRecording()
Recording status (true=recording, false=not recording)
void print(bool printSpikeTimes)
prints the AER vector in human-readable format
int getPopNumSpikes()
returns the total number of recorded spikes in the group
SpikeMonMode getMode()
Returns the current SpikeMonitor mode.
void setMode(SpikeMonMode mode=AER)
Sets the current SpikeMonitor mode.
float getPercentNeuronsWithFiringRate(float min, float max)
returns the percentage of total neurons in that are in the range specified by the user...
long int getRecordingLastStartTime()
Returns the simulation time (ms) of the last call to startRecording()
void setLogFile(const std::string &logFileName)
Sets the name of the spike file binary.
float getMinFiringRate()
returns the smallest recorded firing rate
bool isRecording()
returns recording status
long int getRecordingStartTime()
Returns the simulation time (ms) of the first call to startRecording()
void setPersistentData(bool persistentData)
Sets PersistentMode either on (true) or off (false)
bool getPersistentData()
returns status of PersistentData mode
long int getRecordingStopTime()
Returns the simulation time (ms) of the last call to stopRecording()
float getPopStdFiringRate()
computes the standard deviation of firing rates in the group
void clear()
Truncates the 2D spike vector.
float getPopMeanFiringRate()
returns the recorded mean firing rate of the group
function can only be called in certain mode
parameter cannot have negative value (opposite to "must be", but includes zero)
bool getPersistentData()
Returns a flag that indicates whether PersistentMode is on (true) or off (false)
long int getRecordingTotalTime()
Returns the total recording time (ms)
void stopRecording()
stops recording AER data