CARLsim
3.1.3
CARLsim: a GPU-accelerated SNN simulator
|
Class GroupMonitor. More...
#include <group_monitor.h>
Public Member Functions | |
GroupMonitor (GroupMonitorCore *groupMonitorCorePtr) | |
GroupMonitor constructor. More... | |
virtual | ~GroupMonitor () |
GroupMonitor destructor. More... | |
std::vector< float > | getDataVector () |
return the group data vector More... | |
std::vector< int > | getPeakTimeVector () |
return a vector of the timestamps for peak values in group data More... | |
std::vector< float > | getPeakValueVector () |
return a vector of peak values in group data More... | |
bool | getPersistentData () |
Returns a flag that indicates whether PersistentMode is on (true) or off (false) More... | |
int | getRecordingLastStartTime () |
Returns the simulation time (ms) of the last call to startRecording() More... | |
int | getRecordingStartTime () |
Returns the simulation time (ms) of the first call to startRecording() More... | |
int | getRecordingStopTime () |
Returns the simulation time (ms) of the last call to stopRecording() More... | |
int | getRecordingTotalTime () |
Returns the total recording time (ms) More... | |
std::vector< int > | getSortedPeakTimeVector () |
return a vector of the timestamps for peak values in group data (sorted in decending order) More... | |
std::vector< float > | getSortedPeakValueVector () |
return a vector of peak values in group data (sorted in decending order) More... | |
std::vector< int > | getTimeVector () |
return a vector of the timestamps for group data More... | |
bool | isRecording () |
Recording status (true=recording, false=not recording) More... | |
void | setPersistentData (bool persistentData) |
Sets PersistentMode either on (true) or off (false) More... | |
void | startRecording () |
Starts a new recording period. More... | |
void | stopRecording () |
Ends a recording period. More... | |
The GroupMonitor class allows a user record group data (only support dopamine concentration for now) from a particular neuron group. First the method CARLsim::setGroupMonitor must be called with the group ID of the desired group as an argument. The setGroupMonitor call returns a pointer to a GroupMonitor object which can be queried for group data.
Group data will not be recorded until the GroupMonitor 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 GroupMonitor 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().
GroupMonitor objects should only be used after setupNetwork has been called. GroupMonitor objects will be deallocated automatically. The caller should not delete(free) GroupMonitor objects
Example usage:
Definition at line 96 of file group_monitor.h.
GroupMonitor | ( | GroupMonitorCore * | groupMonitorCorePtr | ) |
Creates a new instance of the GroupMonitor class.
|
virtual |
Cleans up all the memory upon object deletion.
std::vector<float> getDataVector | ( | ) |
This function returns a vector containing all group data (only support dopamine concentration for now) If PersistentMode is off, only the last recording period will be considered for calculating metrics. If PersistentMode is on, all the recording periods will be considered. By default, PersistentMode is off, but can be switched on at any point in time by calling setPersistentData(bool).
std::vector<int> getPeakTimeVector | ( | ) |
This function returns a vector containing all timestamps of peaks (local maximum value) in group data. If PersistentMode is off, only the last recording period will be considered for calculating metrics. If PersistentMode is on, all the recording periods will be considered. By default, PersistentMode is off, but can be switched on at any point in time by calling setPersistentData(bool).
std::vector<float> getPeakValueVector | ( | ) |
This function returns a vector containing all peak values for group data. If PersistentMode is off, only the last recording period will be considered for calculating metrics. If PersistentMode is on, all the recording periods will be considered. By default, PersistentMode is off, but can be switched on at any point in time by calling setPersistentData(bool).
bool getPersistentData | ( | ) |
This function returns a flag that indicates whether PersistentMode is currently on (true) or off (false). If PersistentMode is off, only the last recording period will be considered for calculating metrics. If PersistentMode is on, all the recording periods will be considered. By default, PersistentMode is off, but can be switched on at any point in time by calling setPersistentData(bool).
int getRecordingLastStartTime | ( | ) |
This function returns the simulation time (timestamp) of the last call to startRecording(). If PersistentMode is off, this number is equivalent to getRecordingStartTime().
int getRecordingStartTime | ( | ) |
This function returns the simulation time (timestamp) of the first call to startRecording(). If PersistentMode is off, this number is equivalent to getRecordingLastStartTime().
int getRecordingStopTime | ( | ) |
This function returns the simulation time (timestamp) of the last call to stopRecording().
int getRecordingTotalTime | ( | ) |
This function returns the total amount of recording time upon which the calculated metrics are based. If PersistentMode is off, this number is equivalent to getRecordingStopTime()-getRecordingStartTime(). If PersistentMode is on, this number is equivalent to the total time accumulated over all past recording periods. Note that this is not necessarily equivalent to getRecordingStopTime()-getRecordingStartTime(), as there might have been periods in between where recording was off.
std::vector<int> getSortedPeakTimeVector | ( | ) |
This function returns a vector containing all timestamps for sorted peak values (sorted in decending order) In other word, the first element in the vector is the timestamp of the highest peak in recording duration. If PersistentMode is off, only the last recording period will be considered for calculating metrics. If PersistentMode is on, all the recording periods will be considered. By default, PersistentMode is off, but can be switched on at any point in time by calling setPersistentData(bool).
std::vector<float> getSortedPeakValueVector | ( | ) |
This function returns a vector containing all sorted peak values in group data (sorted in decending order). In other word, the first element in the vector is the highest peak value in recording duration. If PersistentMode is off, only the last recording period will be considered for calculating metrics. If PersistentMode is on, all the recording periods will be considered. By default, PersistentMode is off, but can be switched on at any point in time by calling setPersistentData(bool).
std::vector<int> getTimeVector | ( | ) |
This function returns a vector containing all timestamps for group data. If PersistentMode is off, only the last recording period will be considered for calculating metrics. If PersistentMode is on, all the recording periods will be considered. By default, PersistentMode is off, but can be switched on at any point in time by calling setPersistentData(bool).
bool isRecording | ( | ) |
Gets record status as a bool. True means it is recording, false means it is not recording.
void setPersistentData | ( | bool | persistentData | ) |
This function sets PersistentMode either on (true) or off (false). If PersistentMode is off, only the last recording period will be considered for calculating metrics. If PersistentMode is on, all the recording periods will be considered. By default, PersistentMode is off, but can be switched on at any point in time. The current state of PersistentMode can be retrieved by calling getPersistentData().
void startRecording | ( | ) |
This function starts a new recording period. From that moment onward, the data vector will be populated with all the concentrations of enabled neuromodulators of 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().
void stopRecording | ( | ) |
This function ends a recording period, at which point the data vector will no longer be populated with new neuromodulator data. In general, a recording period can be ended at any point in time, and last any number of milliseconds.