updateNM4Levels Development Documentation

This documentation provides development documentation about the feature updateNM4Levels that was created for the Hippocampome Oblomem neuromodulation research project. This feature allows neuromodulation levels to be altered at runtime during a CARLsim experiment. Originally, neuromodulation variable could only be altered once per experiment and were set in the configuration state of an experiment.

Branches

This feature exists as a feature branch for the Hippocampome branch of CARLsim6, and also a separate feature branch of the main CARLsim6 code base. A version was developed for the main CARLsim6 code base because it could be added as a general feature to CARLsim in the future. Anyone working on the Hippocampome Oblomem project will want to use the Hippocampome branch version if they want to use this feature.

Hippocampome version is here. CARLsim6 main branch version is here.

Usage

updateNM4Levels()

updateNM4Levels(int netID, int groupID, bool updateDA, bool update5HT, bool updateACh, bool updateNE, float levelDA, float level5HT, float levelACh, float levelNE);

Allowed CARLsim states:
RUN_STATE

Parameters

parameterdescription
netIDthe ID of a network. If only 1 network is in the simulation then this should be set to 0.
groupIDthe ID of a group.
updateDAset if Dopamine neuromodulation should be updated
update5HTset if Serotonin neuromodulation should be updated
updateAChset if Acetylcholine neuromodulation should be updated
updateNEset if Noradrenaline neuromodulation should be updated
levelDAset the new level of Dopamine neuromodulation
level5HTset the new level of Serotonin neuromodulation
levelAChset the new level of Acetylcholine neuromodulation
levelNEset the new level of Noradrenaline neuromodulation

This function updates the levels originally set by the setNeuromodulator() function. Specifically, this updates the “base” values, e.g., baseACh. This function requires that values be set in setNeuromodulator() for any neuron group that updateNM4Levels() will update the values of.

groupID appears to be based on the order in which neuron groups have their Start Id as reported in carlsim.log of a simulation. Notably, this is not the order specified by the standard neuron group ID that is stored in the neuron group name. For instance, this groupID may be different in number than that specified by a neuron group name such as MEC_LII_Stellate. Also, the order of IDs in groupID does not depend on which groups have neuromodulation. For example, there is only one neuron group (GroupA) with neuromodulation and that group’s Start Id is higher than two other groups then GroupA’s groupID is 2.

It is recommended that updateNM4Levels() be used in combination with the setWeightAndWeightChangeUpdate() function. The reason for this is that by default CARLsim only checks for neuromodulation level updates each second of simulated time. This means that an update created with updateNM4Levels() will not go into effect until the next second of time in the simulation passes. Using setWeightAndWeightChangeUpdate() to set the CARLsim update function to every 10 ms with the INTERVAL_10MS setting can allow for the updateNM4Levels()’s modulation to go into effect faster. CARLsim will then check every 10 ms for changes to neuromodulation levels. For example, the function can be set as setWeightAndWeightChangeUpdate(INTERVAL_10MS, false, 0.5f).

Example of usage:

setWeightAndWeightChangeUpdate(INTERVAL_10MS, false, 0.5f) This sets the simulation to check for neuromodulation updates every 10 ms.

sim.updateNM4Levels(0, 0, false, false, true, true, 0, 0, 0.5, 0.25); This sets the neuron group with groupID 0 to have its Acetylcholine and Noradrenaline levels updated. The levels for them are set to 0.5 and 0.25, respectively.

Programming design

A similar approach to the setweight() function was used to create this function. Code for updateNM4Levels() was added to:
/carlsim/interface/src/carlsim.cpp
/carlsim/interface/inc/carlsim.h
/carlsim/kernel/src/snn_manager.cpp
/carlsim/kernel/inc/snn.h
This is similar to files that include setweight() code.

In snn_manager.cpp, the cudaMemcpy() function was used to copy the neuromodulation levels to CUDA memory with the grpACh and other neuromodulator variables. In CPU memory, grpACh and other neuromodulation variables have their values copied to memory. This updates the values in memory with the runtimeData objects for the neuromodulation levels. The other files that include updateNM4Levels() code are forms of code that allow the function to be accessed and pass data within the simulator.