MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ExIF.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 "ExIF.h"
16 
17 using namespace moose;
18 
20 {
21  static string doc[] =
22  {
23  "Name", "ExIF",
24  "Author", "Aditya Gilra",
25  "Description", "Leaky Integrate-and-Fire neuron with Exponential spike rise."
26  "Rm*Cm dVm/dt = -(Vm-Em) + deltaThresh * exp((Vm-thresh)/deltaThresh) + Rm*I"
27  };
28 
29  static ElementValueFinfo< ExIF, double > deltaThresh(
30  "deltaThresh",
31  "Parameter in Vm evolution equation:"
32  "Rm*Cm * dVm/dt = -(Vm-Em) + deltaThresh * exp((Vm-thresh)/deltaThresh) + Rm*I",
35  );
36 
38  "vPeak",
39  "Vm is reset on reaching vPeak, different from spike thresh below:"
40  "Rm*Cm dVm/dt = -(Vm-Em) + deltaThresh * exp((Vm-thresh)/deltaThresh) + Rm*I",
43  );
44 
45  static Finfo* ExIFFinfos[] = {
46  &deltaThresh, // Value
47  &vPeak, // Value
48  };
49 
50  static Dinfo< ExIF > dinfo;
51  static Cinfo ExIFCinfo(
52  "ExIF",
54  ExIFFinfos,
55  sizeof( ExIFFinfos ) / sizeof (Finfo*),
56  &dinfo,
57  doc,
58  sizeof(doc)/sizeof(string)
59  );
60 
61  return &ExIFCinfo;
62 }
63 
64 static const Cinfo* ExIFCinfo = ExIF::initCinfo();
65 
67 // Here we put the Compartment class functions.
69 
71 {vPeak_ = 0.0;
72 deltaThresh_ = 0.0;}
73 
75 {;}
76 
78 // ExIF::Dest function definitions.
80 
81 void ExIF::vProcess( const Eref& e, ProcPtr p )
82 {
83  fired_ = false;
84  if ( p->currTime < lastEvent_ + refractT_ ) {
85  Vm_ = vReset_;
86  A_ = 0.0;
87  B_ = 1.0 / Rm_;
88  sumInject_ = 0.0;
89  VmOut()->send( e, Vm_ );
90  } else {
91  // activation can be a continous variable (graded synapse).
92  // So integrate it at every time step, thus *dt.
93  // For a delta-fn synapse, SynHandler-s divide by dt and send activation.
94  // See: http://www.genesis-sim.org/GENESIS/Hyperdoc/Manual-26.html#synchan
95  // for this continuous definition of activation.
96  Vm_ += activation_ * p->dt;
97  activation_ = 0.0;
98  if ( Vm_ >= vPeak_ ) {
99  Vm_ = vReset_;
100  lastEvent_ = p->currTime;
101  fired_ = true;
102  spikeOut()->send( e, p->currTime );
103  VmOut()->send( e, Vm_ );
104  } else {
106  Compartment::vProcess( e, p ); // this sends out Vm message also,
107  // so do calculations before
108  }
109  }
110 }
111 
112 void ExIF::vReinit( const Eref& e, ProcPtr p )
113 {
114  activation_ = 0.0;
115  fired_ = false;
116  lastEvent_ = -refractT_; // Allow it to fire right away.
117  Compartment::vReinit( e, p );
118 }
119 
120 void ExIF::setDeltaThresh( const Eref& e, double val )
121 {
122  deltaThresh_ = val;
123 }
124 
125 double ExIF::getDeltaThresh( const Eref& e ) const
126 {
127  return deltaThresh_;
128 }
129 
130 void ExIF::setVPeak( const Eref& e, double val )
131 {
132  vPeak_ = val;
133 }
134 
135 double ExIF::getVPeak( const Eref& e ) const
136 {
137  return vPeak_;
138 }
double vPeak_
Definition: ExIF.h:48
double getVPeak(const Eref &e) const
Definition: ExIF.cpp:135
void vReinit(const Eref &e, ProcPtr p)
double currTime
Definition: ProcInfo.h:19
Definition: Dinfo.h:60
virtual ~ExIF()
Definition: ExIF.cpp:74
void vProcess(const Eref &e, ProcPtr p)
static const Cinfo * initCinfo()
Definition: ExIF.cpp:19
void vReinit(const Eref &e, ProcPtr p)
Definition: ExIF.cpp:112
double dt
Definition: ProcInfo.h:18
static SrcFinfo1< double > * spikeOut()
Message src for outgoing spikes.
Definition: IntFireBase.cpp:17
static const Cinfo * initCinfo()
Definition: IntFireBase.cpp:27
Definition: Eref.h:26
double deltaThresh_
Definition: ExIF.h:47
static const Cinfo * ExIFCinfo
Definition: ExIF.cpp:64
void vProcess(const Eref &e, ProcPtr p)
Definition: ExIF.cpp:81
static SrcFinfo1< double > * VmOut()
double getDeltaThresh(const Eref &e) const
Definition: ExIF.cpp:125
void setVPeak(const Eref &e, double val)
Definition: ExIF.cpp:130
Definition: Cinfo.h:18
void setDeltaThresh(const Eref &e, double val)
Definition: ExIF.cpp:120
Definition: Finfo.h:12