AnimatLab  2
Test
IntegrateFireSim/Neuron.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 class IntegrateFireNeuralModule;
10 
16 namespace IntegrateFireSim
17 {
26  class ADV_NEURAL_PORT Neuron : public AnimatSim::Node
27  {
28  protected:
31 
32 
34  // LOADABLE PARAMETERS
35 
37  static double m_dSpikePeak;
38 
40  static double m_dSpikeStrength;
41 
43  static double m_dAHPEquilPot;
44 
46  static double m_dCaEquilPot;
47 
49  static double m_dAbsoluteRefr;
50 
52  static long m_lAbsoluteRefr;
53 
56 
58  bool m_bZapped;
59 
60  // individual, basic properties
62  double m_dRestingPot;
63 
65  double m_dSize;
66 
68  double m_dTimeConst;
69 
71  double m_dCm;
72 
75 
78 
81 
83  double m_dAHPAmp;
84 
87 
88  // burster properties
90  double m_dGMaxCa;
91 
93  double m_dVM;
94 
96  double m_dSM;
97 
99  double m_dMTimeConst;
100 
102  double m_dVH;
103 
105  double m_dSH;
106 
109 
111  CStdArray<double> m_aryTonicInputPeriod;
112 
115 
118 
120  double m_dNoise;
121 
123  CStdPtrArray<IonChannel> m_aryIonChannels;
124 
127 
130 
134 
136  // WORKING STUFF
138  static double m_dDT;
139 
141  double m_dMemPot;
142 
144  double m_dNewMemPot;
145 
147  double m_dThresh;
148 
150  bool m_bSpike; // spike flag
151 
152  // electrical synapse current
155 
158 
159  // non-spiking chemical synapse current
162 
165 
166  // calculation stuff
169 
171  double m_dDCTH;
172 
174  double m_dDGK;
175 
177  double m_dGK;
178 
180  double m_dGTot;
181 
183  float m_fltGTotal;
184 
186  double m_dStim;
187 
190 
193 
196 
199 
202 
204  float m_fltTotalI;
205 
208 
211 
213  float m_fltMemPot;
214 
217 
220 
223 
226 
228  float m_fltSpike;
229 
232 
233  // for bursting
235  double m_dM;
236 
238  double m_dH;
239 
242 
243  //Vars to calculate the firing frequency of this neuron.
246 
249 
250  //Used to return the membrane conductance of this neuron in GetDataPointers.
252  float m_fltGm;
253 
255  float m_fltVrest;
256 
258  CStdArray<double> m_arySynG;
259 
261  CStdArray<double> m_aryFacilSponSynG;
262 
264  CStdArray<double> m_aryNextSponSynTime;
265 
267  CStdArray<double> m_aryDG;
268 
270  CStdArray<double> m_aryFacilD;
271 
272  virtual IonChannel *LoadIonChannel(CStdXml &oXml);
273  IonChannel *FindIonChannel(std::string strID, bool bThrowError);
274 
275  protected:
276  //void ClearSpikeTimes();
277  //void StoreSpikeForFreqAnalysis(IntegrateFireNeuralModule *lpNS);
278  void CalculateFiringFreq(IntegrateFireNeuralModule *lpNS);
279  virtual void AddIonChannel(std::string strXml, bool bDoNotInit);
280  virtual void RemoveIonChannel(std::string strID, bool bThrowError = true);
281 
282  public:
283  Neuron();
284  virtual ~Neuron();
285  virtual void Load(CStdXml &oXml);
286 
287 #pragma region Accessor-Mutators
288 
289  int NeuronID();
290  void NeuronID(int iID);
291 
292  virtual bool Enabled();
293  virtual void Enabled(bool bValue);
294 
295  virtual void AddExternalI(float fltVal);
296 
298  // ENGINE
299  double GetRestingPot();
300  double GetMemPot();
301  double GetThresh();
302  bool GetSpike();
303  bool GetZapped();
304  void IncrementStim(double stim);
305  void InElectricalSynapseCurr(double cur);
306  void InElectricalSynapseCond(double cond);
307  void IncNonSpikingSynCurr(double cur);
308  void IncNonSpikingSynCond(double cond);
309 
310  CStdPtrArray<IonChannel> *IonChannels();
311 
312  void RestingPotential(double dVal) ;
313  double RestingPotential();
314 
315  void Size(double dVal);
316  double Size();
317 
318  void TimeConstant(double dVal);
319  double TimeConstant();
320 
321  void InitialThreshold(double dVal) ;
322  double InitialThreshold();
323 
324  void RelativeAccomodation(double dVal);
325  double RelativeAccomodation();
326 
327  void AccomodationTimeConstant(double dVal);
328  double AccomodationTimeConstant();
329 
330  void AHPAmplitude(double dVal);
331  double AHPAmplitude();
332 
333  void AHPTimeConstant(double dVal);
334  double AHPTimeConstant();
335 
336  void BurstGMaxCa(double dVal);
337  double BurstGMaxCa();
338 
339  void BurstVm(double dVal);
340  double BurstVm();
341 
342  void BurstSm(double dVal);
343  double BurstSm();
344 
345  void BurstMTimeConstant(double dVal);
346  double BurstMTimeConstant();
347 
348  void BurstVh(double dVal);
349  double BurstVh();
350 
351  void BurstSh(double dVal);
352  double BurstSh();
353 
354  void BurstHTimeConstant(double dVal);
355  double BurstHTimeConstant();
356 
357  void BurstInitAtBottom(bool bVal);
358  bool BurstInitAtBottom();
359 
360  void TonicStimulus(double dblVal);
361  double TonicStimulus();
362 
363  void TonicNoise(double dblVal);
364  double TonicNoise();
365 
366 #pragma endregion
367 
368  void PreCalc(IntegrateFireNeuralModule *lpNS);
369  void CalcUpdate(IntegrateFireNeuralModule *lpNS);
370  void CalcUpdateFinal(IntegrateFireNeuralModule *lpNS);
371  void PostCalc(IntegrateFireNeuralModule *lpNS);
372 
373  virtual int FindIonChannelListPos(std::string strID, bool bThrowError = true);
374 
375  //Node Overrides
376 #pragma region DataAccesMethods
377  virtual float *GetDataPointer(const std::string &strDataType);
378  virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
379  virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
380  virtual bool AddItem(const std::string &strItemType, const std::string &strXml, bool bThrowError = true, bool bDoNotInit = false);
381  virtual bool RemoveItem(const std::string &strItemType, const std::string &strID, bool bThrowError = true);
382 #pragma endregion
383 
384  virtual void AddExternalNodeInput(int iTargetDataType, float fltInput);
385  virtual void ResetSimulation();
386  //Node Overrides
387 
388  virtual void SetSystemPointers(Simulator *lpSim, Structure *lpStructure, AnimatSim::Behavior::NeuralModule *lpModule, Node *lpNode, bool bVerify);
389  virtual void VerifySystemPointers();
390 
392  };
393 
394 } //IntegrateFireSim
static double m_dAbsoluteRefr
The static absolute refractory period after an action potential.
double m_dDCTH
exponential decline working factor for threshold accommodation
float m_fltExternalI
The external current.
double m_dStim
The stimulus current.
CaActivation * m_lpCaActive
The pointer to the calcium activation object.
Integrate and fire neural module.
double m_dToniCurrentStimulusulus
A tonic current stimulus that can be applied to the neuron.
double m_dNonSpikingSynCur
The non-spiking synaptic current.
static double m_dCaEquilPot
The static calcium equil pot.
float m_fltGTotal
Reported g total.
double m_dGMaxCa
The maximum conductance of the calcium current.
double m_dCm
The membrane capacitance.
CaActivation * m_lpCaInactive
The pointer to the calcium inactivation object.
float m_fltChannelI
The ioin channel current.
double m_dNewMemPot
The next membrane potential.
float m_fltAdapterMemoryI
The adapter current memory. This is used to allow datacharts to track current input from adapters...
double m_dRestingPot
The resting potential of the neuron.
Integrate and fire neuron model.
double m_dAHPTimeConst
The after-hyperpolarizing time constant.
double m_dElecSynCond
The electrical synaptic condutance.
bool m_bZapped
Sets whether the neuron is disabled or not.
float m_fltSpikingSynCurMemory
The spiking synaptic current memory. Used for reporting purposes.
float m_fltMemPot
The memory potential. This is for reporting purposes.
IntegrateFireNeuralModule * m_lpIGFModule
The pointer to the parent IntegrateFireNeuralModule.
double m_dDGK
exponential decline factor for AHP
double m_dSize
Size of the neuron. This is essentially equivalent to the membrane conductance.
long m_lRefrCountDown
The refractory count down.
static double m_dSpikePeak
The static spike peak.
float m_fltFiringFreq
The firing frequency.
float m_fltChannelMemoryI
The ion channel current memory. This is used to allow datacharts to track current input from ion chan...
static double m_dAHPEquilPot
The static after-hyperpolarizing equil pot. Typically equil pot for K.
Calcium activation.
Definition: CaActivation.h:21
CStdArray< double > m_arySynG
Current conductance of each synaptic type.
float m_fltSpike
The spike memory. Used for reporting purposes.
double m_dGTot
cummulative total contuctance
double m_dSH
Inactivation slope of the calcium current.
double m_dVM
Activation mid point of the calcium current.
CStdArray< double > m_aryFacilD
exponential decline factor in facilitation.
double m_dMemPot
The membrane potential.
double m_dRelativeAccom
The amount of relative accommodation. This ranges from 0 to 1.
double m_dTimeConst
The time constant for the neuron.
double m_dM
The activation variable.
double m_dSM
Activation slope of the calcium current.
float m_fltNonSpikingSynCurMemory
The non-spiking synaptic current memory. Used for reporting purposes.
static long m_lAbsoluteRefr
The static absolute refractory period in timeslices after an action potential.
double m_dNoise
The noise being applied to the membrane.
float m_fltGm
The membrane conductance. Used for reporting purposes.
bool m_bSpike
true if spike occured.
CStdArray< double > m_aryNextSponSynTime
Time to next spontaneous occurrence of this syn type.
Base class for body parts and neural network nodes.
Definition: Node.h:25
static double m_dSpikeStrength
The static spike strength used when calculating the action potential.
CStdArray< double > m_aryTonicInputPeriod
An array of tonic inputs that can be applied to the neuron.
float m_fltTotalI
The total current.
double m_dH
The inactivation variable.
double m_fltLastSpikeTime
Time of the last spike.
CStdArray< int > m_aryTonicInputPeriodType
An array of tonic input types that can be applied to the neuron.
double m_dNonSpikingSynCond
The non-spiking synaptic condutance.
double m_dVH
Inactivation mid point of the calcium current.
double m_dHTimeConst
Inactivation time constant the calcium current.
double m_dElecSynCur
The electrical synaptic current.
CStdPtrArray< IonChannel > m_aryIonChannels
The array of ion channels.
int m_iIonChannels
Number of ion channels.
float m_fltElecSynCurMemory
The electrical synaptic current memory. Used for reporting purposes.
int m_iNeuronID
Integer ID for the neuron. This is its index in the array of neruons in the neural module...
CStdArray< double > m_aryDG
exponential decline factor in syn G.
CStdArray< double > m_aryFacilSponSynG
facilitated initial g increase caused by spontaneous input
float m_fltAdapterI
The adapter current.
double m_dAHPAmp
The after-hyperpolarizing conductance amplitude.
float m_fltICaMemory
The ca current memory.
double m_dInitialThresh
The initial voltage threshold for the neuron.
double m_dMTimeConst
activation time constant the calcium current.
static double m_dDT
The statoc time step.
Contains all of the classes to implement a basic integrate and fire neural model. ...
float m_fltTotalMemoryI
The total current memory. This is used to allow datacharts to track current input from ion channels...
double m_dGK
cummulative amplitude of AHP conductance
double m_dAccomTimeConst
The accommodation time constant.
double m_dThresh
The voltage threshold.
float m_fltVrest
The rest potential. Used for reporting purposes.
float m_fltEMemory
The Reporting variable for E.
float m_fltThresholdMemory
The threshold potential memory. Used to allow us to chart the threshold if needed.