65 #if CREATE_SPIKEDIR_IF_NOT_EXISTS 66 #if defined(WIN32) || defined(WIN64) 85 loggerMode_ = loggerMode;
86 preferredSimMode_ = prferredSimMode;
93 hasSetHomeoALL_ =
false;
94 hasSetHomeoBaseFiringALL_ =
false;
95 hasSetSTDPALL_ =
false;
96 hasSetSTPALL_ =
false;
97 hasSetConductances_ =
false;
115 for (
int i=0; i<spkGen_.size(); i++) {
116 if (spkGen_[i]!=NULL)
120 for (
int i=0; i<connGen_.size(); i++) {
121 if (connGen_[i]!=NULL)
150 short int connect(
int grpId1,
int grpId2,
const std::string& connType,
const RangeWeight& wt,
float connProb,
151 const RangeDelay& delay,
const RadiusRF& radRF,
bool synWtType,
float mulSynFast,
float mulSynSlow)
154 std::stringstream grpId1str; grpId1str <<
"Group Id " << grpId1;
155 std::stringstream grpId2str; grpId2str <<
"Group Id " << grpId2;
159 " is PoissonGroup, connect");
164 "Connection Probability connProb",
"[0,1]");
170 || connType.compare(
"gaussian")==0 && (radRF.
radX>-1 || radRF.
radY>-1 || radRF.
radZ>-1),
182 if (connType.compare(
"one-to-one")==0 && (radRF.
radX>0 || radRF.
radY>0 || radRF.
radZ>0)) {
183 userWarnings_.push_back(
"RadiusRF>0 will be ignored for connection type \"one-to-one\"");
187 if (fabs(wt.
min)>1e-15) {
188 std::cerr << funcName <<
": " << wt <<
". Non-zero minimum weights are not yet supported.\n" << std::endl;
195 grpId1str.str() +
" and " + grpId2str.str());
199 grpId1str.str() +
" and " + grpId2str.str());
202 connSyn_[grpId1].push_back(grpId2);
205 radRF, mulSynFast, mulSynSlow, synWtType);
211 std::stringstream grpId1str; grpId1str <<
". Group Id " << grpId1;
212 std::stringstream grpId2str; grpId2str <<
". Group Id " << grpId2;
216 " is PoissonGroup, connect");
225 grpId1str.str() +
" and " + grpId2str.str());
228 grpId1str.str() +
" and " + grpId2str.str());
231 connSyn_[grpId1].push_back(grpId2);
236 connGen_.push_back(CGC);
237 return snn_->
connect(grpId1, grpId2, CGC, 1.0f, 1.0f, synWtType);
245 std::stringstream grpId1str; grpId1str <<
". Group Id " << grpId1;
246 std::stringstream grpId2str; grpId2str <<
". Group Id " << grpId2;
250 " is PoissonGroup, connect");
255 funcName,
"CONFIG.");
261 grpId1str.str() +
" and " + grpId2str.str());
264 grpId1str.str() +
" and " + grpId2str.str());
267 connSyn_[grpId1].push_back(grpId2);
271 connGen_.push_back(CGC);
272 return snn_->
connect(grpId1, grpId2, CGC, mulSynFast, mulSynSlow, synWtType);
276 std::stringstream funcName; funcName <<
"connectCompartments(" << grpIdLower <<
"," << grpIdUpper <<
")";
279 std::stringstream grpIdLowerStr; grpIdLowerStr <<
"Group Id " << grpIdLower;
280 std::stringstream grpIdUpperStr; grpIdUpperStr <<
"Group Id " << grpIdUpper;
282 grpIdLowerStr.str(),
"[0,getNumGroups()]");
284 grpIdUpperStr.str(),
"[0,getNumGroups()]");
286 grpIdLowerStr.str() +
" and " + grpIdUpperStr.str());
290 grpIdLowerStr.str() +
" is PoissonGroup, connectCompartments");
292 grpIdUpperStr.str() +
" is PoissonGroup, connectCompartments");
297 grpIdUpperStr.str());
302 grpIdUpperStr.str());
307 grpIdLowerStr.str() +
" and " + grpIdUpperStr.str());
310 grpIdLowerStr.str() +
" and " + grpIdUpperStr.str());
313 UserErrors::assertTrue(std::find(connComp_[grpIdLower].begin(), connComp_[grpIdLower].end(), grpIdUpper) ==
315 grpIdLowerStr.str() +
" and " + grpIdUpperStr.str());
316 UserErrors::assertTrue(std::find(connComp_[grpIdUpper].begin(), connComp_[grpIdUpper].end(), grpIdLower) ==
318 grpIdLowerStr.str() +
" and " + grpIdUpperStr.str());
322 funcName.str(),
"Number of compartmental connections for group " + grpIdLowerStr.str(),
323 "[0,getMaxNumCompConnections()");
325 funcName.str(),
"Number of compartmental connections for group " + grpIdUpperStr.str(),
326 "[0,getMaxNumCompConnections()");
329 connComp_[grpIdLower].push_back(grpIdUpper);
330 connComp_[grpIdUpper].push_back(grpIdLower);
337 return createGroup(grpName,
Grid3D(nNeur,1,1), neurType, preferredPartition, preferredBackend);
342 return createGroupLIF(grpName,
Grid3D(nNeur,1,1), neurType, preferredPartition, preferredBackend);
347 std::string funcName =
"createGroup(\""+grpName+
"\")";
349 funcName,
"CONFIG.");
357 userWarnings_.push_back(
"Make sure to call setSTP on group "+grpName);
359 userWarnings_.push_back(
"Make sure to call setSTDP on group "+grpName);
361 userWarnings_.push_back(
"Make sure to call setHomeostasis on group "+grpName);
362 if (hasSetHomeoBaseFiringALL_)
363 userWarnings_.push_back(
"Make sure to call setHomeoBaseFiringRate on group "+grpName);
365 int grpId = snn_->
createGroup(grpName.c_str(), grid, neurType, preferredPartition, preferredBackend);
366 grpIds_.push_back(grpId);
368 int partitionOffset = 0;
373 int prefPartition = preferredPartition + partitionOffset;
374 groupPrefNetIds_.insert(std::pair<int, int>(grpId, prefPartition));
377 connSyn_.resize(grpIds_.size());
378 connComp_.resize(grpIds_.size());
385 std::string funcName =
"createGroupLIF(\""+grpName+
"\")";
387 funcName,
"CONFIG.");
395 userWarnings_.push_back(
"Make sure to call setSTP on group "+grpName);
397 userWarnings_.push_back(
"Make sure to call setSTDP on group "+grpName);
399 userWarnings_.push_back(
"Make sure to call setHomeostasis on group "+grpName);
400 if (hasSetHomeoBaseFiringALL_)
401 userWarnings_.push_back(
"Make sure to call setHomeoBaseFiringRate on group "+grpName);
403 int grpId = snn_->
createGroupLIF(grpName.c_str(), grid, neurType, preferredPartition, preferredBackend);
404 grpIds_.push_back(grpId);
406 int partitionOffset = 0;
411 int prefPartition = preferredPartition + partitionOffset;
412 groupPrefNetIds_.insert(std::pair<int, int>(grpId, prefPartition));
415 connSyn_.resize(grpIds_.size());
416 connComp_.resize(grpIds_.size());
428 std::string funcName =
"createSpikeGeneratorGroup(\""+grpName+
"\")";
430 funcName,
"CONFIG.");
436 grpIds_.push_back(grpId);
439 connSyn_.resize(grpIds_.size());
440 connComp_.resize(grpIds_.size());
446 std::string funcName =
"setCompartmentParameters(\"" +
getGroupName(grpId) +
"\")";
453 #define LN_I_CALC_TYPES__REQUIRED_FOR_NETWORK_LEVEL 457 std::stringstream funcName; funcName <<
"setConductances(" << isSet <<
")";
459 funcName.str(),
"CONFIG.");
460 hasSetConductances_ =
true;
463 snn_->
setConductances(
true, def_tdAMPA_, 0, def_tdNMDA_, def_tdGABAa_, 0, def_tdGABAb_);
472 std::stringstream funcName; funcName <<
"setConductances(" << isSet <<
"," << tdAMPA <<
"," << tdNMDA <<
"," 473 << tdGABAa <<
"," << tdGABAb <<
")";
479 funcName.str(),
"CONFIG.");
480 hasSetConductances_ =
true;
491 void setConductances(
bool isSet,
int tdAMPA,
int trNMDA,
int tdNMDA,
int tdGABAa,
int trGABAb,
494 std::stringstream funcName; funcName <<
"setConductances(" << isSet <<
"," << tdAMPA <<
"," << trNMDA <<
"," <<
495 tdNMDA <<
"," << tdGABAa <<
"," << trGABAb <<
"," << tdGABAb <<
")";
504 "trGABAb and tdGABAb");
506 funcName.str(),
"CONFIG.");
507 hasSetConductances_ =
true;
510 snn_->
setConductances(
true, tdAMPA, trNMDA, tdNMDA, tdGABAa, trGABAb, tdGABAb);
519 #ifdef LN_I_CALC_TYPES 524 std::stringstream funcName; funcName <<
"setConductances(" << grpId <<
"," << isSet <<
")";
526 funcName.str(),
"CONFIG.");
527 hasSetConductances_ =
true;
530 snn_->
setConductances(grpId,
true, def_tdAMPA_, 0, def_tdNMDA_, def_tdGABAa_, 0, def_tdGABAb_);
539 void setConductances(
int grpId,
bool isSet,
int tdAMPA,
int tdNMDA,
int tdGABAa,
int tdGABAb) {
540 std::stringstream funcName; funcName <<
"setConductances(" << grpId <<
"," << isSet <<
"," << tdAMPA <<
"," << tdNMDA <<
"," 541 << tdGABAa <<
"," << tdGABAb <<
")";
547 funcName.str(),
"CONFIG.");
548 hasSetConductances_ =
true;
551 snn_->
setConductances(grpId,
true, tdAMPA, 0, tdNMDA, tdGABAa, 0, tdGABAb);
559 void setConductances(
int grpId,
bool isSet,
int tdAMPA,
int trNMDA,
int tdNMDA,
int tdGABAa,
int trGABAb,
562 std::stringstream funcName; funcName <<
"setConductances(" << grpId <<
"," << isSet <<
"," << tdAMPA <<
"," << trNMDA <<
"," <<
563 tdNMDA <<
"," << tdGABAa <<
"," << trGABAb <<
"," << tdGABAb <<
")";
572 "trGABAb and tdGABAb");
574 funcName.str(),
"CONFIG.");
575 hasSetConductances_ =
true;
578 snn_->
setConductances(grpId,
true, tdAMPA, trNMDA, tdNMDA, tdGABAa, trGABAb, tdGABAb);
587 #ifdef LN_I_CALC_TYPES 594 std::stringstream funcName; funcName <<
"setNM4weighted(" << grpId <<
"," << icalc <<
"," 595 << wDA <<
"," << w5HT <<
"," << wACh <<
"," << wNE <<
"," << wNorm <<
"," << wBase <<
")";
599 funcName.str(),
"CONFIG.");
600 hasSetConductances_ =
true;
603 snn_->
setConductances(grpId,
true, def_tdAMPA_, 0, def_tdNMDA_, def_tdGABAa_, 0, def_tdGABAb_);
605 snn_->
setNM4weighted(grpId, icalc, wDA, w5HT, wACh, wNE, wNorm, wBase);
611 std::string funcName =
"setHomeostasis(\""+
getGroupName(grpId)+
"\")";
615 funcName,
"CONFIG.");
617 hasSetHomeoALL_ = grpId==
ALL;
620 snn_->
setHomeostasis(grpId,
true,def_homeo_scale_,def_homeo_avgTimeScale_);
621 if (grpId!=
ALL && hasSetHomeoBaseFiringALL_)
622 userWarnings_.push_back(
"Make sure to call setHomeoBaseFiringRate on group " 630 void setHomeostasis(
int grpId,
bool isSet,
float homeoScale,
float avgTimeScale) {
631 std::string funcName =
"setHomeostasis(\""+
getGroupName(grpId)+
"\")";
637 hasSetHomeoALL_ = grpId==
ALL;
641 if (grpId!=
ALL && hasSetHomeoBaseFiringALL_)
642 userWarnings_.push_back(
"Make sure to call setHomeoBaseFiringRate on group " 651 std::string funcName =
"setHomeoBaseFiringRate(\""+
getGroupName(grpId)+
"\")";
654 funcName,
" Must call setHomeostasis first.");
658 hasSetHomeoBaseFiringALL_ = grpId==
ALL;
665 std::string funcName =
"setIntegrationMethod()";
669 "numStepsPerMs",
"[1, 100]");
678 float izh_c,
float izh_c_sd,
float izh_d,
float izh_d_sd)
680 std::string funcName =
"setNeuronParameters(\""+
getGroupName(grpId)+
"\")";
686 snn_->
setNeuronParameters(grpId, izh_a, izh_a_sd, izh_b, izh_b_sd, izh_c, izh_c_sd, izh_d, izh_d_sd);
691 std::string funcName =
"setNeuronParameters(\""+
getGroupName(grpId)+
"\")";
694 funcName,
"CONFIG.");
701 float izh_a,
float izh_b,
float izh_vpeak,
float izh_c,
float izh_d)
703 std::string funcName =
"setNeuronParameters(\"" +
getGroupName(grpId) +
"\")";
710 izh_a, 0.0f, izh_b, 0.0f, izh_vpeak, 0.0f, izh_c, 0.0f, izh_d, 0.0f);
715 float izh_vr,
float izh_vr_sd,
float izh_vt,
float izh_vt_sd,
716 float izh_a,
float izh_a_sd,
float izh_b,
float izh_b_sd,
717 float izh_vpeak,
float izh_vpeak_sd,
float izh_c,
float izh_c_sd,
718 float izh_d,
float izh_d_sd)
720 std::string funcName =
"setNeuronParameters(\"" +
getGroupName(grpId) +
"\")";
726 snn_->
setNeuronParameters(grpId, izh_C, izh_C_sd, izh_k, izh_k_sd, izh_vr, izh_vr_sd, izh_vt, izh_vt_sd,
727 izh_a, izh_a_sd, izh_b, izh_b_sd, izh_vpeak, izh_vpeak_sd, izh_c, izh_c_sd, izh_d, izh_d_sd);
733 std::string funcName =
"setNeuronParametersLIF(\"" +
getGroupName(grpId) +
"\")";
751 float baseDP,
float tauDP,
float releaseDP,
bool activeDP,
752 float base5HT,
float tau5HT,
float release5HT,
bool active5HT,
753 float baseACh,
float tauACh,
float releaseACh,
bool activeACh,
754 float baseNE,
float tauNE,
float releaseNE,
bool activeNE)
756 std::string funcName =
"setNeuromodulator(\"" +
getGroupName(grpId) +
"\")";
766 funcName,
"CONFIG.");
769 baseDP, tauDP, releaseDP, activeDP,
770 base5HT, tau5HT, release5HT, active5HT,
771 baseACh, tauACh, releaseACh, activeACh,
772 baseNE, tauNE, releaseNE, activeNE);
776 void setNeuromodulator(
int grpId,
float baseDP,
float tauDP,
float base5HT,
float tau5HT,
float baseACh,
777 float tauACh,
float baseNE,
float tauNE)
779 std::string funcName =
"setNeuromodulator(\""+
getGroupName(grpId)+
"\")";
789 funcName,
"CONFIG.");
791 snn_->
setNeuromodulator(grpId, baseDP, tauDP, base5HT, tau5HT, baseACh, tauACh, baseNE, tauNE);
795 std::string funcName =
"setNeuromodulator(\""+
getGroupName(grpId)+
"\")";
801 funcName,
"CONFIG.");
803 snn_->
setNeuromodulator(grpId, 1.0f, tauDP, 1.0f, tau5HT, 1.0f, tauACh, 1.0f, tauNE);
807 void setSTDP(
int preGrpId,
int postGrpId,
bool isSet) {
808 setESTDP(preGrpId, postGrpId, isSet);
812 void setSTDP(
int preGrpId,
int postGrpId,
bool isSet,
STDPType type,
float alphaPlus,
float tauPlus,
float alphaMinus,
815 setESTDP(preGrpId, postGrpId, isSet, type,
ExpCurve(alphaPlus, tauPlus, alphaMinus, tauMinus));
819 void setESTDP(
int preGrpId,
int postGrpId,
bool isSet) {
824 funcName,
"CONFIG.");
826 hasSetSTDPALL_ = postGrpId==
ALL;
829 snn_->
setESTDP(preGrpId, postGrpId,
true, def_STDP_type_,
EXP_CURVE, def_STDP_alphaLTP_, def_STDP_tauLTP_,
830 def_STDP_alphaLTD_, def_STDP_tauLTD_, 0.0f);
843 funcName,
"CONFIG.");
845 hasSetSTDPALL_ = postGrpId==
ALL;
855 #ifdef LN_I_CALC_TYPES 863 funcName,
"CONFIG.");
865 hasSetSTDPALL_ = postGrpId ==
ALL;
868 snn_->
setESTDP(preGrpId, postGrpId,
true, type,
893 funcName,
"CONFIG.");
895 hasSetSTDPALL_ = postGrpId==
ALL;
906 void setISTDP(
int preGrpId,
int postGrpId,
bool isSet) {
911 funcName,
"CONFIG.");
913 hasSetSTDPALL_ = postGrpId==
ALL;
916 snn_->
setISTDP(preGrpId, postGrpId,
true, def_STDP_type_,
PULSE_CURVE, def_STDP_betaLTP_, def_STDP_betaLTD_,
917 def_STDP_lambda_, def_STDP_delta_);
930 funcName,
"CONFIG.");
932 hasSetSTDPALL_ = postGrpId==
ALL;
949 funcName,
"CONFIG.");
951 hasSetSTDPALL_ = postGrpId==
ALL;
962 std::string funcName =
"setSTP(\""+
getGroupName(grpId)+
"\")";
964 funcName,
"CONFIG.");
966 hasSetSTPALL_ = grpId==
ALL;
973 snn_->
setSTP(grpId,
true,def_STP_U_exc_,def_STP_tau_u_exc_,def_STP_tau_x_exc_);
975 snn_->
setSTP(grpId,
true,def_STP_U_inh_,def_STP_tau_u_inh_,def_STP_tau_x_inh_);
980 snn_->
setSTP(grpId,
false,0.0f,0.0f,0.0f);
985 void setSTP(
int grpId,
bool isSet,
float STP_U,
float STP_tau_u,
float STP_tau_x) {
986 std::string funcName =
"setSTP(\""+
getGroupName(grpId)+
"\")";
988 funcName,
"CONFIG.");
990 hasSetSTPALL_ = grpId==
ALL;
996 snn_->
setSTP(grpId,
true,STP_U,STP_tau_u,STP_tau_x);
998 snn_->
setSTP(grpId,
false,0.0f,0.0f,0.0f);
1002 #ifdef LN_I_CALC_TYPES 1005 void setNM4STP(
int grpId,
float wSTP_U[],
float wSTP_tau_u[],
float wSTP_tau_x[]) {
1006 std::string funcName =
"setNM4STP(\"" +
getGroupName(grpId) +
"\")";
1008 funcName,
"CONFIG.");
1019 snn_->
setNM4STP(grpId, wSTP_U, wSTP_tau_u, wSTP_tau_x);
1027 float wtChangeDecay)
1029 std::string funcName =
"setWeightAndWeightChangeUpdate()";
1033 funcName,
"CONFIG.");
1043 std::string funcName =
"runNetwork()";
1050 if (!hasSetConductances_) {
1051 userWarnings_.push_back(
"setConductances has not been called. Setting simulation mode to CUBA.");
1055 handleUserWarnings();
1060 return snn_->
runNetwork(nSec, nMsec, printRunSummary);
1065 std::string funcName =
"setupNetwork()";
1067 funcName,
"CONFIG.");
1073 #ifdef LN_SETUP_NETWORK_MT 1076 std::string funcName =
"setupNetworkMT()";
1078 funcName,
"CONFIG.");
1081 snn_->setupNetworkMT();
1094 FILE* fpSave = fopen(fileName.c_str(),
"wb");
1095 std::string funcName =
"saveSimulation()";
1106 std::string funcName =
"setLogFile("+fileName+
")";
1110 std::string fileNameNonConst = fileName;
1111 std::transform(fileNameNonConst.begin(), fileNameNonConst.end(), fileNameNonConst.begin(), ::tolower);
1112 if (fileNameNonConst==
"null") {
1113 #if defined(WIN32) || defined(WIN64) 1114 fpLog = fopen(
"nul",
"w");
1116 fpLog = fopen(
"/dev/null",
"w");
1119 fpLog = fopen(fileName.c_str(),
"w");
1124 snn_->
setLogsFp(NULL, NULL, NULL, fpLog);
1131 snn_->
setLogsFp(fpInf,fpErr,fpDeb,fpLog);
1138 void biasWeights(
short int connId,
float bias,
bool updateWeightRange) {
1139 std::stringstream funcName; funcName <<
"biasWeights(" << connId <<
"," << bias <<
"," << updateWeightRange <<
1144 "connId",
"[0,getNumConnections()]");
1146 snn_->
biasWeights(connId, bias, updateWeightRange);
1150 std::string funcName =
"startTesting()";
1157 std::string funcName =
"stopTesting()";
1165 std::string funcName =
"loadSimulation()";
1167 funcName,
"CONFIG.");
1174 std::stringstream funcName; funcName <<
"scaleWeights(" << connId <<
"," << scale <<
"," << updateWeightRange
1179 "connId",
"[0,getNumConnections()]");
1188 +
"\",\"" + fname +
"\")";
1194 funcName,
"SETUP.");
1197 std::string fileName = fname;
1198 std::transform(fileName.begin(), fileName.end(), fileName.begin(), ::tolower);
1199 if (fileName ==
"null") {
1204 if (fileName ==
"default") {
1210 fid = fopen(fileName.c_str(),
"wb");
1214 std::string fileError =
" Double-check file permissions and make sure directory exists.";
1224 std::string funcName =
"setExternalCurrent(\""+
getGroupName(grpId)+
"\")";
1227 "current.size()",
"number of neurons in the group.");
1236 std::string funcName =
"setExternalCurrent(\""+
getGroupName(grpId)+
"\")";
1248 std::string funcName =
"setGroupMonitor(\""+
getGroupName(grpId)+
"\",\""+fname+
"\")";
1255 std::string fileName = fname;
1256 std::transform(fileName.begin(), fileName.end(), fileName.begin(), ::tolower);
1257 if (fileName ==
"null") {
1262 if (fileName ==
"default") {
1263 fileName =
"results/grp_" + snn_->
getGroupName(grpId) +
".dat";
1268 fid = fopen(fileName.c_str(),
"wb");
1272 std::string fileError =
" Double-check file permissions and make sure directory exists.";
1283 std::string funcName =
"setSpikeGenerator(\""+
getGroupName(grpId)+
"\")";
1288 funcName,
"CONFIG.");
1292 spkGen_.push_back(SGC);
1298 std::string funcName =
"setSpikeMonitor(\""+
getGroupName(grpId)+
"\",\""+fileName+
"\")";
1305 std::string fileNameLower = fileName;
1306 std::transform(fileNameLower.begin(), fileNameLower.end(), fileNameLower.begin(), ::tolower);
1307 if (fileNameLower ==
"null") {
1312 if (fileNameLower ==
"default") {
1313 std::string fileNameDefault =
"results/spk_" + snn_->
getGroupName(grpId) +
".dat";
1314 fid = fopen(fileNameDefault.c_str(),
"wb");
1316 std::string fileError =
" Make sure results/ exists.";
1320 fid = fopen(fileName.c_str(),
"wb");
1322 std::string fileError =
" Double-check file permissions and make sure directory exists.";
1334 std::string funcName =
"setNeuronMonitor(\"" +
getGroupName(grpId) +
"\",\"" + fileName +
"\")";
1341 std::string fileNameLower = fileName;
1342 std::transform(fileNameLower.begin(), fileNameLower.end(), fileNameLower.begin(), ::tolower);
1343 if (fileNameLower ==
"null") {
1349 if (fileNameLower ==
"default") {
1350 std::string fileNameDefault =
"results/n_" + snn_->
getGroupName(grpId) +
".dat";
1351 fid = fopen(fileNameDefault.c_str(),
"wb");
1353 std::string fileError =
" Make sure results/ exists.";
1358 fid = fopen(fileName.c_str(),
"wb");
1360 std::string fileError =
" Double-check file permissions and make sure directory exists.";
1372 std::string funcName =
"setSpikeRate()";
1377 funcName,
"PoissonRate length and the number of neurons in the group");
1385 void setWeight(
short int connId,
int neurIdPre,
int neurIdPost,
float weight,
bool updateWeightRange) {
1386 std::stringstream funcName; funcName <<
"setWeight(" << connId <<
"," << neurIdPre <<
"," << neurIdPost <<
"," 1387 << updateWeightRange <<
")";
1391 funcName.str(),
"connectionId",
"[0,getNumConnections()]");
1394 snn_->
setWeight(connId, neurIdPre, neurIdPost, weight, updateWeightRange);
1402 #ifdef LN_GET_FIRING 1404 void getFiring(std::vector<bool>& firings,
int netId) {
1405 snn_->updateCurSpike(firings, netId);
1409 #ifdef LN_GET_FIRING_MT 1411 void getFiringMT(std::vector<bool>& firings,
int netId) {
1412 snn_->updateCurSpikeMT(firings, netId);
1417 #ifdef LN_AXON_PLAST 1418 void findWavefrontPath(std::vector<int>& path, std::vector<float>& eligibility,
int netId,
int grpId,
int startNId,
int goalNId) {
1422 bool updateDelays(
int gGrpIdPre,
int gGrpIdPost, std::vector<std::tuple<int, int, uint8_t>> connDelays) {
1423 return snn_->
updateDelays(gGrpIdPre, gGrpIdPost, connDelays);
1426 void printEntrails(
char* buffer,
unsigned length,
int gGrpIdPre,
int gGrpIdPost) {
1427 return snn_->
printEntrails(buffer, length,gGrpIdPre, gGrpIdPost);
1433 std::string funcName =
"getConductanceAMPA()";
1435 funcName, funcName,
"RUN.");
1438 "[0,getNumGroups()]");
1444 std::string funcName =
"getConductanceNMDA()";
1446 funcName, funcName,
"RUN.");
1449 "[0,getNumGroups()]");
1455 std::string funcName =
"getConductanceGABAa()";
1457 funcName, funcName,
"RUN.");
1460 "[0,getNumGroups()]");
1466 std::string funcName =
"getConductanceGABAb()";
1468 funcName, funcName,
"RUN.");
1471 "[0,getNumGroups()]");
1477 std::stringstream funcName; funcName <<
"getDelayRange(" << connId <<
")";
1479 "connId",
"[0,getNumConnections()]");
1485 uint8_t*
getDelays(
int gIDpre,
int gIDpost,
int& Npre,
int& Npost) {
1486 std::string funcName =
"getDelays()";
1490 "[0,getNumGroups()]");
1492 "[0,getNumGroups()]");
1494 return snn_->
getDelays(gIDpre,gIDpost,Npre,Npost);
1498 std::stringstream funcName; funcName <<
"getGroupGrid3D(" << grpId <<
")";
1501 "grpId",
"[0,getNumGroups()]");
1511 std::stringstream funcName; funcName <<
"getGroupName(" << grpId <<
")";
1513 "grpId",
"[0,getNumGroups()] or must be ALL.");
1519 std::stringstream funcName; funcName <<
"getGroupStartNeuronId(" << grpId <<
")";
1523 "[0,getNumGroups()]");
1529 std::stringstream funcName; funcName <<
"getGroupEndNeuronId(" << grpId <<
")";
1533 "[0,getNumGroups()]");
1539 std::stringstream funcName; funcName <<
"getGroupNumNeurons(" << grpId <<
")";
1541 "[0,getNumGroups()]");
1547 std::stringstream funcName; funcName <<
"getNeuronLocation3D(" << neurId <<
")";
1552 "neurId",
"[0,getNumNeurons()]");
1558 std::stringstream funcName; funcName <<
"getNeuronLocation3D(" << grpId <<
"," << relNeurId <<
")";
1561 "grpId",
"[0,getNumGroups()]");
1563 funcName.str(),
"relNeurId",
"[0,getGroupNumNeurons()]");
1571 std::stringstream funcName; funcName <<
"getNeuronId(" << grpId <<
"," << location <<
")";
1574 "grpId",
"[0,getNumGroups()]");
1597 std::stringstream funcName; funcName <<
"getNumConnections(" << connectionId <<
")";
1602 funcName.str(),
"connectionId",
"[0,getNumSynapticConnections()]");
1607 std::string funcName =
"getNumSynapses()";
1615 std::stringstream funcName; funcName <<
"getConnSTDPInfo(" << connId <<
")";
1617 "connId",
"[0,getNumConnections]");
1623 std::stringstream funcName; funcName <<
"getGroupNeuromodulatorInfo(" << grpId <<
")";
1625 "grpId",
"[0,getNumGroups()]");
1635 std::stringstream funcName; funcName <<
"getSpikeMonitor(" << grpId <<
")";
1637 "grpId",
"[0,getNumGroups()]");
1643 std::stringstream funcName; funcName <<
"getWeightRange(" << connId <<
")";
1645 "connId",
"[0,getNumConnections()]");
1651 std::stringstream funcName; funcName <<
"isConnectionPlastic(" << connId <<
")";
1653 "connId",
"[0,getNumConnections()]");
1659 std::stringstream funcName; funcName <<
"isGroupWithHomeostasis(" << grpId <<
")";
1661 "connId",
"[0,getNumGroups()]");
1667 std::stringstream funcName; funcName <<
"isSimulationWithCOBA()";
1673 std::stringstream funcName; funcName <<
"isSimulationWithCUBA()";
1678 #ifdef LN_I_CALC_TYPES 1681 std::stringstream funcName; funcName <<
"isGroupWith(" << grpId <<
"," << icalcType <<
")";
1687 std::stringstream funcName; funcName <<
"getIcalcType(" << grpId <<
")";
1693 bool getConductanceConfig(
int grpId,
float& dAMPA,
float& rNMDA,
float& dNMDA,
float& dGABAa,
float& rGABAb,
float& dGABAb) {
1694 std::stringstream funcName; funcName <<
"getConductanceConfig(" << grpId <<
")";
1703 bool getConductanceConfig(
int grpId,
int& tdAMPA,
int& trNMDA,
int& tdNMDA,
int& tdGABAa,
int& trGABAb,
int& tdGABAb) {
1704 std::stringstream funcName; funcName <<
"getConductanceConfig(" << grpId <<
")";
1716 std::stringstream funcName; funcName <<
"isGroupWithCOBA(" << grpId <<
")";
1722 std::stringstream funcName; funcName <<
"isGroupWithCUBA(" << grpId <<
")";
1731 std::stringstream funcName; funcName <<
"isExcitatoryGroup(" << grpId <<
")";
1733 "connId",
"[0,getNumGroups()]");
1739 std::stringstream funcName; funcName <<
"isInhibitoryGroup(" << grpId <<
")";
1741 "connId",
"[0,getNumGroups()]");
1747 std::stringstream funcName; funcName <<
"isPoissonGroup(" << grpId <<
")";
1749 "connId",
"[0,getNumGroups()]");
1761 std::stringstream funcName; funcName <<
"setDefaultConductanceTimeConstants(" << tdAMPA <<
"," << trNMDA <<
1762 "," << tdNMDA <<
"," << tdGABAa <<
"," << trGABAb <<
"," << tdGABAb <<
")";
1771 "trGABAb and tdGABAb");
1775 def_tdAMPA_ = tdAMPA;
1776 def_trNMDA_ = trNMDA;
1777 def_tdNMDA_ = tdNMDA;
1778 def_tdGABAa_ = tdGABAa;
1779 def_trGABAb_ = trGABAb;
1780 def_tdGABAb_ = tdGABAb;
1784 std::string funcName =
"setDefaultHomeostasisparams()";
1786 funcName,
"CONFIG.");
1787 assert(avgTimeScale>0);
1789 def_homeo_scale_ = homeoScale;
1790 def_homeo_avgTimeScale_ = avgTimeScale;
1794 std::string funcName =
"setDefaultSaveOptions()";
1796 funcName,
"CONFIG.");
1798 def_save_fileName_ = fileName;
1799 def_save_synapseInfo_ = saveSynapseInfo;
1803 FILE* fpTry = fopen(def_save_fileName_.c_str(),
"wb");
1815 std::string funcName =
"setDefaultESTDPparams()";
1828 def_STDP_type_ = stdpType;
1835 def_STDP_alphaLTP_ = alphaPlus;
1836 def_STDP_tauLTP_ = tauPlus;
1837 def_STDP_alphaLTD_ = alphaMinus;
1838 def_STDP_tauLTD_ = tauMinus;
1843 std::string funcName =
"setDefaultISTDPparams()";
1855 def_STDP_type_ = stdpType;
1862 def_STDP_betaLTP_ = betaLTP;
1863 def_STDP_betaLTD_ = betaLTD;
1864 def_STDP_lambda_ = lambda;
1865 def_STDP_delta_ = delta;
1870 std::string funcName =
"setDefaultSTPparams()";
1875 assert(STP_tau_u>0.0f);
1876 assert(STP_tau_x>0.0f);
1880 def_STP_U_exc_ = STP_U;
1881 def_STP_tau_u_exc_ = STP_tau_u;
1882 def_STP_tau_x_exc_ = STP_tau_x;
1885 def_STP_U_inh_ = STP_U;
1886 def_STP_tau_u_inh_ = STP_tau_u;
1887 def_STP_tau_x_inh_ = STP_tau_x;
1901 void CARLsimInit() {
1902 bool gpuAllocationResult =
false;
1903 std::string funcName =
"CARLsimInit()";
1908 snn_ =
new SNN(netName_, preferredSimMode_, loggerMode_, randSeed_);
1939 bool existsGrpId(
int grpId) {
1940 return std::find(grpIds_.begin(), grpIds_.end(), grpId)!=grpIds_.end();
1944 void handleUserWarnings() {
1945 if (userWarnings_.size()) {
1946 for (
int i=0; i<userWarnings_.size(); i++) {
1950 fprintf(stdout,
"Ignore warnings and continue? Y/n ");
1951 char ignoreWarn = std::cin.get();
1952 if (std::cin.fail() || ignoreWarn!=
'y' && ignoreWarn!=
'Y') {
1953 fprintf(stdout,
"Exiting...\n");
1964 #if defined(WIN32) || defined(WIN64) 1965 static HANDLE gpuAllocationLock;
1967 static pthread_mutex_t gpuAllocationLock;
1975 std::string netName_;
1983 std::vector<std::vector<int> > connSyn_;
1986 std::vector<std::vector<int> > connComp_;
1988 std::map<int, int> groupPrefNetIds_;
1990 unsigned int numConnections_;
1991 std::vector<std::string> userWarnings_;
1993 std::vector<int> grpIds_;
1994 std::vector<SpikeGeneratorCore*> spkGen_;
1995 std::vector<ConnectionGeneratorCore*> connGen_;
1997 bool hasSetHomeoALL_;
1998 bool hasSetHomeoBaseFiringALL_;
1999 bool hasSetSTDPALL_;
2001 bool hasSetConductances_;
2013 float def_STDP_alphaLTP_;
2014 float def_STDP_tauLTP_;
2015 float def_STDP_alphaLTD_;
2016 float def_STDP_tauLTD_;
2017 float def_STDP_betaLTP_;
2018 float def_STDP_betaLTD_;
2019 float def_STDP_lambda_;
2020 float def_STDP_delta_;
2023 float def_STP_U_exc_;
2024 float def_STP_tau_u_exc_;
2025 float def_STP_tau_x_exc_;
2026 float def_STP_U_inh_;
2027 float def_STP_tau_u_inh_;
2028 float def_STP_tau_x_inh_;
2031 float def_homeo_scale_;
2032 float def_homeo_avgTimeScale_;
2035 std::string def_save_fileName_;
2036 bool def_save_synapseInfo_;
2050 #if defined(WIN32) || defined(WIN64) 2051 HANDLE CARLsim::Impl::gpuAllocationLock = CreateMutex(NULL, FALSE, NULL);
2053 pthread_mutex_t CARLsim::Impl::gpuAllocationLock = PTHREAD_MUTEX_INITIALIZER;
2058 _impl( new
Impl(this, netName, preferredSimMode, loggerMode, randSeed) ) {}
2063 const RangeDelay& delay,
const RadiusRF& radRF,
bool synWtType,
float mulSynFast,
float mulSynSlow) {
2064 return _impl->
connect(grpId1, grpId2, connType, wt, connProb, delay, radRF, synWtType, mulSynFast, mulSynSlow);
2070 return _impl->
connect(grpId1, grpId2, conn, synWtType);
2075 return _impl->
connect(grpId1, grpId2, conn, mulSynFast, mulSynSlow, synWtType);
2084 return _impl->
createGroup(grpName, grid, neurType, preferredPartition, preferredBackend);
2087 return _impl->
createGroup(grpName, nNeur, neurType, preferredPartition, preferredBackend);
2092 return _impl->
createGroupLIF(grpName, grid, neurType, preferredPartition, preferredBackend);
2095 return _impl->
createGroupLIF(grpName, nNeur, neurType, preferredPartition, preferredBackend);
2110 #define LN_I_CALC_TYPES__REQUIRED_FOR_NETWORK_LEVEL 2119 _impl->
setConductances(isSet, tdAMPA, trNMDA, tdNMDA, tdGABAa, trGABAb, tdGABAb);
2122 #ifdef LN_I_CALC_TYPES 2129 _impl->
setConductances(grpId, isSet, tdAMPA, tdNMDA, tdGABAa, tdGABAb);
2133 _impl->
setConductances(grpId, isSet, tdAMPA, trNMDA, tdNMDA, tdGABAa, trGABAb, tdGABAb);
2141 _impl->
setNM4weighted(grpId, iCalc, wDA, w5HT, wACh, wNE, wNorm, wBase);
2163 float izh_c_sd,
float izh_d,
float izh_d_sd)
2165 _impl->
setNeuronParameters(grpId, izh_a, izh_a_sd, izh_b, izh_b_sd, izh_c, izh_c_sd, izh_d, izh_d_sd);
2172 float izh_a,
float izh_b,
float izh_vpeak,
float izh_c,
float izh_d)
2174 _impl->
setNeuronParameters(grpId, izh_C, izh_k, izh_vr, izh_vt, izh_a, izh_b, izh_vpeak, izh_c, izh_d);
2178 float izh_vr,
float izh_vr_sd,
float izh_vt,
float izh_vt_sd,
2179 float izh_a,
float izh_a_sd,
float izh_b,
float izh_b_sd,
2180 float izh_vpeak,
float izh_vpeak_sd,
float izh_c,
float izh_c_sd,
2181 float izh_d,
float izh_d_sd)
2183 _impl->
setNeuronParameters(grpId, izh_C, izh_C_sd, izh_k, izh_k_sd, izh_vr, izh_vr_sd, izh_vt, izh_vt_sd,
2184 izh_a, izh_a_sd, izh_b, izh_b_sd, izh_vpeak, izh_vpeak_sd, izh_c, izh_c_sd, izh_d, izh_d_sd);
2193 float baseDP,
float tauDP,
float releaseDP,
bool activeDP,
2194 float base5HT,
float tau5HT,
float release5HT,
bool active5HT,
2195 float baseACh,
float tauACh,
float releaseACh,
bool activeACh,
2196 float baseNE,
float tauNE,
float releaseNE,
bool activeNE)
2199 baseDP, tauDP, releaseDP, activeDP,
2200 base5HT, tau5HT, release5HT, active5HT,
2201 baseACh, tauACh, releaseACh, activeACh,
2202 baseNE, tauNE, releaseNE, activeNE);
2206 float tauACh,
float baseNE,
float tauNE)
2208 _impl->
setNeuromodulator(grpId, baseDP, tauDP, base5HT, tau5HT, baseACh, tauACh, baseNE, tauNE);
2223 _impl->
setSTDP(preGrpId, postGrpId, isSet, type, alphaPlus, tauPlus, alphaMinus, tauMinus);
2231 _impl->
setESTDP(preGrpId, postGrpId, isSet, type, curve);
2234 #ifdef LN_I_CALC_TYPES 2237 _impl->
setESTDP(preGrpId, postGrpId, isSet, type, curve, modulation);
2247 _impl->
setESTDP(preGrpId, postGrpId, isSet, type, curve);
2255 _impl->
setISTDP(preGrpId, postGrpId, isSet, type, curve);
2260 _impl->
setISTDP(preGrpId, postGrpId, isSet, type, curve);
2264 void CARLsim::setSTP(
int grpId,
bool isSet,
float STP_U,
float STP_tau_u,
float STP_tau_x) {
2265 _impl->
setSTP(grpId, isSet, STP_U, STP_tau_u, STP_tau_x);
2271 #ifdef LN_I_CALC_TYPES 2274 _impl->
setNM4STP(grpId, wSTP_U, wSTP_tau_u, wSTP_tau_x);
2281 float wtChangeDecay)
2289 return _impl->
runNetwork(nSec, nMsec, printRunSummary);
2295 #ifdef LN_SETUP_NETWORK_MT 2300 #ifdef LN_AXON_PLAST 2306 return _impl->
updateDelays(gGrpIdPre, gGrpIdPost, connDelays);
2310 _impl->
printEntrails(buffer, length, gGrpIdPre, gGrpIdPost);
2336 _impl->
biasWeights(connId, bias, updateWeightRange);
2386 void CARLsim::setWeight(
short int connId,
int neurIdPre,
int neurIdPost,
float weight,
bool updateWeightRange) {
2387 _impl->
setWeight(connId, neurIdPre, neurIdPost, weight, updateWeightRange);
2400 #ifdef LN_GET_FIRING 2402 void CARLsim::getFiring(std::vector<bool>& firing,
int netId) { _impl->getFiring(firing, netId); }
2405 #ifdef LN_GET_FIRING_MT 2407 void CARLsim::getFiringMT(std::vector<bool>& firing,
int netId) { _impl->getFiringMT(firing, netId); }
2427 return _impl->
getDelays(gIDpre, gIDpost, Npre, Npost);
2525 #ifdef LN_I_CALC_TYPES 2537 float& dAMPA,
float& rNMDA,
float& dNMDA,
float& dGABAa,
float& rGABAb,
float& dGABAb)
2544 int& tdAMPA,
int& trNMDA,
int& tdNMDA,
int& tdGABAa,
int& trGABAb,
int& tdGABAb)
bool isConnectionPlastic(short int connId)
void setSTP(int grpId, bool isSet, float STP_U, float STP_tau_u, float STP_tau_x)
STDPCurve stdpCurve
the type of STDP curve
Class for generating Poisson spike trains.
uint8_t * getDelays(int gIDpre, int gIDpost, int &Npre, int &Npost)
void setSTP(int grpId, bool isSet)
int createGroupLIF(const std::string &grpName, int nNeur, int neurType, int preferredPartition=ANY, ComputingBackend preferredBackend=CPU_CORES)
bool isGroupWithCUBA(int grpId)
STDPCurve stdpCurve
the type of STDP curve
void findWavefrontPath(std::vector< int > &path, std::vector< float > &eligibility, int netId, int grpId, int startNId, int goalNId)
static int cudaDeviceCount()
Get Info of suitable Harware for integration of CARLsim in NeuroInf-IDEs NIIDEs (LN20201017) ...
x86/x64 Multi Core Processor (LN20201016)
void setNeuronParametersLIF(int grpId, int tau_m, int tau_ref, float vTh, float vReset, double minRmem, double maxRmem)
Sets neuron parameters for a group of LIF spiking neurons.
CARLsimState getCARLsimState()
Writes population weights from gIDpre to gIDpost to file fname in binary.
int getNumGroups()
returns the number of groups in the network
int createSpikeGeneratorGroup(const std::string &grpName, const Grid3D &grid, int neurType, int preferredPartition, ComputingBackend preferredBackend)
bool isPoissonGroup(int gGrpId)
void setDefaultConductanceTimeConstants(int tdAMPA, int trNMDA, int tdNMDA, int tdGABAa, int trGABAb, int tdGABAb)
Sets default values for conductance time constants.
bool updateDelays(int gGrpIdPre, int gGrpIdPost, std::vector< std::tuple< int, int, uint8_t >> connDelays)
Updates the delays directly the backend memory.
SpikeMonitor * setSpikeMonitor(int grpId, const std::string &fileName)
float alphaPlus
the amplitude of the exponential curve at pre-post side
RangeWeight getWeightRange(short int connId)
int createGroup(const std::string &grpName, int nNeur, int neurType, int preferredPartition, ComputingBackend preferredBackend)
void setNeuronParameters(int grpId, float izh_a, float izh_a_sd, float izh_b, float izh_b_sd, float izh_c, float izh_c_sd, float izh_d, float izh_d_sd)
uint8_t * getDelays(int gIDpre, int gIDpost, int &Npre, int &Npost)
gets delays
int createGroupLIF(const std::string &grpName, const Grid3D &grid, int neurType, int preferredPartition, ComputingBackend preferredBackend)
Creates a group of LIF spiking neurons.
bool getConductanceConfig(int grpId, float &dAMPA, float &rNMDA, float &dNMDA, float &dGABAa, float &rGABAb, float &dGABAb)
RangeDelay getDelayRange(short int connId)
returns the RangeDelay struct of a connection
bool isGroupWithCOBA(int grpId)
int getGroupNumNeurons(int grpId)
returns the number of neurons of a group specified by grpId
#define EXCITATORY_NEURON
const FILE * getLogFpLog()
returns file pointer to log file
void findWavefrontPath(std::vector< int > &path, std::vector< float > &eligibility, int netId, int grpId, int startNId, int goalNId)
void setSpikeRate(int grpId, PoissonRate *spikeRate, int refPeriod)
A struct for retrieving STDP related information of a connection.
void setDefaultISTDPparams(float betaLTP, float betaLTD, float lambda, float delta, STDPType stdpType)
sets default values for I-STDP params
int getNumSynapses()
returns the total number of allocated synaptic connections in the network
void setSpikeGenerator(int grpId, SpikeGenerator *spikeGenFunc)
A SpikeCounter keeps track of the number of spikes per neuron in a group.
parameters must be identical
int getNumNeuronsRegInh()
returns the total number of regular (Izhikevich) inhibitory neurons
int getNumNeuronsReg()
returns the total number of regular (Izhikevich) neurons
std::vector< float > getConductanceAMPA(int grpId)
gets AMPA vector of a group
#define ALL
CARLsim common definitions.
void getConductanceConfig(int grpId, float &dAMPA, float &rNMDA, float &dNMDA, float &dGABAa, float &rGABAb, float &dGABAb)
void scaleWeights(short int connId, float scale, bool updateWeightRange)
GroupMonitor * setGroupMonitor(int grpId, const std::string &fname, int mode=0)
Sets a group monitor for a group, custom GroupMonitor class.
const FILE * getLogFpDeb()
returns file pointer to debug log
serotonin-modulated STDP, nearest-neighbor
void setNM4weighted(int grpId, IcalcType type, float wDA=1.f, float w5HT=1.f, float wACh=1.f, float wNE=1.f, float wNorm=4.f, float wBase=1.0f)
Sets IcalcType to NM4weighted for a specific neuron group.
parameters cannot be identical
std::vector< float > getConductanceGABAa(int grpId)
gets GABAa vector of a group
int getNumNeuronsRegInh()
CARLsim User Interface This class provides a user interface to the public sections of CARLsimCore sou...
float alphaMinus
the amplitude of the exponential curve at post-pre side
static void cudaDeviceDescription(unsigned ithGPU, const char **desc)
void setNM4weighted(int grpId, IcalcType type, float wDA, float w5HT, float wACh, float wNE, float wNorm, float wBase)
void setLogFile(const std::string &fileName)
Sets the name of the log file.
GroupNeuromodulatorInfo getGroupNeuromodulatorInfo(int grpId)
bool isGroupWithCUBA(int grpId)
void setISTDP(int preGrpId, int postGrpId, bool isSet, STDPType type, STDPCurve curve, float ab1, float ab2, float tau1, float tau2)
Set the inhibitory spike-timing-dependent plasticity (STDP) with anti-hebbian curve for a neuron grou...
A struct to assign a timing-based E-STDP curve.
std::vector< float > getConductanceGABAb(int grpId)
gets GABAb vector of a group
short int connect(int grpId1, int grpId2, ConnectionGenerator *conn, bool synWtType)
parameter cannot be of type UNKNOWN
const FILE * getLogFpErr()
returns file pointer to error log
ConnectionMonitor * setConnectionMonitor(int grpIdPre, int grpIdPost, FILE *fid)
sets up a network monitor registered with a callback to process the spikes.
void setNeuronParameters(int grpId, float izh_C, float izh_C_sd, float izh_k, float izh_k_sd, float izh_vr, float izh_vr_sd, float izh_vt, float izh_vt_sd, float izh_a, float izh_a_sd, float izh_b, float izh_b_sd, float izh_vpeak, float izh_vpeak_sd, float izh_c, float izh_c_sd, float izh_d, float izh_d_sd)
int createGroup(const std::string &grpName, const Grid3D &grid, int neurType, int preferredPartition, ComputingBackend preferredBackend)
IcalcType getIcalcType(int grpId)
Returns the iCalc of a group.
void setESTDP(int preGrpId, int postGrpId, bool isSet, STDPType type, TimingBasedCurve curve)
UpdateInterval
Update frequency for weights.
#define CARLSIM_WARN(where, what)
bool isSimulationWithCUBA()
void setESTDP(int preGrpId, int postGrpId, bool isSet, STDPType type, ExpCurve curve)
bool isGroupWithCOBA(int grpId)
void setDefaultSTPparams(int neurType, float STP_U, float STP_tau_u, float STP_tau_x)
ConnSTDPInfo getConnSTDPInfo(int grpId)
returns the stdp information of a group specified by grpId
run state, where the model is stepped
void setSTDP(int preGrpId, int postGrpId, bool isSet)
bool isGroupWithHomeostasis(int grpId)
int getNumNeuronsGenExc()
void setISTDP(int preGrpId, int postGrpId, bool isSet, STDPType type, ExpCurve curve)
CARLsimState getCARLsimState()
#define MAX_NUM_CUDA_DEVICES
int createSpikeGeneratorGroup(const std::string &grpName, int nNeur, int neurType, int preferredPartition, ComputingBackend preferredBackend)
void setNeuromodulator(int grpId, float baseDP, float tauDP, float base5HT, float tau5HT, float baseACh, float tauACh, float baseNE, float tauNE)
Sets baseline concentration and decay time constant of neuromodulators (DP, 5HT, ACh, NE) for a neuron group.
bool getConductanceConfig(int grpId, int &tdAMPA, int &trNMDA, int &tdNMDA, int &tdGABAa, int &trGABAb, int &tdGABAb)
int getNeuronId(int grpId, Point3D location)
std::vector< float > getConductanceNMDA(int grpId)
void setNeuromodulator(int grpId, float baseDP, float tauDP, float releaseDP, bool activeDP, float base5HT, float tau5HT, float release5HT, bool active5HT, float baseACh, float tauACh, float releaseACh, bool activeACh, float baseNE, float tauNE, float releaseNE, bool activeNE)
void loadSimulation(FILE *fid)
Loads a simulation (and network state) from file. The file pointer fid must point to a valid CARLsim ...
void setNM4STP(int grpId, float wSTP_U[], float wSTP_tau_u[], float wSTP_tau_x[])
bool isGroupWithCOBA(int grpId)
void setConnectionModulation(int preGrpId, int postGrpId, IcalcType icalcType)
bool updateDelays(int gGrpIdPre, int gGrpIdPost, std::vector< std::tuple< int, int, uint8_t >> connDelays)
void startTesting(bool shallUpdateWeights=true)
enters a testing phase, where all weight updates are disabled
SpikeMonitor * getSpikeMonitor(int grpId)
Returns the number of spikes per neuron for a certain group.
CARLsim(const std::string &netName="SNN", SimMode preferredSimMode=CPU_MODE, LoggerMode loggerMode=USER, int ithGPUs=0, int randSeed=-1)
CARLsim constructor. Creates a new instance of class CARLsim. All input arguments are optional...
int createGroup(const std::string &grpName, int nNeur, int neurType, int preferredPartition=ANY, ComputingBackend preferredBackend=CPU_CORES)
creates a group of Izhikevich spiking neurons
bool isGroupWithHomeostasis(int grpId)
returns whether group has homeostasis enabled (true) or not (false)
void setDefaultISTDPparams(float betaLTP, float betaLTD, float lambda, float delta, STDPType stdpType)
GroupNeuromodulatorInfo getGroupNeuromodulatorInfo(int grpId)
#define MAX_NUM_COMP_CONN
parameter cannot have larger vaule than some vaule
setup state, where the neural network is prepared for execution and monitors are set ...
int runNetwork(int nSec, int nMsec, bool printRunSummary)
void setLogFile(const std::string &fileName)
void setDefaultHomeostasisParams(float homeoScale, float avgTimeScale)
Sets default homeostasis params.
void startTesting(bool updateWeights=true)
Enters a testing phase in which all weight changes are disabled.
int getGroupNumNeurons(int grpId)
std::vector< float > getConductanceGABAb(int grpId)
void scaleWeights(short int connId, float scale, bool updateWeightRange=false)
acetylcholine-modulated STDP, nearest-neighbor
const IcalcType getIcalcType(int grpId)
int getGroupEndNeuronId(int grpId)
returns the last neuron id of a groupd specified by grpId
void printEntrails(char *buffer, unsigned length, int gGrpIdPre, int gGrpIdPost)
Impl(CARLsim *sim, const std::string &netName, SimMode prferredSimMode, LoggerMode loggerMode, int randSeed)
void biasWeights(short int connId, float bias, bool updateWeightRange)
const FILE * getLogFpInf()
returns file pointer to info log
short int connect(int grpId1, int grpId2, const std::string &connType, const RangeWeight &wt, float connProb, const RangeDelay &delay, const RadiusRF &radRF, bool synWtType, float mulSynFast, float mulSynSlow)
int createGroup(const std::string &grpName, const Grid3D &grid, int neurType, int preferredPartition, ComputingBackend preferredBackend)
Creates a group of Izhikevich spiking neurons.
void setExternalCurrent(int grpId, const std::vector< float > ¤t)
bool isGroupWith(int grpId, IcalcType icalcType)
void setNeuromodulator(int grpId, float tauDP, float tau5HT, float tauACh, float tauNE)
used for relaying callback to ConnectionGenerator
void setHomeoBaseFiringRate(int grpId, float baseFiring, float baseFiringSD=0.0f)
Sets the homeostatic target firing rate (enforced through homeostatic synaptic scaling) ...
bool isExcitatoryGroup(int gGrpId)
int getNumNeuronsGenInh()
void setNM4weighted(int grpId, IcalcType icalc, float wDA, float w5HT, float wACh, float wNE, float wNorm, float wBase)
int getNumNeuronsRegExc()
returns the total number of regular (Izhikevich) excitatory neurons
GroupMonitor * setGroupMonitor(int grpId, FILE *fid, int mode=0)
sets up a group monitor registered with a callback to process the spikes.
void setCompartmentParameters(int grpId, float couplingUp, float couplingDown)
Sets coupling constants G_u and G_d for the compartment.
bool isGroupWith(int grpId, IcalcType icalcType)
std::vector< float > getConductanceNMDA(int grpId)
gets NMDA vector of a group
void setNeuronParameters(int grpId, float izh_C, float izh_k, float izh_vr, float izh_vt, float izh_a, float izh_b, float izh_vpeak, float izh_c, float izh_d)
void setConnectionModulation(int preGrpId, int postGrpId, IcalcType icalcType)
standard STDP of Bi & Poo (2001), nearest-neighbor
static void cudaDeviceDescription(unsigned ithGPU, const char **desc)
LN extension 20201017.
void setLogsFp(FILE *fpInf=NULL, FILE *fpErr=NULL, FILE *fpDeb=NULL, FILE *fpLog=NULL)
Sets the file pointers for all log files file pointer NULL means don't change it. ...
void stopTesting()
Exits a testing phase, making weight changes possible again.
void setDefaultSTDPparams(float alphaPlus, float tauPlus, float alphaMinus, float tauMinus, STDPType stdpType)
#define INHIBITORY_NEURON
void setSTDP(int preGrpId, int postGrpId, bool isSet, STDPType type, float alphaPlus, float tauPlus, float alphaMinus, float tauMinus)
float alphaMinus
the amplitude of the exponential curve at post-pre side
void setNM4STP(int grpId, float wSTP_U[], float wSTP_tau_u[], float wSTP_tau_x[])
Sets neuromodulator targeting STP params U, tau_u, and tau_x of a neuron group (pre-synaptically) ...
bool isSimulationWithCOBA()
parameter cannot be set to
bool isSimulationWithCUBA()
Returns true is the network exclusivle operate on current basis.
int getNumSynapticConnections(short int connectionId)
void setDefaultHomeostasisParams(float homeoScale, float avgTimeScale)
int getNumNeuronsGen()
returns the total number of spike generator neurons
float tauPlus
the time constant of the exponential curve at pre-post side
Grid3D getGroupGrid3D(int grpId)
void setupNetwork()
build the network
parameter must be in some range
A struct to arrange neurons on a 3D grid (a primitive cubic Bravais lattice with cubic side length 1)...
void setNeuromodulator(int grpId, float baseDP, float tauDP, float base5HT, float tau5HT, float baseACh, float tauACh, float baseNE, float tauNE)
Sets baseline concentration and decay time constant of neuromodulators (DP, 5HT, ACh, NE) for a neuron group.
bool isSimulationWithCOBA()
const FILE * getLogFpInf()
void setIntegrationMethod(integrationMethod_t method, int numStepsPerMs)
void saveSimulation(FILE *fid, bool saveSynapseInfo=false)
stores the pre and post synaptic neuron ids with the weight and delay
parameter cannot have NULL value
used for relaying callback to SpikeGenerator
void setConductances(bool isSet, int tdAMPA, int tdNMDA, int tdGABAa, int tdGABAb)
bool isExcitatoryGroup(int grpId)
returns
SpikeMonitor * getSpikeMonitor(int grpId)
Returns pointer to existing SpikeMonitor object, NULL else.
NeuronMonitor * setNeuronMonitor(int gid, FILE *fid)
sets up a neuron monitor registered with a callback to process the neuron state values, there can only be one NeuronMonitor per group
void setConductances(bool isSet)
Sets default values for conduction decay and rise times or disables COBA alltogether.
std::string getGroupName(int grpId)
bool updateDelays(int gGrpIdPre, int gGrpIdPost, std::vector< std::tuple< int, int, uint8_t >> connDelays)
float betaLTD
the amplitude of inhibitory LTD
void setExternalCurrent(int grpId, float current)
bool isInhibitoryGroup(int grpId)
returns
struct to assign a pulse I-STDP curve
int getGroupId(std::string grpName)
int getMaxNumCompConnections()
Returns the maximum number of allowed compartmental connections per group.
void setNeuronParametersLIF(int grpId, int tau_m, int tau_ref=0, float vTh=1.0f, float vReset=0.0f, const RangeRmem &rMem=RangeRmem(1.0f))
Sets neuron parameters for a group of LIF spiking neurons.
void saveSimulation(const std::string &fileName, bool saveSynapseInfo)
float lambda
the range of inhibitory LTP
void setHomeostasis(int grpId, bool isSet)
const FILE * getLogFpLog()
returns file pointer to log file
static void assertTrue(bool statement, errorType errorIfAssertionFails, std::string errorFunc, std::string errorMsgPrefix="", std::string errorMsgSuffix="")
simple wrapper for assert statement
dopamine-modulated STDP, nearest-neighbor
std::vector< float > getConductanceAMPA(int grpId)
void setConductances(int grpId, bool isSet, int tdAMPA, int trNMDA, int tdNMDA, int tdGABAa, int trGABAb, int tdGABAb)
void setNeuromodulator(int grpId, float baseDP, float tauDP, float base5HT, float tau5HT, float baseACh, float tauACh, float baseNE, float tauNE)
int getNumNeuronsRegInh()
int getNumNeurons()
returns the total number of allocated neurons in the network
void setSpikeRate(int grpId, PoissonRate *spikeRate, int refPeriod=1)
Sets a spike rate.
Struct defines the minimum and maximum membrane resisatnces of the LIF neuron group.
configuration state, where the neural network is configured
int getSimTimeMsec()
returns
int getNumNeurons()
Returns the number of neurons for which to generate Poisson spike trains.
function cannot be applied to neuron type
float betaLTP
the amplitude of inhibitory LTP
short int connect(int grpId1, int grpId2, const std::string &connType, const RangeWeight &wt, float connProb, const RangeDelay &delay=RangeDelay(1), const RadiusRF &radRF=RadiusRF(-1.0), bool synWtType=SYN_FIXED, float mulSynFast=1.0f, float mulSynSlow=1.0f)
Connects a presynaptic to a postsynaptic group using fixed/plastic weights and a range of delay value...
bool isSimulationWithCUBA()
void setHomeostasis(int grpId, bool isSet, float homeoScale, float avgTimeScale)
Sets custom values for implementation of homeostatic synaptic scaling.
uint8_t * getDelays(int gGrpIdPre, int gGrpIdPost, int &numPreN, int &numPostN)
Returns the delay information for all synaptic connections between a pre-synaptic and a post-synaptic...
std::vector< float > getConductanceNMDA(int grpId)
void setESTDP(int preGrpId, int postGrpId, bool isSet, STDPType type, ExpCurve curve, PkaPlcModulation modulation)
NeuronMonitor * setNeuronMonitor(int grpId, const std::string &fileName)
float delta
the range of inhibitory LTD
void setSpikeRate(int grpId, PoissonRate *spikeRate, int refPeriod)
Sets the Poisson spike rate for a group. For information on how to set up spikeRate, see Section Poisson spike generators in the Tutorial.
IcalcType
input current calculation
std::string getGroupName(int grpId)
gets group name
void setISTDP(int preGrpId, int postGrpId, bool isSet)
Sets default I-STDP mode and parameters.
int getGroupEndNeuronId(int gGrpId)
void biasWeights(short int connId, float bias, bool updateWeightRange=false)
int getNeuronId(int grpId, Point3D location)
returns the neuron ID for a 3D location
int getNumSynapticConnections(short int connectionId)
gets number of connections associated with a connection ID
void setIntegrationMethod(integrationMethod_t method, int numStepsPerMs)
int getNumNeuronsGenExc()
returns the total number of excitatory spike generator neurons
void setSTDP(int preGrpId, int postGrpId, bool isSet)
Sets default STDP mode and params.
void setCompartmentParameters(int grpId, float couplingUp, float couplingDown)
int createGroupLIF(const std::string &grpName, int nNeur, int neurType, int preferredPartition=ANY, ComputingBackend preferredBackend=CPU_CORES)
creates a group of Leaky-Integrate-and-Fire (LIF) spiking neurons
void setConductances(bool isSet)
void setWeightAndWeightChangeUpdate(UpdateInterval wtANDwtChangeUpdateInterval, bool enableWtChangeDecay, float wtChangeDecay=0.9f)
Sets the weight and weight change update parameters.
short int connect(int gIDpre, int gIDpost, const std::string &_type, float initWt, float maxWt, float prob, uint8_t minDelay, uint8_t maxDelay, RadiusRF radius, float mulSynFast, float mulSynSlow, bool synWtType)
make from each neuron in grpId1 to 'numPostSynapses' neurons in grpId2
int getGroupId(std::string grpName)
finds the ID of the group with name grpName
float tauPlus
the time constant of the exponential curve at pre-post side
integrationMethod_t
Integration methods.
void setNeuronParameters(int grpId, float izh_a, float izh_a_sd, float izh_b, float izh_b_sd, float izh_c, float izh_c_sd, float izh_d, float izh_d_sd)
Sets the Izhikevich parameters a, b, c, and d of a neuron group.
Point3D getNeuronLocation3D(int neurId)
returns the 3D location a neuron codes for
a range struct for synaptic delays
short int connectCompartments(int grpIdLower, int grpIdUpper)
void setCompartmentParameters(int grpId, float couplingUp, float couplingDown)
Coupling constants for the compartment are set using this method.
Point3D getNeuronLocation3D(int neurId)
void setHomeoBaseFiringRate(int groupId, float baseFiring, float baseFiringSD)
Sets homeostatic target firing rate (enforced through homeostatic synaptic scaling) ...
void setConductances(bool isSet, int tdAMPA, int trNMDA, int tdNMDA, int tdGABAa, int trGABAb, int tdGABAb)
void printEntrails(char *buffer, unsigned length, int gGrpIdPre, int gGrpIdPost)
bool isGroupWithCUBA(int grpId)
void biasWeights(short int connId, float bias, bool updateWeightRange=false)
Adds a constant bias to the weight of every synapse in the connection.
void setNeuronParameters(int grpId, float izh_a, float izh_b, float izh_c, float izh_d)
RangeDelay getDelayRange(short int connId)
int getNumConnections()
Returns the number of connections (pairs of pre-post groups) in the network.
int getGroupStartNeuronId(int grpId)
returns the first neuron id of a groupd specified by grpId
Grid3D getGroupGrid3D(int grpId)
returns the 3D grid struct of a group
void setupNetworkMT()
featFastSetup LN 20201108
float gamma
the turn-over point
void setDefaultSTPparams(int neurType, float STP_U, float STP_tau_u, float STP_tau_x)
Sets default values for STP params U, tau_u, and tau_x of a neuron group (pre-synaptically) ...
ConnectionMonitor * setConnectionMonitor(int grpIdPre, int grpIdPost, const std::string &fname)
Sets a connection monitor for a group, custom ConnectionMonitor class.
std::vector< float > getConductanceGABAa(int grpId)
bool isPoissonGroup(int grpId)
int getNumSynapticConnections(short int connectionId)
returns the number of connections associated with a connection ID
void setConductances(int grpId, bool isSet, int tdAMPA, int tdNMDA, int tdGABAa, int tdGABAb)
int createGroupLIF(const std::string &grpName, const Grid3D &grid, int neurType, int preferredPartition, ComputingBackend preferredBackend)
void setWeight(short int connId, int neurIdPre, int neurIdPost, float weight, bool updateWeightRange=false)
Sets the weight value of a specific synapse.
function can only be called in certain state
int runNetwork(int _nsec, int _nmsec, bool printRunSummary)
run the simulation for n sec
int getNumNeuronsGenInh()
returns the total number of inhibitory spike generator neurons
A struct for retrieving neuromodulator information of a group.
RangeWeight getWeightRange(short int connId)
returns RangeWeight struct of a connection
bool isSimulationWithCOBA()
Returns true is the network is COBA enabled.
void setConductances(int grpId, bool isSet)
int createSpikeGeneratorGroup(const std::string &grpName, const Grid3D &grid, int neurType, int preferredPartition, ComputingBackend preferredBackend)
Creates a spike generator group (dummy-neurons, not Izhikevich spiking neurons)
Point3D getNeuronLocation3D(int neurId)
A struct to assign exponential STDP curves.
void setIntegrationMethod(integrationMethod_t method, int numStepsPerMs)
Sets the integration method and the number of integration steps per 1ms simulation time step...
NeuronMonitor * setNeuronMonitor(int grpId, const std::string &fileName)
Sets a Neuron Monitor for a groups, print voltage, recovery, and total current values to binary file...
void setNeuronParametersLIF(int grpId, int tau_m, int tau_ref, float vTh, float vReset, const RangeRmem &rMem)
void startTesting(bool updateWeights)
void setDefaultConductanceTimeConstants(int tdAMPA, int trNMDA, int tdNMDA, int tdGABAa, int trGABAb, int tdGABAb)
SpikeMonitor * getSpikeMonitor(int grpId)
int runNetwork(int nSec, int nMsec=0, bool printRunSummary=true)
run the simulation for time=(nSec*seconds + nMsec*milliseconds)
int getMaxNumCompConnections()
std::vector< float > getConductanceAMPA(int grpId)
ConnSTDPInfo getConnSTDPInfo(short int connId)
void setDefaultESTDPparams(float alphaPlus, float tauPlus, float alphaMinus, float tauMinus, STDPType stdpType)
sets default values for E-STDP params
void setESTDP(int preGrpId, int postGrpId, bool isSet)
void setDefaultSTDPparams(float alphaPlus, float tauPlus, float alphaMinus, float tauMinus, STDPType stdpType)
sets default STDP params
keyword ALL is not allowed for this variable
int getGroupStartNeuronId(int gGrpId)
std::string getGroupName(int grpId)
int getNeuronId(int gGrpId, Point3D location)
the inverse of getNeuronLocation3D
NE alpha1 receptor with DA antagonist, Avery, Dutt, Krichmar (2013)
cannot be connected twice
void setExternalCurrent(int grpId, const std::vector< float > ¤t)
injects current (mA) into the soma of every neuron in the group
void setSTP(int grpId, bool isSet, float STP_U, float STP_tau_u, float STP_tau_x)
Sets STP params U, tau_u, and tau_x of a neuron group (pre-synaptically)
const FILE * getLogFpErr()
returns file pointer to error log
a range struct for synaptic weight magnitudes
Contains all of CARLsim's core functionality.
void setDefaultSaveOptions(std::string fileName, bool saveSynapseInfo)
Sets default options for save file.
ComputingBackend
computing backend
void setACNE12(int grpId)
float tauMinus
the time constant of the exponential curve at post-pre side
static int cudaDeviceCount()
LN extension 20201017.
GroupNeuromodulatorInfo getGroupNeuromodulatorInfo(int grpId)
returns the neuromodulator information of a group specified by grpId
int getNumNeuronsGenExc()
int getGroupEndNeuronId(int grpId)
int getSimTimeSec()
returns
int getGroupStartNeuronId(int grpId)
GroupMonitor * setGroupMonitor(int grpId, const std::string &fname, const int mode)
void setESTDP(int preGrpId, int postGrpId, bool isSet, STDPType type, STDPCurve curve, float alphaPlus, float tauPlus, float alphaMinus, float tauMinus, float gamma)
Set the spike-timing-dependent plasticity (STDP) for a neuron group.
void printEntrails(char *buffer, unsigned length, int gGrpIdPre, int gGrpIdPost)
print entrails of SNN to string buffer
IcalcType getIcalcType(int grpId)
bool isExcitatoryGroup(int grpId)
void stopTesting()
exits a testing phase, making weight updates possible again
STDPCurve stdpCurve
the type of STDP curve
RangeDelay getDelayRange(short int connId)
returns the RangeDelay struct for a specific connection ID
short int connectCompartments(int grpIdLower, int grpIdUpper)
Custom mode, the user can set the location of all the file pointers.
void setHomeostasis(int grpId, bool isSet, float homeoScale, float avgTimeScale)
Sets the homeostasis parameters. g is the grpID, enable=true(false) enables(disables) homeostasis...
int getNumNeuronsRegExc()
Point3D getNeuronLocation3D(int grpId, int relNeurId)
norepinephrine-modulated STDP, nearest-neighbor
cannot be both synaptically and compartmentally connected
SpikeMonitor * setSpikeMonitor(int grpId, const std::string &fileName)
Sets a Spike Monitor for a groups, prints spikes to binary file.
void setWeightAndWeightChangeUpdate(UpdateInterval wtANDwtChangeUpdateInterval, bool enableWtChangeDecay, float wtChangeDecay)
#define ANY
used for create* method to specify any GPU or a specific GPU
int getNumNeuronsGenInh()
void setHomeoBaseFiringRate(int grpId, float baseFiring, float baseFiringSD)
const FILE * getLogFpLog()
void findWavefrontPath(std::vector< int > &path, std::vector< float > &eligibility, int netId, int grpId, int startNId, int goalNId)
Extracts the path from a spiking wave front and returns the eligibility trace.
void setSTP(int grpId, bool isSet, float STP_U, float STP_tau_u, float STP_tau_x)
Sets STP params U, tau_u, and tau_x of a neuron group (pre-synaptically) CARLsim implements the short...
void setISTDP(int preGrpId, int postGrpId, bool isSet)
void setSpikeGenerator(int grpId, SpikeGeneratorCore *spikeGenFunc)
sets up a spike generator
void setWeight(short int connId, int neurIdPre, int neurIdPost, float weight, bool updateWeightRange)
void loadSimulation(FILE *fid)
standard exponential curve
int getGroupId(std::string grpName)
const FILE * getLogFpDeb()
returns file pointer to debug log
short int connect(int grpId1, int grpId2, ConnectionGenerator *conn, float mulSynFast, float mulSynSlow, bool synWtType)
bool isConnectionPlastic(short int connId)
Returns whether a connection is fixed or plastic.
void setNM4STP(int grpId, float wSTP_U[], float wSTP_tau_u[], float wSTP_tau_x[])
NVIDIA Many CUDA Core Processor (LN20201016)
short int connectCompartments(int grpIdLower, int grpIdUpper)
make a compartmental connection between two compartmentally enabled groups Note: all compartmentally ...
CARLsimState
CARLsim states.
void setWeightAndWeightChangeUpdate(UpdateInterval wtANDwtChangeUpdateInterval, bool enableWtChangeDecay, float wtChangeDecay)
Sets the weight and weight change update parameters.
parameter must have positive value
bool isInhibitoryGroup(int gGrpId)
SpikeMonitor * setSpikeMonitor(int gid, FILE *fid)
sets up a spike monitor registered with a callback to process the spikes, there can only be one Spike...
bool isPoissonGroup(int grpId)
returns
int getNumNeuronsRegExc()
std::vector< float > getConductanceGABAa(int grpId)
bool isGroupWith(int grpId, IcalcType icalcType)
int createSpikeGeneratorGroup(const std::string &grpName, int nNeur, int neurType, int preferredPartition=ANY, ComputingBackend preferredBackend=CPU_CORES)
creates a spike generator group
ConnectionMonitor * setConnectionMonitor(int grpIdPre, int grpIdPost, const std::string &fname)
void setESTDP(int preGrpId, int postGrpId, bool isSet)
Sets default E-STDP mode and parameters.
void setISTDP(int preGrpId, int postGrpId, bool isSet, STDPType type, PulseCurve curve)
bool isConnectionPlastic(short int connId)
returns whether synapses in connection are fixed (false) or plastic (true)
int getGroupNumNeurons(int gGrpId)
void setWeight(short int connId, int neurIdPre, int neurIdPost, float weight, bool updateWeightRange=false)
sets the weight value of a specific synapse
bool getConductanceConfig(int grpId, float &dAMPA, float &rNMDA, float &dNMDA, float &dGABAa, float &rGABAb, float &dGABAb)
ConnSTDPInfo getConnSTDPInfo(int connId)
parameter cannot have negative value (opposite to "must be", but includes zero)
const FILE * getLogFpDeb()
void setConductances(bool isSet, int tdAMPA, int trNMDA, int tdNMDA, int tdGABAa, int trGABAb, int tdGABAb)
Sets custom values for conductance decay () or disables conductances alltogether These will be applie...
void setLogsFpCustom(FILE *fpInf, FILE *fpErr, FILE *fpDeb, FILE *fpLog)
std::vector< float > getConductanceGABAb(int grpId)
void setupNetwork()
build the network
float tauMinus
the time constant of the exponential curve at post-pre side
void setDefaultSaveOptions(std::string fileName, bool saveSynapseInfo)
void setConnectionModulation(int preGrpId, int postGrpId, IcalcType icalcType)
bool isInhibitoryGroup(int grpId)
void setDefaultESTDPparams(float alphaPlus, float tauPlus, float alphaMinus, float tauMinus, STDPType stdpType)
void setSpikeGenerator(int grpId, SpikeGenerator *spikeGenFunc)
void setLogsFpCustom(FILE *fpInf=NULL, FILE *fpErr=NULL, FILE *fpDeb=NULL, FILE *fpLog=NULL)
Sets the file pointers for all log files in CUSTOM mode.
RangeWeight getWeightRange(short int connId)
returns the RangeWeight struct for a specific connection ID
const FILE * getLogFpErr()
void setNeuronParameters(int grpId, float izh_a, float izh_a_sd, float izh_b, float izh_b_sd, float izh_c, float izh_c_sd, float izh_d, float izh_d_sd)
Sets Izhikevich params a, b, c, and d with as mean +- standard deviation.
void scaleWeights(short int connId, float scale, bool updateWeightRange=false)
reset Spike Counter to zero
void loadSimulation(FILE *fid)
void setHomeostasis(int grpId, bool isSet, float homeoScale, float avgTimeScale)
void saveSimulation(const std::string &fileName, bool saveSynapseInfo=true)
Saves important simulation and network infos to file.
float alphaPlus
the amplitude of the exponential curve at pre-post side
void setExternalCurrent(int grpId, const std::vector< float > ¤t)
Sets the amount of current (mA) to inject into a group.
void setACNE12(int grpId)
Sets IcalcType to ACNE12 for a specific neuron group.
Grid3D getGroupGrid3D(int grpId)
A struct to specify the receptive field (RF) radius in 3 dimensions.
bool isGroupWithHomeostasis(int grpId)
Returns whether a group has homeostasis enabled.
const FILE * getLogFpInf()
function writes population weights from gIDpre to gIDpost to file fname in binary.