Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
ActionPotential.h
Go to the documentation of this file.
1 /* @author János Végh (jvegh)
2 * @bug No known bugs.
3 */
8 #ifndef ACTIONPOTENTIAL_H
9 #define ACTIONPOTENTIAL_H
10 
11 #include "NeurerConfig.h"
12 #include "Utils.h"
13 using namespace std;
14 class AbstractNeurer;
15 
26 struct ActionPotentialPoint{unsigned int Time; signed int Amplitude;};
27 typedef vector<ActionPotentialPoint> ActionPotentialVector;
28 
29 
42 /*
43  * Performing floating calculations is a serious limiting factor of computing simulation.
44  * This class uses a special method that the factors are in units of THOUSAND
45  * The integer values to be scaled are multiplied by that factor, then divided by THOUSAND
46  * If THOUSAND=1024 was selected in the config file, the division is replaced by shifting
47  * This leads to 2.4% deviation from the 'true' value, and much quicker operation.
48  *
49  * Spikes may have two forms, depending on a configurable variable.
50  * If SPIKE_DETAILED is true:
51  * a real current pulse is delivered, which is integrated in the synapses,
52  * (a broken line, with adjustable time and aplitude factors)
53  * otherwise only the major information is delived
54  *
55  * In both cases the arrival time is delivered, per synapses to the spikes
56  * (this is the logical time: the message
57  * A spike is sent by AbstractNeurer#Fire to all (postsynaptic) neurons, the synapses of which are listed
58  * in AbstractNeurer#m_Axons. The spike message is delivered immediately, but it is put
59  * by the destination neuron in a time-ordered queue, where it will seemingly arrive
60  * exactly at the wanted time, and will be delivered to the correct synapsys, where
61  * it will be processed as described at scSynapticConnect.
62  *
63  * excitation period 0-2.3; -70 mV--50 mV
64  * 0 ms 324, 5 ms 610
65  * 0 V 221, -100 mV 504
66  * X position: (x-324)*(610-324)/5 == 57.2
67 
68  * Pont (500,232) ::: (3.077,-3.887)
69  * Pont (531,120) ::: (3.618, 35.689)
70 
71  */
72 
80 {
81  public:
82  ActionPotential(AbstractNeurer* Neurer, const ActionPotentialVector& ActionPotentialForm, sc_core::sc_time T0 ):
83  mActionPotentialTable(ActionPotentialForm) // Sets up the potential form
84  ,MyNeurer(Neurer)
85  ,mActionPotentialLength(ActionPotentialForm.size()) // Just to know
86  {
87  mLastTime = sc_core::sc_time((mActionPotentialTable[0].Time-324)/0.572,sc_core::SC_US);
88  mActionPotentialIndex = 1; // The real play starts at point 1
89  }
90 
91  // * For simplicity (and lazyness) the time (X) and voltage (Y) values are calculated as
92  // * X position: (x-324)/57.2
93  sc_core::sc_time Time_Get(int n)
94  {assert(n<mActionPotentialLength);
95  sc_core::sc_time mThisTime = sc_core::sc_time((mActionPotentialTable[n].Time-324)/0.572,sc_core::SC_US); // Return time value to the potential increase
96  sc_core::sc_time TDif = ThisTime-mLastTime; mLastTime = ThisTime;
97  return TDif;} // Returm the difference relative to the current time, in usec : the next firing time
98  // * Y position: (y-221)*(504-221)/100 = -2.83
99  uint32_t Voltage_Get(int n){assert(n<mActionPotentialLength);
100  return (-(mActionPotentialTable[n].Amplitude-221)/0.00283 );}
101  // The potential contruibution compared to the resting potential
102  bool AddVoltageContribution(int32_t dV)
103  {MyNeurer->AddVoltageContribution(dV);}
104  virtual
105  ~ActionPotential(){}
106 
107 protected:
108  AbstractNeurer* MyNeurer; // Which neurons membrane we are contriibuting to
109  const ActionPotentialVector& mActionPotentialTable; // Points to a spike table
110  sc_core::sc_time mLastTime; // Remember the last time, in usec
111  int mActionPotentialIndex; // Just a work wariable, maybe not needed
112  int mActionPotentialLength; // Just to know size
113  sc_core::sc_time TimeBegin; // When the action potential became active
114  };
115 
116 #endif // ACTIONPOTENTIAL_H
Neurer
The Neurer class. The class implements the neurer functionality, closer to the neurons....
Definition: Neurer.h:30
ActionPotential
Handles action potential tables for the neurons.
Definition: ActionPotential.h:79
NeurerConfig.h
Topology information for the Neurer simulator.
AbstractNeurer
Definition: AbstractNeurer.h:69