CARLsim  6.1.0
CARLsim: a GPU-accelerated SNN simulator
GroupMonitor Class Reference

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< float > getDataVector (int nm)
 
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...
 

Detailed Description

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:

// configure a network etc. ...
// create a GroupMonitor pointer to grab the pointer from setGroupMonitor.
GroupMonitor* daGroupMon;
// call setGroupMonitor with carlsim object, sim, with the group ID, daGrpId, as an argument.
daGroupMon=sim.setGroupMonitor(daGrpId);
// begin recording group data for DA group
daGroupMon->startRecording();
// run simulation that generates spikes for 20 seconds.
sim.runNetwork(20);
// stop recording group data for DA group so we can get spike statistics.
daGroupMon->stopRecording();
// print a summary of the group data information
daGroupMon->print();
// get the average value of group data (only support dopamine concentration for now) of DA group
float avgDAValue = daGroupMon->getMeanValue();
TODO:
finish documentation

Definition at line 107 of file group_monitor.h.

Constructor & Destructor Documentation

◆ GroupMonitor()

GroupMonitor ( GroupMonitorCore groupMonitorCorePtr)

Creates a new instance of the GroupMonitor class.

Definition at line 59 of file group_monitor.cpp.

◆ ~GroupMonitor()

~GroupMonitor ( )
virtual

Cleans up all the memory upon object deletion.

Definition at line 64 of file group_monitor.cpp.

Member Function Documentation

◆ getDataVector() [1/2]

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).

Returns
1D vector of float values presenting dopamine concentration

Definition at line 124 of file group_monitor.cpp.

Here is the call graph for this function:

◆ getDataVector() [2/2]

std::vector< float > getDataVector ( int  nm)

Definition at line 131 of file group_monitor.cpp.

Here is the call graph for this function:

◆ getPeakTimeVector()

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).

Returns
1D vector of int values presenting the timestamps of peaks

Definition at line 148 of file group_monitor.cpp.

Here is the call graph for this function:

◆ getPeakValueVector()

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).

Returns
1D vector of float values which are peaks (local maximum values) in group data

Definition at line 162 of file group_monitor.cpp.

Here is the call graph for this function:

◆ getPersistentData()

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 116 of file group_monitor.cpp.

Here is the call graph for this function:

◆ getRecordingLastStartTime()

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().

Returns
the simulation time (ms) of the last call to startRecording()

Definition at line 95 of file group_monitor.cpp.

Here is the call graph for this function:

◆ 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().

Returns
the simulation time (ms) of the first call to startRecording()

Definition at line 102 of file group_monitor.cpp.

Here is the call graph for this function:

◆ getRecordingStopTime()

int getRecordingStopTime ( )

This function returns the simulation time (timestamp) of the last call to stopRecording().

Returns
the simulation time (ms) of the last call to stopRecording()

Definition at line 109 of file group_monitor.cpp.

Here is the call graph for this function:

◆ getRecordingTotalTime()

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.

Returns
the total recording time (ms)

Definition at line 88 of file group_monitor.cpp.

Here is the call graph for this function:

◆ getSortedPeakTimeVector()

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).

Returns
1D vector of int values presenting the timestamps of sorted peaks

Definition at line 155 of file group_monitor.cpp.

Here is the call graph for this function:

◆ getSortedPeakValueVector()

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).

Returns
1D vector of float values presenting sorted peaks

Definition at line 169 of file group_monitor.cpp.

Here is the call graph for this function:

◆ getTimeVector()

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).

Returns
1D vector of int values presenting the timestamps

Definition at line 141 of file group_monitor.cpp.

Here is the call graph for this function:

◆ isRecording()

bool isRecording ( )

Gets record status as a bool. True means it is recording, false means it is not recording.

Returns
bool that is true if object is recording, false otherwise.

Definition at line 70 of file group_monitor.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPersistentData()

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 120 of file group_monitor.cpp.

Here is the call graph for this function:

◆ startRecording()

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 74 of file group_monitor.cpp.

Here is the call graph for this function:

◆ stopRecording()

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 81 of file group_monitor.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: