AnimatLab  2
Test
FiringRateSim/Neuron.h
1 
7 #pragma once
8 
9 namespace FiringRateSim
10 {
11 
17  namespace Neurons
18  {
35  class FAST_NET_PORT Neuron : public AnimatSim::Node
36  {
37  protected:
40 
42  float m_fltCn;
43 
45  float m_fltInvCn;
46 
48  float m_fltGn;
49 
51  float m_fltFmin;
52 
55  float m_fltGain;
56 
59 
62 
65 
67  float m_fltAdapterI;
68 
71 
74 
77 
79  bool m_bUseNoise;
80 
82  bool m_bGainType;
83 
85  float m_fltDCTH;
86 
89 
92 
95 
98 
100  float m_fltVn;
101 
104 
106  float m_aryVn[2];
107 
109  float m_fltVNoise;
110 
112  float m_fltVth;
113 
115  float m_fltVthi;
116 
118  float m_fltVthadd;
119 
121  float m_aryVth[2];
122 
124  float m_fltVrest;
125 
127  float m_fltVndisp;
128 
130  float m_fltVthdisp;
131 
133  float m_fltIinit;
134 
137 
139  CStdPtrArray<Synapse> m_arySynapses;
140 
141  virtual float CalculateFiringFrequency(float fltVn, float fltVth);
142  virtual float CalculateSynapticCurrent(FiringRateModule *lpModule);
143  virtual float CalculateIntrinsicCurrent(FiringRateModule *lpModule, float fltInputCurrent);
144 
145  Synapse *LoadSynapse(CStdXml &oXml);
146 
147  public:
148  Neuron();
149  virtual ~Neuron();
150 
151  virtual float Cn();
152  virtual void Cn(float fltVal);
153 
154  virtual float Gn();
155  virtual void Gn(float fltVal);
156 
157  virtual float Vth();
158  virtual void Vth(float fltVal);
159 
160  virtual float Fmin();
161  virtual void Fmin(float fltVal);
162 
163  virtual float Gain();
164  virtual void Gain(float fltVal);
165 
166  virtual float ExternalI();
167  virtual void ExternalI(float fltVal);
168  virtual void AddExternalI(float fltVal);
169 
170  virtual float IntrinsicCurrent();
171  virtual void IntrinsicCurrent(float fltVal);
172 
173  virtual float Vrest();
174  virtual void Vrest(float fltVal);
175 
176  virtual float VNoiseMax();
177  virtual void VNoiseMax(float fltVal);
178 
179  virtual bool UseNoise();
180  virtual void UseNoise(bool bVal);
181 
182  virtual bool UseAccom();
183  virtual void UseAccom(bool bVal);
184 
185  virtual float RelativeAccommodation();
186  virtual void RelativeAccommodation(float fltVal);
187 
188  virtual float AccommodationTimeConstant();
189  virtual void AccommodationTimeConstant(float fltVal);
190 
191  virtual float Iinit();
192  virtual void Iinit(float fltVal);
193 
194  virtual float InitTime();
195  virtual void InitTime(float fltVal);
196 
197  virtual bool GainType();
198  virtual void GainType(bool bVal);
199 
200  virtual float Vn();
201  virtual float FiringFreq(FiringRateModule *lpModule);
202 
203  virtual unsigned char NeuronType();
204 
205  virtual CStdPtrArray<Synapse> *GetSynapses();
206 
207  virtual void Copy(CStdSerialize *lpSource);
208 
217  virtual void AddSynapse(Synapse *lpSynapse);
218  virtual void AddSynapse(std::string strXml, bool bDoNotInit);
219  virtual void RemoveSynapse(int iIndex);
220  virtual void RemoveSynapse(std::string strID, bool bThrowError = true);
221  virtual Synapse *GetSynapse(int iIndex);
222  virtual int TotalSynapses();
223  virtual void ClearSynapses();
224  virtual int FindSynapseListPos(std::string strID, bool bThrowError = true);
225 
226  virtual void AddExternalNodeInput(int iTargetDataType, float fltInput);
227 
250  virtual void SetSystemPointers(Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify);
251  virtual void VerifySystemPointers();
252  virtual void Initialize();
253  virtual void TimeStepModified();
254  virtual void ResetSimulation();
255  virtual void StepSimulation();
256 
257  virtual void InjectCurrent(float fltVal);
258 
259 #pragma region SnapshotMethods
260  virtual long CalculateSnapshotByteSize();
261  virtual void SaveKeyFrameSnapshot(byte *aryBytes, long &lIndex);
262  virtual void LoadKeyFrameSnapshot(byte *aryBytes, long &lIndex);
263 #pragma endregion
264 
265 #pragma region DataAccesMethods
266  virtual float *GetDataPointer(const std::string &strDataType);
267  virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
268  virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
269  virtual bool AddItem(const std::string &strItemType, const std::string &strXml, bool bThrowError = true, bool bDoNotInit = false);
270  virtual bool RemoveItem(const std::string &strItemType, const std::string &strID, bool bThrowError = true);
271 #pragma endregion
272 
273  virtual void Load(CStdXml &oXml);
274  };
275 
276  } //Neurons
277 } //FiringRateSim
float m_fltIinit
The initialization current to turn on at the beginning of the simulation.
Firing rate neural module.
float m_fltAdapterI
current added from all of the adapters.
float m_fltAccomTimeConst
The accomodation time constant tells how fast the neuron accomodates to a new membrane potential...
float m_fltFiringFreq
Current firing frequency.
float m_fltVndisp
this is the membrane voltage that is reported back to animatlab.
float m_fltAccomTimeMod
If we are setting the accomodation time constant through modulation then this keeps track of it...
float m_fltVNoise
This is the random noise that should be added to the membrane voltage at a timestep.
float m_fltVthadd
The component added to Vthi for accomodation.
float m_fltVNoiseMax
Tells the maximum noise to use when running sim.
CStdPtrArray< Synapse > m_arySynapses
The array of synapses that are in-coming to this neuron.
float m_fltExternalI
Externally injected current.
float m_fltAdapterMemoryI
Used to allow datacharts to track current input from adapters.
float m_fltFmin
Minimum Firing frequency.
float m_fltIntrinsicI
Intrinsic current.
float m_fltInvCn
Inverse membrane capacitance.
Firing Rate Neuron model.
bool m_bUseAccom
true use accomodation
float m_fltInitTime
The duration for how long the Iinit current is on at the beginning of the simulation.
float m_fltVn
Current membrane voltage.
float m_fltVth
Firing frequency voltage threshold.
float m_fltRelativeAccom
The relative accomodation rate.
float m_fltCn
Membrane capacitance.
float m_fltVthi
Initial firing frequency voltage threshold.
Base class for body parts and neural network nodes.
Definition: Node.h:25
Contains the classes for a firing rate neural model.
float m_fltTotalMemoryI
Total current applied to the neuron.
bool m_bUseNoise
Tells if we should use noise or not.
float m_fltGn
Membrane conductance.
float m_fltDCTH
expon decline working factor for thresh accomm
bool m_bGainType
Tells whether to use the old type gain or new type gain.
float m_fltSynapticI
Current synaptic current.
float m_fltVthdisp
this is the theshold voltage that is reported back to animatlab.
FiringRateModule * m_lpFRModule
Pointer to the parent FiringRateModule.
float m_fltVrest
this is the resting potential of the neuron.