CARLsim
4.1.0
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 103 of file group_monitor.h.
GroupMonitor | ( | GroupMonitorCore * | groupMonitorCorePtr | ) |
Creates a new instance of the GroupMonitor class.
Definition at line 56 of file group_monitor.cpp.
|
virtual |
Cleans up all the memory upon object deletion.
Definition at line 61 of file group_monitor.cpp.
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).
Definition at line 121 of file group_monitor.cpp.
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).
Definition at line 135 of file group_monitor.cpp.
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).
Definition at line 149 of file group_monitor.cpp.
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).
Definition at line 113 of file group_monitor.cpp.
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().
Definition at line 92 of file group_monitor.cpp.
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().
Definition at line 99 of file group_monitor.cpp.
int getRecordingStopTime | ( | ) |
This function returns the simulation time (timestamp) of the last call to stopRecording().
Definition at line 106 of file group_monitor.cpp.
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.
Definition at line 85 of file group_monitor.cpp.
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).
Definition at line 142 of file group_monitor.cpp.
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).
Definition at line 156 of file group_monitor.cpp.
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).
Definition at line 128 of file group_monitor.cpp.
bool isRecording | ( | ) |
Gets record status as a bool. True means it is recording, false means it is not recording.
Definition at line 67 of file group_monitor.cpp.
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().
Definition at line 117 of file group_monitor.cpp.
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().
Definition at line 71 of file group_monitor.cpp.
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.
Definition at line 78 of file group_monitor.cpp.