MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
AdThreshIF.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2003-2007 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #include "header.h"
11 #include "ElementValueFinfo.h"
12 #include "../biophysics/CompartmentBase.h"
13 #include "../biophysics/Compartment.h"
14 #include "IntFireBase.h"
15 #include "AdThreshIF.h"
16 
17 using namespace moose;
18 
20 {
21  static string doc[] =
22  {
23  "Name", "AdThreshIF",
24  "Author", "Aditya Gilra",
25  "Description", "Leaky Integrate-and-Fire neuron with adaptive threshold."
26  "Based on Rossant, C., Goodman, D.F.M., Platkiewicz, J., and Brette, R. (2010)."
27  "Rm*Cm * dVm/dt = -(Vm-Em) + Rm*I"
28  "tauThresh * d threshAdaptive / dt = a0*(Vm-Em) - threshAdaptive "
29  "at each spike, threshAdaptive is increased by threshJump "
30  "the spiking threshold adapts as thresh + threshAdaptive "
31  };
32 
33  static ElementValueFinfo< AdThreshIF, double > threshAdaptive(
34  "threshAdaptive",
35  "adaptative part of the threshold that decays with time constant tauThresh",
38  );
39 
41  "tauThresh",
42  "time constant of adaptative part of the threshold",
45  );
46 
48  "a0",
49  "factor for voltage-dependent term in evolution of adaptative threshold: "
50  "tauThresh * d threshAdaptive / dt = a0*(Vm-Em) - threshAdaptive ",
53  );
54 
56  "threshJump",
57  "threshJump is added to threshAdaptive on each spike",
60  );
61 
62  static Finfo* AdThreshIFFinfos[] = {
63  &threshAdaptive,// Value
64  &tauThresh, // Value
65  &a0, // Value
66  &threshJump // Value
67  };
68 
69  static Dinfo< AdThreshIF > dinfo;
70  static Cinfo AdThreshIFCinfo(
71  "AdThreshIF",
73  AdThreshIFFinfos,
74  sizeof( AdThreshIFFinfos ) / sizeof (Finfo*),
75  &dinfo,
76  doc,
77  sizeof(doc)/sizeof(string)
78  );
79 
80  return &AdThreshIFCinfo;
81 }
82 
84 
86 // Here we put the Compartment class functions.
88 
90 {threshAdaptive_ = 0.0;
91 tauThresh_ = 1.0;
92 a0_ = 0.0;
93 threshJump_ = 0.0;}
94 
96 {;}
97 
99 // AdThreshIF::Dest function definitions.
101 
102 void AdThreshIF::vProcess( const Eref& e, ProcPtr p )
103 {
104  fired_ = false;
105  if ( p->currTime < lastEvent_ + refractT_ ) {
106  Vm_ = vReset_;
107  A_ = 0.0;
108  B_ = 1.0 / Rm_;
109  sumInject_ = 0.0;
110  VmOut()->send( e, Vm_ );
111  } else {
112  // activation can be a continous variable (graded synapse).
113  // So integrate it at every time step, thus *dt.
114  // For a delta-fn synapse, SynHandler-s divide by dt and send activation.
115  // See: http://www.genesis-sim.org/GENESIS/Hyperdoc/Manual-26.html#synchan
116  // for this continuous definition of activation.
117  Vm_ += activation_ * p->dt;
118  activation_ = 0.0;
119  if ( Vm_ > (threshold_+threshAdaptive_) ) {
120  Vm_ = vReset_;
122  lastEvent_ = p->currTime;
123  fired_ = true;
124  spikeOut()->send( e, p->currTime );
125  VmOut()->send( e, Vm_ );
126  } else {
128  Compartment::vProcess( e, p ); // this sends out Vm message also,
129  // so do Vm_ calculations before
130  }
131  }
132 }
133 
134 void AdThreshIF::vReinit( const Eref& e, ProcPtr p )
135 {
136  activation_ = 0.0;
137  threshAdaptive_ = 0.0;
138  fired_ = false;
139  lastEvent_ = -refractT_; // Allow it to fire right away.
140  Compartment::vReinit( e, p );
141 }
142 
143 void AdThreshIF::setThreshAdaptive( const Eref& e, double val )
144 {
145  threshAdaptive_ = val;
146 }
147 
148 double AdThreshIF::getThreshAdaptive( const Eref& e ) const
149 {
150  return threshAdaptive_;
151 }
152 
153 void AdThreshIF::setTauThresh( const Eref& e, double val )
154 {
155  tauThresh_ = val;
156 }
157 
158 double AdThreshIF::getTauThresh( const Eref& e ) const
159 {
160  return tauThresh_;
161 }
162 
163 void AdThreshIF::setA0( const Eref& e, double val )
164 {
165  a0_ = val;
166 }
167 
168 double AdThreshIF::getA0( const Eref& e ) const
169 {
170  return a0_;
171 }
172 
173 void AdThreshIF::setThreshJump( const Eref& e, double val )
174 {
175  threshJump_ = val;
176 }
177 
178 double AdThreshIF::getThreshJump( const Eref& e ) const
179 {
180  return threshJump_;
181 }
double getA0(const Eref &e) const
Definition: AdThreshIF.cpp:168
void vReinit(const Eref &e, ProcPtr p)
double currTime
Definition: ProcInfo.h:19
Definition: Dinfo.h:60
void setA0(const Eref &e, double val)
Definition: AdThreshIF.cpp:163
double threshAdaptive_
Definition: AdThreshIF.h:51
void vReinit(const Eref &e, ProcPtr p)
Definition: AdThreshIF.cpp:134
double threshJump_
Definition: AdThreshIF.h:54
double getTauThresh(const Eref &e) const
Definition: AdThreshIF.cpp:158
void setTauThresh(const Eref &e, double val)
Definition: AdThreshIF.cpp:153
void setThreshAdaptive(const Eref &e, double val)
Definition: AdThreshIF.cpp:143
double getThreshJump(const Eref &e) const
Definition: AdThreshIF.cpp:178
void vProcess(const Eref &e, ProcPtr p)
double getThreshAdaptive(const Eref &e) const
Definition: AdThreshIF.cpp:148
double dt
Definition: ProcInfo.h:18
static SrcFinfo1< double > * spikeOut()
Message src for outgoing spikes.
Definition: IntFireBase.cpp:17
virtual ~AdThreshIF()
Definition: AdThreshIF.cpp:95
static const Cinfo * initCinfo()
Definition: IntFireBase.cpp:27
Definition: Eref.h:26
static SrcFinfo1< double > * VmOut()
static const Cinfo * AdThreshIFCinfo
Definition: AdThreshIF.cpp:83
static const Cinfo * initCinfo()
Definition: AdThreshIF.cpp:19
Definition: Cinfo.h:18
void setThreshJump(const Eref &e, double val)
Definition: AdThreshIF.cpp:173
Definition: Finfo.h:12
void vProcess(const Eref &e, ProcPtr p)
Definition: AdThreshIF.cpp:102