MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IntFireBase.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 
16 using namespace moose;
18 {
20  "spikeOut",
21  "Sends out spike events. The argument is the timestamp of "
22  "the spike. "
23  );
24  return &spikeOut;
25 }
26 
28 {
30  // Field Definitions
33  "thresh",
34  "firing threshold",
37  );
38 
40  "vReset",
41  "voltage is set to vReset after firing",
44  );
45 
46  static ElementValueFinfo< IntFireBase, double > refractoryPeriod(
47  "refractoryPeriod",
48  "Minimum time between successive spikes",
51  );
52 
54  "lastEventTime",
55  "Timestamp of last firing.",
57  );
58 
60  "hasFired",
61  "The object has fired within the last timestep",
63  );
65  // MsgDest Definitions
67  static DestFinfo activation(
68  "activation",
69  "Handles value of synaptic activation arriving on this object",
71 
73 
74  static Finfo* intFireFinfos[] =
75  {
76  &thresh, // Value
77  &vReset, // Value
78  &refractoryPeriod, // Value
79  &hasFired, // ReadOnlyValue
80  &lastEventTime, // ReadOnlyValue
81  &activation, // DestFinfo
82  IntFireBase::spikeOut() // MsgSrc
83  };
84 
85  static string doc[] =
86  {
87  "Name", "IntFireBase",
88  "Author", "Upi Bhalla",
89  "Description", "Base class for Integrate-and-fire compartment.",
90  };
91  static ZeroSizeDinfo< int > dinfo;
92  static Cinfo intFireBaseCinfo(
93  "IntFireBase",
95  intFireFinfos,
96  sizeof( intFireFinfos ) / sizeof (Finfo*),
97  &dinfo,
98  doc,
99  sizeof(doc)/sizeof(string)
100  );
101 
102  return &intFireBaseCinfo;
103 }
104 
106 
108 // Here we put the Compartment class functions.
110 
112  :
113  threshold_( 0.0 ),
114  vReset_( 0.0 ),
115  activation_( 0.0 ),
116  refractT_( 0.0 ),
117  lastEvent_( 0.0 ),
118  fired_( false )
119 {;}
120 
122 {
123  ;
124 }
125 
126 // Value Field access function definitions.
127 void IntFireBase::setThresh( const Eref& e, double val )
128 {
129  threshold_ = val;
130 }
131 
132 double IntFireBase::getThresh( const Eref& e ) const
133 {
134  return threshold_;
135 }
136 
137 void IntFireBase::setVReset( const Eref& e, double val )
138 {
139  vReset_ = val;
140 }
141 
142 double IntFireBase::getVReset( const Eref& e ) const
143 {
144  return vReset_;
145 }
146 
147 void IntFireBase::setRefractoryPeriod( const Eref& e, double val )
148 {
149  refractT_ = val;
150 }
151 
152 double IntFireBase::getRefractoryPeriod( const Eref& e ) const
153 {
154  return refractT_;
155 }
156 
157 double IntFireBase::getLastEventTime( const Eref& e ) const
158 {
159  return lastEvent_;
160 }
161 
162 bool IntFireBase::hasFired( const Eref& e ) const
163 {
164  return fired_;
165 }
166 
168 // IntFireBase::Dest function definitions.
170 
171 void IntFireBase::activation( double v )
172 {
173  activation_ += v;
174 }
void setThresh(const Eref &e, double val)
static const Cinfo * initCinfo()
Definition: Compartment.cpp:26
double getVReset(const Eref &e) const
void setRefractoryPeriod(const Eref &e, double val)
static const Cinfo * intFireBaseCinfo
bool hasFired(const Eref &e) const
static SrcFinfo1< double > * spikeOut()
Message src for outgoing spikes.
Definition: IntFireBase.cpp:17
static const Cinfo * initCinfo()
Definition: IntFireBase.cpp:27
Definition: OpFunc.h:27
Definition: Eref.h:26
void setVReset(const Eref &e, double val)
double getRefractoryPeriod(const Eref &e) const
virtual ~IntFireBase()
double getLastEventTime(const Eref &e) const
double getThresh(const Eref &e) const
Definition: Cinfo.h:18
void activation(double val)
Definition: Finfo.h:12