AnimatLab  2
Test
ModulatedSynapse.cpp
Go to the documentation of this file.
1 
7 #include "StdAfx.h"
8 
9 #include "Synapse.h"
10 #include "ModulatedSynapse.h"
11 #include "Neuron.h"
12 #include "FiringRateModule.h"
13 
14 namespace FiringRateSim
15 {
16  namespace Synapses
17  {
18 
26 {
27  m_strType = "MODULATED";
28 }
29 
37 {
38 
39 }
40 
41 #pragma region DataAccesMethods
42 
43 float *ModulatedSynapse::GetDataPointer(const std::string &strDataType)
44 {
45  std::string strType = Std_CheckString(strDataType);
46 
47  if(strType == "MODULATION")
48  return &m_fltModulation;
49 
50  return Synapse::GetDataPointer(strDataType);
51 }
52 
53 void ModulatedSynapse::QueryProperties(CStdPtrArray<TypeProperty> &aryProperties)
54 {
55  Synapse::QueryProperties(aryProperties);
56 
57  aryProperties.Add(new TypeProperty("Modulation", AnimatPropertyType::Float, AnimatPropertyDirection::Get));
58 }
59 
60 #pragma endregion
61 
63 {
64  float fltIm=0;
66 
68  {
69  fltIm = m_lpFromNeuron->FiringFreq(lpModule) * m_fltWeight;
70 
71  if(fltIm>=0)
72  m_fltModulation = 1 + fltIm;
73  else
74  m_fltModulation = 1/(1-fltIm);
75  }
76  else
77  m_fltModulation = 1;
78 
79  return m_fltModulation;
80 }
81 
82  } //Synapses
83 } //FiringRateSim
84 
Firing rate neural module.
Neuron * m_lpFromNeuron
The pointer to pre-synaptic neuron.
Definition: Synapse.h:48
float m_fltWeight
The weight of the synapse. This is a current value in nanoamps.
Definition: Synapse.h:39
virtual float CalculateModulation(FiringRateModule *lpModule)
Calculates the synaptic modulation.
virtual float * GetDataPointer(const std::string &strDataType)
Returns a float pointer to a data item of interest in this object.
virtual float * GetDataPointer(const std::string &strDataType)
Returns a float pointer to a data item of interest in this object.
Definition: Synapse.cpp:385
Declares the modulated synapse class.
virtual float FiringFreq(FiringRateModule *lpModule)
Calculates the current firing frequency.
Declares the synapse class.
Declares the firing rate module class.
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
Contains the classes for a firing rate neural model.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
float m_fltModulation
The modulation value to use for this synapse.
Definition: Synapse.h:42
std::string m_strType
The type for this object. Examples are Box, Plane, Neuron, etc..
Definition: AnimatBase.h:58