MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
LIF.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 "../basecode/header.h"
11 #include "../basecode/ElementValueFinfo.h"
12 #include "../biophysics/CompartmentBase.h"
13 #include "../biophysics/Compartment.h"
14 #include "IntFireBase.h"
15 #include "LIF.h"
16 
17 using namespace moose;
18 
20 {
21  static string doc[] =
22  {
23  "Name", "LIF",
24  "Author", "Upi Bhalla",
25  "Description", "Leaky Integrate-and-Fire neuron"
26  };
27  static Dinfo< LIF > dinfo;
28  static Cinfo lifCinfo(
29  "LIF",
31  0, 0,
32  &dinfo,
33  doc,
34  sizeof(doc)/sizeof(string)
35  );
36 
37  return &lifCinfo;
38 }
39 
40 static const Cinfo* lifCinfo = LIF::initCinfo();
41 
43 // Here we put the Compartment class functions.
45 
47 {
48  ;
49 }
50 
52 {
53  ;
54 }
55 
57 // LIF::Dest function definitions.
59 
60 void LIF::vProcess( const Eref& e, ProcPtr p )
61 {
62  fired_ = false;
63  if ( p->currTime < lastEvent_ + refractT_ )
64  {
65  Vm_ = vReset_;
66  A_ = 0.0;
67  B_ = 1.0 / Rm_;
68  sumInject_ = 0.0;
69  VmOut()->send( e, Vm_ );
70  }
71  else
72  {
73  // activation can be a continous variable (graded synapse).
74  // So integrate it at every time step, thus *dt.
75  // For a delta-fn synapse, SynHandler-s divide by dt and send activation.
76  // See: http://www.genesis-sim.org/GENESIS/Hyperdoc/Manual-26.html#synchan
77  // for this continuous definition of activation.
78  Vm_ += activation_ * p->dt;
79  activation_ = 0.0;
80  if ( Vm_ > threshold_ )
81  {
82  Vm_ = vReset_;
83  lastEvent_ = p->currTime;
84  fired_ = true;
85  spikeOut()->send( e, p->currTime );
86  VmOut()->send( e, Vm_ );
87  }
88  else
89  {
90  Compartment::vProcess( e, p );
91  }
92  }
93 }
94 
95 void LIF::vReinit( const Eref& e, ProcPtr p )
96 {
97  activation_ = 0.0;
98  fired_ = false;
99  lastEvent_ = -refractT_; // Allow it to fire right away.
100  Compartment::vReinit( e, p );
101 }
static const Cinfo * initCinfo()
Definition: LIF.cpp:19
void vReinit(const Eref &e, ProcPtr p)
double currTime
Definition: ProcInfo.h:19
Definition: Dinfo.h:60
void vProcess(const Eref &e, ProcPtr p)
Definition: LIF.cpp:60
LIF()
Definition: LIF.cpp:46
void vProcess(const Eref &e, ProcPtr p)
void vReinit(const Eref &e, ProcPtr p)
Definition: LIF.cpp:95
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
static SrcFinfo1< double > * VmOut()
static const Cinfo * lifCinfo
Definition: LIF.cpp:40
virtual ~LIF()
Definition: LIF.cpp:51
Definition: Cinfo.h:18