iaf_psc_exp.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #ifndef IAF_PSC_EXP_H
  2. #define IAF_PSC_EXP_H
  3. #include "layer.hpp"
  4. #include <exception>
  5. #include <vector>
  6. class BadProperty: public std::runtime_error
  7. {
  8. public:
  9. BadProperty(const std::string& what): std::runtime_error(what) {}
  10. };
  11. class iaf_psc_exp : public layer
  12. {
  13. public:
  14. iaf_psc_exp(int n);
  15. ~iaf_psc_exp();
  16. void calibrate();
  17. /**
  18. * Independent parameters of the model.
  19. */
  20. struct Parameters_
  21. {
  22. /** Membrane time constant in ms. */
  23. double Tau_;
  24. /** Membrane capacitance in pF. */
  25. double C_;
  26. /** Refractory period in ms. */
  27. double t_ref_;
  28. /** Resting potential in mV. */
  29. double U0_;
  30. /** External current in pA */
  31. double I_e_;
  32. /** Threshold, RELATIVE TO RESTING POTENTAIL(!).
  33. I.e. the real threshold is (U0_+Theta_). */
  34. double Theta_;
  35. /** reset value of the membrane potential */
  36. double V_reset_;
  37. /** Time constant of excitatory synaptic current in ms. */
  38. double tau_ex_;
  39. /** Time constant of inhibitory synaptic current in ms. */
  40. double tau_in_;
  41. Parameters_(); //!< Sets default parameter values
  42. void set(double Tau_m, double C, double t_ref, double U0,
  43. double I_e, double Theta, double V_reset, double tau_ex, double tau_in);
  44. };
  45. /**
  46. * State variables of the model.
  47. */
  48. struct State_
  49. {
  50. // state variables
  51. double i_0_; // synaptic dc input current, variable 0
  52. double V_m_; // membrane potential, variable 2
  53. int r_ref_; // absolute refractory counter (no membrane potential propagation)
  54. State_(); //!< Default initialization
  55. };
  56. /**
  57. * Internal variables of the model.
  58. */
  59. struct Variables_
  60. {
  61. /** Amplitude of the synaptic current.
  62. This value is chosen such that a post-synaptic potential with
  63. weight one has an amplitude of 1 mV.
  64. @note mog - I assume this, not checked.
  65. */
  66. // double_t PSCInitialValue_;
  67. // time evolution operator
  68. double P20_;
  69. double P11ex_;
  70. double P11in_;
  71. double P21ex_;
  72. double P21in_;
  73. double P22_;
  74. int RefractoryCounts_;
  75. };
  76. Parameters_ P_;
  77. State_* pS_;
  78. Variables_ V_;
  79. vector<float> i_syn_ex_;
  80. vector<float> i_syn_in_;
  81. vector<float> currents;
  82. virtual float* GetInputPointer(csimInputChannel num=csimInputChannel_AMPA);
  83. virtual int proceede(int);
  84. virtual int WriteSimInfo(fstream &fw);
  85. virtual int StartBinRec(int n, int StartNumber=0);
  86. virtual int reset(int t);
  87. };
  88. #endif // IAF_PSC_EXP_H