AnimatLab  2
Test
CsNeuronGroup.cpp
Go to the documentation of this file.
1 
7 #include "StdAfx.h"
8 
9 #include "CsSynapseGroup.h"
10 #include "CsNeuronGroup.h"
11 #include "CsNeuralModule.h"
12 
13 namespace AnimatCarlSim
14 {
15 
23 {
24  m_lpCsModule = NULL;
25 
26  m_bEnabled = true;
27 
28  m_uiNeuronCount = 10;
29  m_iNeuralType = EXCITATORY_NEURON;
30  m_iGroupID = -1;
31 
32  m_fltA = 0.02f;
33  m_fltStdA = 0;
34  m_fltB = 0.2f;
35  m_fltStdB = 0;
36  m_fltC = -65.0f;
37  m_fltStdC = 0;
38  m_fltD = 8.0f;
39  m_fltStdD = 0;
40 
41  m_bEnableCOBA = true;
42  m_fltTauAMPA = 5;
43  m_fltTauNMDA = 150;
44  m_fltTauGABAa = 6;
45  m_fltTauGABAb = 150;
46 
49  m_fltSpikeFake = -99999;
52  m_lTotalSpikesCollected = 0;
53 
54  m_bEnableSTP = false;
55  m_fltU = 0.2f;
56  m_fltTauDepression = 800;
58 
59  m_bEnableSTDP = false;
60  m_fltMaxLTP = 1;
61  m_fltTauLTP = 20;
62  m_fltMaxLTD = 1;
63  m_fltTauLTD = 20;
64 }
65 
73 {
74 
75 try
76 {
77 }
78 catch(...)
79 {Std_TraceMsg(0, "Caught Error in desctructor of CsNeuronGroup\r\n", "", -1, false, true);}
80 }
81 
82 void CsNeuronGroup::NeuronCount(unsigned int iVal)
83 {
84  Std_IsAboveMin((int) 0, (int) iVal, true, "NeuronCount");
85  m_uiNeuronCount = iVal;
86 }
87 
88 unsigned int CsNeuronGroup::NeuronCount() {return m_uiNeuronCount;}
89 
90 void NeuralType(std::string strType);
91 
92 void CsNeuronGroup::NeuralType(std::string strType)
93 {
94  std::string strNtype = Std_CheckString(strType);
95 
96  if(strNtype == "EXCITATORY")
97  m_iNeuralType = EXCITATORY_NEURON;
98  else if(strNtype == "INHIBITORY")
99  m_iNeuralType = INHIBITORY_NEURON;
100  else
101  THROW_PARAM_ERROR(Cs_Err_strInvalidNeuralType, Cs_Err_lInvalidNeuralType, "Type: ",m_strType);
102 }
103 
104 void CsNeuronGroup::NeuralType(int iVal)
105 {
106  m_iNeuralType = iVal;
107 }
108 
109 int CsNeuronGroup::NeuralType() {return m_iNeuralType;}
110 
111 void CsNeuronGroup::GroupID(int iVal)
112 {
113  if(iVal < 0)
114  m_iGroupID = -1;
115  else
116  m_iGroupID = iVal;
117 }
118 
119 int CsNeuronGroup::GroupID() {return m_iGroupID;}
120 
121 void CsNeuronGroup::A(float fltVal) {m_fltA = fltVal;}
122 
123 float CsNeuronGroup::A() {return m_fltA;}
124 
125 void CsNeuronGroup::StdA(float fltVal) {m_fltStdA = fltVal;}
126 
127 float CsNeuronGroup::StdA() {return m_fltStdA;}
128 
129 void CsNeuronGroup::B(float fltVal) {m_fltB = fltVal;}
130 
131 float CsNeuronGroup::B() {return m_fltB;}
132 
133 void CsNeuronGroup::StdB(float fltVal) {m_fltStdB = fltVal;}
134 
135 float CsNeuronGroup::StdB() {return m_fltStdB;}
136 
137 void CsNeuronGroup::C(float fltVal) {m_fltC = fltVal;}
138 
139 float CsNeuronGroup::C() {return m_fltC;}
140 
141 void CsNeuronGroup::StdC(float fltVal) {m_fltStdC = fltVal;}
142 
143 float CsNeuronGroup::StdC() {return m_fltStdC;}
144 
145 void CsNeuronGroup::D(float fltVal) {m_fltD = fltVal;}
146 
147 float CsNeuronGroup::D() {return m_fltD;}
148 
149 void CsNeuronGroup::StdD(float fltVal) {m_fltStdD = fltVal;}
150 
151 float CsNeuronGroup::StdD() {return m_fltStdD;}
152 
153 void CsNeuronGroup::EnableCOBA(bool bVal) {m_bEnableCOBA = bVal;}
154 
155 bool CsNeuronGroup::EnableCOBA() {return m_bEnableCOBA;}
156 
157 void CsNeuronGroup::TauAMPA(float fltVal)
158 {
159  Std_IsAboveMin((float) 0, fltVal, true, "TauAMPA", false);
160  m_fltTauAMPA = fltVal;
161 }
162 
163 float CsNeuronGroup::TauAMPA() {return m_fltTauAMPA;}
164 
165 void CsNeuronGroup::TauNMDA(float fltVal)
166 {
167  Std_IsAboveMin((float) 0, fltVal, true, "TauNMDA", false);
168  m_fltTauNMDA = fltVal;
169 }
170 
171 float CsNeuronGroup::TauNMDA() {return m_fltTauNMDA;}
172 
173 void CsNeuronGroup::TauGABAa(float fltVal)
174 {
175  Std_IsAboveMin((float) 0, fltVal, true, "TauGABAa", false);
176  m_fltTauGABAa = fltVal;
177 }
178 
179 float CsNeuronGroup::TauGABAa() {return m_fltTauGABAa;}
180 
181 void CsNeuronGroup::TauGABAb(float fltVal)
182 {
183  Std_IsAboveMin((float) 0, fltVal, true, "TauGABAb", false);
184  m_fltTauGABAb = fltVal;
185 }
186 
187 float CsNeuronGroup::TauGABAb() {return m_fltTauGABAb;}
188 
189 void CsNeuronGroup::EnableSTP(bool bVal) {m_bEnableSTP = bVal;}
190 
191 bool CsNeuronGroup::EnableSTP() {return m_bEnableSTP;}
192 
193 void CsNeuronGroup::U(float fltVal)
194 {
195  Std_IsAboveMin((float) 0, fltVal, true, "U", true);
196  m_fltU = fltVal;
197 }
198 
199 float CsNeuronGroup::U() {return m_fltU;}
200 
201 void CsNeuronGroup::TauDepression(float fltVal)
202 {
203  Std_IsAboveMin((float) 0, fltVal, true, "TauDepression", false);
204  m_fltTauDepression = fltVal;
205 }
206 
207 float CsNeuronGroup::TauDepression() {return m_fltTauDepression;}
208 
209 void CsNeuronGroup::TauFacilitation(float fltVal)
210 {
211  Std_IsAboveMin((float) 0, fltVal, true, "TauFacilitation", false);
212  m_fltTauFacilitation = fltVal;
213 }
214 
215 float CsNeuronGroup::TauFacilitation() {return m_fltTauFacilitation;}
216 
217 void CsNeuronGroup::EnableSTDP(bool bVal) {m_bEnableSTDP = bVal;}
218 
219 bool CsNeuronGroup::EnableSTDP() {return m_bEnableSTDP;}
220 
221 void CsNeuronGroup::MaxLTP(float fltVal)
222 {
223  Std_IsAboveMin((float) 0, fltVal, true, "MaxLTP", true);
224  m_fltMaxLTP = fltVal;
225 }
226 
227 float CsNeuronGroup::MaxLTP() {return m_fltMaxLTP;}
228 
229 void CsNeuronGroup::TauLTP(float fltVal)
230 {
231  Std_IsAboveMin((float) 0, fltVal, true, "TauLTP", false);
232  m_fltTauLTP = fltVal;
233 }
234 
235 float CsNeuronGroup::TauLTP() {return m_fltTauLTP;}
236 
237 void CsNeuronGroup::MaxLTD(float fltVal)
238 {
239  Std_IsAboveMin((float) 0, fltVal, true, "MaxLTD", true);
240  m_fltMaxLTD = fltVal;
241 }
242 
243 float CsNeuronGroup::MaxLTD() {return m_fltMaxLTD;}
244 
245 void CsNeuronGroup::TauLTD(float fltVal)
246 {
247  Std_IsAboveMin((float) 0, fltVal, true, "TauLTD", false);
248  m_fltTauLTD = fltVal;
249 }
250 
251 float CsNeuronGroup::TauLTD() {return m_fltTauLTD;}
252 
253 void CsNeuronGroup::CollectFromWholePopulation(bool bVal)
254 {
255  if(bVal)
257  else
258  {
262  }
263 }
264 
265 bool CsNeuronGroup::CollectFromWholePopulation()
266 {
268  return true;
269  else
270  return false;
271 }
272 
273 std::multimap<int, unsigned long> *CsNeuronGroup::SpikeTimes() {return &m_arySpikeTimes;}
274 
275 void CsNeuronGroup::IncrementCollectSpikeDataForNeuron(int iIdx)
276 {
277  CStdMap<int, int>::iterator oPos;
278  oPos = m_aryCollectSpikeData.find(iIdx);
279  if(oPos != m_aryCollectSpikeData.end())
280  {
281  int iVal = oPos->second;
282  m_aryCollectSpikeData[iIdx] = iVal+1;
283  }
284  else
285  m_aryCollectSpikeData.Add(iIdx, 1);
286 }
287 
288 void CsNeuronGroup::DecrementCollectSpikeDataForNeuron(int iIdx)
289 {
290  CStdMap<int, int>::iterator oPos;
291  oPos = m_aryCollectSpikeData.find(iIdx);
292  if(oPos != m_aryCollectSpikeData.end())
293  {
294  int iVal = oPos->second-1;
295  if(iVal <= 0)
296  m_aryCollectSpikeData.Remove(iIdx);
297  else
298  m_aryCollectSpikeData[iIdx] = iVal;
299  }
300 }
301 
302 bool CsNeuronGroup::CollectingSpikeDataForNeuron(int iIdx)
303 {
304  return (bool) m_aryCollectSpikeData.count(iIdx);
305 }
306 
307 void CsNeuronGroup::Copy(CStdSerialize *lpSource)
308 {
309  Node::Copy(lpSource);
310 
311  CsNeuronGroup *lpOrig = dynamic_cast<CsNeuronGroup *>(lpSource);
312 
313  m_lpCsModule = lpOrig->m_lpCsModule;
315  m_iNeuralType = lpOrig->m_iNeuralType;
316  m_iGroupID = lpOrig->m_iGroupID;
317 
318  m_fltA = lpOrig->m_fltA;
319  m_fltStdA = lpOrig->m_fltStdA;
320  m_fltB = lpOrig->m_fltB;
321  m_fltStdB = lpOrig->m_fltStdB;
322  m_fltC = lpOrig->m_fltC;
323  m_fltStdC = lpOrig->m_fltStdC;
324  m_fltD = lpOrig->m_fltD;
325  m_fltStdD = lpOrig->m_fltStdD;
326 
327  m_bEnableCOBA = lpOrig->m_bEnableCOBA;
328  m_fltTauAMPA = lpOrig->m_fltTauAMPA;
329  m_fltTauNMDA = lpOrig->m_fltTauNMDA;
330  m_fltTauGABAa = lpOrig->m_fltTauGABAa;
331  m_fltTauGABAb = lpOrig->m_fltTauGABAb;
332 
333  m_bEnableSTP = lpOrig->m_bEnableSTP;
334  m_fltU = lpOrig->m_fltU;
337 
338  m_bEnableSTDP = lpOrig->m_bEnableSTDP;
339  m_fltMaxLTP = lpOrig->m_fltMaxLTP;
340  m_fltTauLTP = lpOrig->m_fltTauLTP;
341  m_fltMaxLTD = lpOrig->m_fltMaxLTD;
342  m_fltTauLTD = lpOrig->m_fltTauLTD;
343 }
344 
345 void CsNeuronGroup::SetCARLSimulation()
346 {
347  if(m_lpCsModule && m_lpCsModule->SNN() && m_bEnabled)
348  {
349  m_iGroupID = m_lpCsModule->SNN()->createGroup(m_strName, m_uiNeuronCount, m_iNeuralType);
352 
353  if(m_bEnableSTP)
355  else
356  m_lpCsModule->SNN()->setSTP(m_iGroupID, false);
357 
358 
359  if(m_bEnableSTDP)
361  else
362  m_lpCsModule->SNN()->setSTDP(m_iGroupID, false);
363 
364  //Set this up as a spike monitor.
365  m_lpCsModule->SNN()->setSpikeMonitor(m_iGroupID, this);
366  }
367  else
368  m_iGroupID = -1;
369 }
370 
371 void CsNeuronGroup::update(CpuSNN* s, int grpId, unsigned int* NeuronIds, unsigned int *timeCounts, unsigned int total_spikes, float firing_Rate)
372 {
373  m_fltGroupFiringRate = firing_Rate;
374  m_fltGroupTotalSpikes = total_spikes;
375 
376  //Only loop through this is some spike occurred and we are set to collect from this neuron group
377  if(total_spikes > 0 && (m_iCollectWholePopulation > 0 || m_aryCollectSpikeData.size() > 0))
378  {
379  m_AccessRecentSpikes.lock();
380 
381  int pos = 0;
382  for (int t=0; t<10; t++)
383  {
384  for (int i=0; i<timeCounts[t]; i++)
385  {
386  int id = NeuronIds[pos];
388  {
389  long lTime = m_lLastUpdateTime + t;
390  //Add the spike times to the two lists.
391  m_arySpikeTimes.insert(std::pair<int, long>(id, lTime));
392 
393  m_lTotalSpikesCollected++;
394 
395  MonitoredSpikeEvent(grpId, id, lTime);
396 
398  //if(grpId == 0 && id == 2)
399  //{
400  // std::string strMsg = "Spike for " + STR(id) + " [" + STR(id) + ", "+ STR(lTime) + "]\r\n";
401  // OutputDebugString(strMsg.c_str());
402  //}
403  }
404  pos++;
405  }
406  }
407 
408  m_AccessRecentSpikes.unlock();
409  }
410 
411  m_lLastUpdateTime += CARLSIM_STEP_SIZE;
412 }
413 
415 {
416  Node::Initialize();
417 }
418 
420 {
421 
422 }
423 
425 {
426  Node::ResetSimulation();
427 
428  m_arySpikeTimes.clear();
431  m_fltSpikeFake = -99999;
432  m_lLastUpdateTime = 0;
433  m_lTotalSpikesCollected = 0;
434 }
435 
436 void CsNeuronGroup::AddExternalNodeInput(int iTargetDataType, float fltInput)
437 {
438 }
439 
440 void CsNeuronGroup::SetSystemPointers(Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify)
441 {
442  Node::SetSystemPointers(lpSim, lpStructure, lpModule, lpNode, false);
443 
444  m_lpCsModule = dynamic_cast<CsNeuralModule *>(lpModule);
445 
446  if(bVerify) VerifySystemPointers();
447 }
448 
450 {
451  Node::VerifySystemPointers();
452 
453  if(!m_lpCsModule)
454  THROW_PARAM_ERROR(Al_Err_lUnableToCastNeuralModuleToDesiredType, Al_Err_strUnableToCastNeuralModuleToDesiredType, "ID: ", m_lpCsModule->ID());
455 
456  if(!m_lpOrganism)
457  THROW_PARAM_ERROR(Al_Err_lConvertingClassToType, Al_Err_strConvertingClassToType, "Link: ", m_strID);
458 }
459 
460 #pragma region DataAccesMethods
461 
462 bool CsNeuronGroup::SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError)
463 {
464  std::string strType = Std_CheckString(strDataType);
465 
466  if(Node::SetData(strDataType, strValue, false))
467  return true;
468 
469  if(strType == "NEURONCOUNT")
470  {
471  NeuronCount((unsigned int) atoi(strValue.c_str()));
472  return true;
473  }
474 
475  if(strType == "NEURALTYPE")
476  {
477  NeuralType(strValue);
478  return true;
479  }
480 
481  if(strType == "A")
482  {
483  A(atof(strValue.c_str()));
484  return true;
485  }
486 
487  if(strType == "STDA")
488  {
489  StdA(atof(strValue.c_str()));
490  return true;
491  }
492 
493  if(strType == "B")
494  {
495  B(atof(strValue.c_str()));
496  return true;
497  }
498 
499  if(strType == "STDB")
500  {
501  StdB(atof(strValue.c_str()));
502  return true;
503  }
504 
505  if(strType == "C")
506  {
507  C(atof(strValue.c_str()));
508  return true;
509  }
510 
511  if(strType == "STDC")
512  {
513  StdC(atof(strValue.c_str()));
514  return true;
515  }
516 
517  if(strType == "D")
518  {
519  D(atof(strValue.c_str()));
520  return true;
521  }
522 
523  if(strType == "STDD")
524  {
525  StdD(atof(strValue.c_str()));
526  return true;
527  }
528 
529  if(strType == "ENABLECOBA")
530  {
531  EnableCOBA(Std_ToBool(strValue));
532  return true;
533  }
534 
535  if(strType == "TAUAMPA")
536  {
537  TauAMPA(atof(strValue.c_str()));
538  return true;
539  }
540 
541  if(strType == "TAUNMDA")
542  {
543  TauNMDA(atof(strValue.c_str()));
544  return true;
545  }
546 
547  if(strType == "TAUGABAA")
548  {
549  TauGABAa(atof(strValue.c_str()));
550  return true;
551  }
552 
553  if(strType == "TAUGABAB")
554  {
555  TauGABAb(atof(strValue.c_str()));
556  return true;
557  }
558 
559  if(strType == "ENABLESTP")
560  {
561  EnableSTP(Std_ToBool(strValue));
562  return true;
563  }
564 
565  if(strType == "U")
566  {
567  U(atof(strValue.c_str()));
568  return true;
569  }
570 
571  if(strType == "TAUD")
572  {
573  TauDepression(atof(strValue.c_str()));
574  return true;
575  }
576 
577  if(strType == "TAUF")
578  {
579  TauFacilitation(atof(strValue.c_str()));
580  return true;
581  }
582 
583  if(strType == "ENABLESTDP")
584  {
585  EnableSTDP(Std_ToBool(strValue));
586  return true;
587  }
588 
589  if(strType == "MAXLTP")
590  {
591  MaxLTP(atof(strValue.c_str()));
592  return true;
593  }
594 
595  if(strType == "TAULTP")
596  {
597  TauLTP(atof(strValue.c_str()));
598  return true;
599  }
600 
601  if(strType == "MAXLTD")
602  {
603  MaxLTD(atof(strValue.c_str()));
604  return true;
605  }
606 
607  if(strType == "TAULTD")
608  {
609  TauLTD(atof(strValue.c_str()));
610  return true;
611  }
612 
613  //If it was not one of those above then we have a problem.
614  if(bThrowError)
615  THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType, "Data Type", strDataType);
616 
617  return false;
618 }
619 
620 void CsNeuronGroup::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
621 {
622  Node::QueryProperties(aryProperties);
623 
624  aryProperties.Add(new TypeProperty("NeuronCount", AnimatPropertyType::Integer, AnimatPropertyDirection::Set));
625  aryProperties.Add(new TypeProperty("NeuralType", AnimatPropertyType::Integer, AnimatPropertyDirection::Set));
626  aryProperties.Add(new TypeProperty("A", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
627  aryProperties.Add(new TypeProperty("StdA", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
628  aryProperties.Add(new TypeProperty("B", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
629  aryProperties.Add(new TypeProperty("StdB", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
630  aryProperties.Add(new TypeProperty("C", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
631  aryProperties.Add(new TypeProperty("StdC", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
632  aryProperties.Add(new TypeProperty("D", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
633  aryProperties.Add(new TypeProperty("StdD", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
634 
635  aryProperties.Add(new TypeProperty("EnableCOBA", AnimatPropertyType::Boolean, AnimatPropertyDirection::Set));
636  aryProperties.Add(new TypeProperty("TauAMPA", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
637  aryProperties.Add(new TypeProperty("TauNMDA", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
638  aryProperties.Add(new TypeProperty("TauGABAa", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
639  aryProperties.Add(new TypeProperty("TauGABAb", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
640 
641  aryProperties.Add(new TypeProperty("EnableSTP", AnimatPropertyType::Boolean, AnimatPropertyDirection::Set));
642  aryProperties.Add(new TypeProperty("U", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
643  aryProperties.Add(new TypeProperty("TauD", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
644  aryProperties.Add(new TypeProperty("TauF", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
645 
646  aryProperties.Add(new TypeProperty("EnableSTDP", AnimatPropertyType::Boolean, AnimatPropertyDirection::Set));
647  aryProperties.Add(new TypeProperty("MaxLTP", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
648  aryProperties.Add(new TypeProperty("TauLTP", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
649  aryProperties.Add(new TypeProperty("MaxLTD", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
650  aryProperties.Add(new TypeProperty("TauLTD", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
651 }
652 
653 float *CsNeuronGroup::GetDataPointer(const std::string &strDataType)
654 {
655  std::string strType = Std_CheckString(strDataType);
656 
657  float *lpData = NULL;
658 
659  if(strType == "ENABLE")
660  return &m_fltEnabled;
661  else if(strType == "GROUPFIRINGRATE")
662  return &m_fltGroupFiringRate;
663  else if(strType == "GROUPTOTALSPIKES")
664  return &m_fltGroupTotalSpikes;
665  else if(strType == "SPIKE")
666  return &m_fltSpikeFake;
667 
668  return Node::GetDataPointer(strDataType);
669 }
670 
671 #pragma endregion
672 
673 void CsNeuronGroup::Load(CStdXml &oXml)
674 {
675  Node::Load(oXml);
676 
677  oXml.IntoElem(); //Into Neuron Element
678 
679  Enabled(oXml.GetChildBool("Enabled", true));
680 
681  NeuronCount(oXml.GetChildInt("NeuronCount", m_uiNeuronCount));
682  NeuralType(oXml.GetChildString("NeuralType", "Excitatory"));
683  A(oXml.GetChildFloat("A", m_fltA));
684  StdA(oXml.GetChildFloat("StdA", m_fltStdA));
685  B(oXml.GetChildFloat("B", m_fltB));
686  StdB(oXml.GetChildFloat("StdB", m_fltStdB));
687  C(oXml.GetChildFloat("C", m_fltC));
688  StdC(oXml.GetChildFloat("StdC", m_fltStdC));
689  D(oXml.GetChildFloat("D", m_fltD));
690  StdD(oXml.GetChildFloat("StdD", m_fltStdD));
691 
692  EnableCOBA(oXml.GetChildBool("EnableCOBA", m_bEnableCOBA));
693  TauAMPA(oXml.GetChildFloat("TauAMPA", m_fltTauAMPA));
694  TauNMDA(oXml.GetChildFloat("TauNMDA", m_fltTauNMDA));
695  TauGABAa(oXml.GetChildFloat("TauGABAa", m_fltTauGABAa));
696  TauGABAb(oXml.GetChildFloat("TauGABAb", m_fltTauGABAb));
697 
698  EnableSTP(oXml.GetChildBool("EnableSTP", m_bEnableSTP));
699  U(oXml.GetChildFloat("U", m_fltU));
700  TauDepression(oXml.GetChildFloat("TauD", m_fltTauDepression));
701  TauFacilitation(oXml.GetChildFloat("TauF", m_fltTauFacilitation));
702 
703  EnableSTDP(oXml.GetChildBool("EnableSTDP", m_bEnableSTDP));
704  MaxLTP(oXml.GetChildFloat("MaxLTP", m_fltMaxLTP));
705  TauLTP(oXml.GetChildFloat("TauLTP", m_fltTauLTP));
706  MaxLTD(oXml.GetChildFloat("MaxLTD", m_fltMaxLTD));
707  TauLTD(oXml.GetChildFloat("TauLTD", m_fltTauLTD));
708 
709  oXml.OutOfElem(); //OutOf Neuron Element
710 }
711 
712 
713 } //AnimatCarlSim
714 
715 
716 
float m_fltMaxLTD
the max magnitude for LTD change for STDP
Contains the classes for a firing rate neural model.
Definition: CsAdapter.cpp:14
int createGroup(const string &_name, unsigned int _numN, int _nType, int configId=ALL)
creates a group of Izhikevich spiking neurons
Definition: snn_cpu.cpp:787
bool m_bEnableSTDP
Tells whether this group of neurons exhibits spike-timing dependent plasticity.
Definition: CsNeuronGroup.h:96
virtual ~CsNeuronGroup()
Destructor.
std::multimap< int, unsigned long > m_arySpikeTimes
A map for keeping track of a spike times in ms for individual neurons in this group throughout the cu...
boost::interprocess::interprocess_mutex m_AccessRecentSpikes
mutex used to try and access matches variable.
Declares the CsNeuronGroup class.
unsigned int m_uiNeuronCount
The number of neurons in this group.
Definition: CsNeuronGroup.h:35
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
float m_fltStdC
The standard deviation for Izhikevich parameter C.
Definition: CsNeuronGroup.h:59
void setSpikeMonitor(int gid, SpikeMonitor *spikeMon=NULL, int configId=ALL)
Definition: snn_cpu.cpp:3981
virtual void ResetSimulation()
Resets the simulation back to time 0.
float m_fltEnabled
This is used for reporting the enabled state in a GetDataPointer call.
Definition: Node.h:35
float m_fltTauNMDA
Time constant of NMDA decay (ms); for example, 150.0.
Definition: CsNeuronGroup.h:75
float m_fltTauFacilitation
the time constant for facilitation term for STP
Definition: CsNeuronGroup.h:93
virtual std::string ID()
Gets the unique GUID ID of this object.
Definition: AnimatBase.cpp:167
float m_fltMaxLTP
the max magnitude for LTP change for STDP
Definition: CsNeuronGroup.h:99
virtual float * GetDataPointer(const std::string &strDataType)
Returns a float pointer to a data item of interest in this object.
int m_iGroupID
The group ID of this set of neurons.
Definition: CsNeuronGroup.h:41
float m_fltTauGABAa
Time constant of GABAa decay (ms); for example, 6.0.
Definition: CsNeuronGroup.h:78
CsNeuronGroup()
Default constructor.
Organism * m_lpOrganism
The pointer to this node's organism.
Definition: Node.h:29
bool Std_IsAboveMin(int iMinVal, int iVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
Tests if a number is above a minimum value.
virtual bool Enabled()
Tells whether this node is enabled.
Definition: Node.cpp:84
std::string m_strID
The unique Id for this object.
Definition: AnimatBase.h:55
float m_fltTauLTD
the decay time constant for LTD change for STDP
float m_fltGroupTotalSpikes
The total number of spikes generated by this group of neurons in the last time slice.
void setNeuronParameters(int groupId, float _a, float a_sd, float _b, float b_sd, float _c, float c_sd, float _d, float d_sd, int configId=ALL)
Sets the Izhikevich parameters a, b, c, and d of a neuron group.
Definition: snn_cpu.cpp:923
Firing rate neural module.
float m_fltC
The Izhikevich C parameter.
Definition: CsNeuronGroup.h:56
float m_fltB
The Izhikevich B parameter.
Definition: CsNeuronGroup.h:50
virtual void Initialize()
Initializes this object.
CsNeuralModule * m_lpCsModule
Pointer to parent CsNeuralModule.
Definition: CsNeuronGroup.h:32
Declares the synapse class.
float m_fltStdB
The standard deviation for Izhikevich parameter B.
Definition: CsNeuronGroup.h:53
Firing Rate Neuron model.
Definition: CsNeuronGroup.h:28
virtual void update(CpuSNN *s, int grpId, unsigned int *NeuronIds, unsigned int *timeCounts, unsigned int total_spikes, float firing_Rate)
Controls actions that are performed when certain neurons fire (user-defined).
float m_fltStdD
The standard deviation for Izhikevich parameter D.
Definition: CsNeuronGroup.h:65
bool Std_ToBool(int iVal)
Converts a value toa bool.
void Std_TraceMsg(const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bLogToFile, bool bPrintHeader)
Traces a message to the debugger window.
float m_fltD
The Izhikevich D parameter.
Definition: CsNeuronGroup.h:62
float m_fltTauGABAb
Time constant of GABAb decay (ms); for example, 150.0.
Definition: CsNeuronGroup.h:81
bool m_bEnabled
Tells if this item is enabled or not. If it is not enabled then it is not run.
Definition: AnimatBase.h:40
CStdMap< int, int > m_aryCollectSpikeData
An array of neuron indices for individual neurons we want to collect spike data for throughout the cu...
virtual void AddExternalNodeInput(int iTargetDataType, float fltInput)
Adds an external node input.
float m_fltTauLTP
the decay time constant for LTP change for STDP
virtual void StepSimulation()
Step the simulation for this object.
unsigned long m_lLastUpdateTime
The last time step for which the monitor method ran.
float m_fltA
The Izhikevich A parameter.
Definition: CsNeuronGroup.h:44
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
virtual void VerifySystemPointers()
Verify that system pointers have been set correctly.
float m_fltU
the increment of u due to a spike for STP
Definition: CsNeuronGroup.h:87
bool m_bEnableSTP
Tells whether this group of neurons exhibits Short term plasticity.
Definition: CsNeuronGroup.h:84
float m_fltTauDepression
the time constant for depression term for STP
Definition: CsNeuronGroup.h:90
float m_fltStdA
The standard deviation for Izhikevich parameter A.
Definition: CsNeuronGroup.h:47
float m_fltTauAMPA
Time constant of AMPA decay (ms); for example, 5.0.
Definition: CsNeuronGroup.h:72
std::string m_strType
The type for this object. Examples are Box, Plane, Neuron, etc..
Definition: AnimatBase.h:58
int m_iCollectWholePopulation
If > 0 it collects data from the whole population. This is an iterator keeping track of how many thin...
Contains all of CARLsim's core functionality.
Definition: snn.h:619
std::string m_strName
The name for this object.
Definition: AnimatBase.h:61
float m_fltGroupFiringRate
The firing rate of this entire group of neurons.