NEST main@caf0ae8
 
Loading...
Searching...
No Matches
iaf_chs_2007.h
Go to the documentation of this file.
1/*
2 * iaf_chs_2007.h
3 *
4 * This file is part of NEST.
5 *
6 * Copyright (C) 2004 The NEST Initiative
7 *
8 * NEST is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * NEST is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef IAF_CHS_2007_H
24#define IAF_CHS_2007_H
25
26// Includes from nestkernel:
27#include "archiving_node.h"
28#include "connection.h"
29#include "event.h"
30#include "nest_types.h"
31#include "random_generators.h"
32#include "recordables_map.h"
33#include "ring_buffer.h"
35
36namespace nest
37{
38
39/* BeginUserDocs: neuron, integrate-and-fire, hard threshold
40
41Short description
42+++++++++++++++++
43
44Spike-response model used in Carandini et al. 2007
45
46Description
47+++++++++++
48
49The membrane potential is the sum of stereotyped events: the postsynaptic
50potentials (``V_syn``), waveforms that include a spike and the subsequent
51after-hyperpolarization (``V_spike``) and Gaussian-distributed white noise.
52
53The postsynaptic potential is described by alpha function where
54``U_epsp`` is the maximal amplitude of the EPSP and ``tau_epsp`` is the time to
55peak of the EPSP.
56
57The spike waveform is described as a delta peak followed by a membrane
58potential reset and exponential decay. ``U_reset`` is the magnitude of the
59reset/after-hyperpolarization and ``tau_reset`` is the time constant of
60recovery from this hyperpolarization.
61
62The linear subthreshold dynamics is integrated by the Exact
63Integration scheme :footcite:p:`Carandini2007`. The neuron dynamics is solved on the time
64grid given by the computation step size. Incoming as well as emitted
65spikes are forced to that grid.
66
67.. note::
68
69 The way the noise term was implemented in the original model makes
70 it unsuitable for simulation in NEST. The workaround was to prepare
71 the noise signal externally prior to simulation. The noise signal,
72 if present, has to be at least as long as the simulation.
73
74See also :footcite:p:`Rotter1999`.
75
76Parameters
77++++++++++
78
79The following parameters can be set in the status dictionary.
80
81========== ============== ==================================================
82 tau_epsp ms Membrane time constant
83 tau_reset ms Refractory time constant
84 U_epsp real Maximum amplitude of the EPSP, normalized
85 U_reset real Reset value of the membrane potential, normalized
86 U_noise real Noise scale, normalized
87 noise list of real Noise signal
88========== ============== ==================================================
89
90References
91++++++++++
92
93.. footbibliography::
94
95Sends
96+++++
97
98SpikeEvent
99
100Receives
101++++++++
102
103SpikeEvent, DataLoggingRequest
104
105Examples using this model
106+++++++++++++++++++++++++
107
108.. listexamples:: iaf_chs_2007
109
110EndUserDocs */
111
112void register_iaf_chs_2007( const std::string& name );
113
115{
116
117public:
118 iaf_chs_2007();
119 iaf_chs_2007( const iaf_chs_2007& );
120
126 using Node::handle;
128
129 size_t send_test_event( Node&, size_t, synindex, bool ) override;
130
131 void handle( SpikeEvent& ) override;
132 void handle( DataLoggingRequest& ) override;
133
134 size_t handles_test_event( SpikeEvent&, size_t ) override;
135 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
136
137 void get_status( Dictionary& ) const override;
138 void set_status( const Dictionary& ) override;
139
140private:
141 void init_buffers_() override;
142 void pre_run_hook() override;
143
144 void update( const Time&, const long, const long ) override;
145
146 // The next two classes need to be friends to access the State_ class/member
147 friend class RecordablesMap< iaf_chs_2007 >;
148 friend class UniversalDataLogger< iaf_chs_2007 >;
149
150 // ----------------------------------------------------------------
151
155 struct State_
156 {
157 // state variables
158 double i_syn_ex_; // postsynaptic current for exc. inputs, variable 1
159 double V_syn_; // psp waveform, variable 2
160 double V_spike_; // post spike reset waveform, variable 3
161 double V_m_; // membrane potential, variable 4
162
163 unsigned long position_;
164
165 State_();
166
167 void get( Dictionary& ) const;
168 void set( Dictionary const&, Node* );
169 };
170
171 // ----------------------------------------------------------------
172
177 {
179 double tau_epsp_;
180
183
185 double E_L_;
186
188 double U_th_;
189
191 double U_epsp_;
192
194 double U_reset_;
195
197 double C_;
198
200 double U_noise_;
201
203 std::vector< double > noise_;
204
205 Parameters_();
206
207 void get( Dictionary& ) const;
208
214 void set( const Dictionary&, State_& s, Node* node );
215 };
216
217
218 // ----------------------------------------------------------------
219
235
236 // ----------------------------------------------------------------
237
242 {
248 // double PSCInitialValue_;
249
250 // time evolution operator
251 double P20_;
252 double P11ex_;
253 double P21ex_;
254 double P22_;
255 double P30_;
256
258 };
259
260 // Access functions for UniversalDataLogger -------------------------------
261
263 double
264 get_V_m_() const
265 {
266 return S_.V_m_ + P_.E_L_;
267 }
268
269 // ----------------------------------------------------------------
270
285};
286
287inline size_t
288iaf_chs_2007::send_test_event( Node& target, size_t receptor_type, synindex, bool )
289{
290 SpikeEvent e;
291 e.set_sender( *this );
292
293 return target.handles_test_event( e, receptor_type );
294}
295
296inline size_t
298{
299 if ( receptor_type != 0 )
300 {
301 throw UnknownReceptorType( receptor_type, get_name() );
302 }
303 return 0;
304}
305
306inline size_t
308{
309 if ( receptor_type != 0 )
310 {
311 throw UnknownReceptorType( receptor_type, get_name() );
312 }
313 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
314}
315
316inline void
318{
319 P_.get( d );
320 S_.get( d );
322
323 d[ names::recordables ] = recordablesMap_.get_list();
324}
325
326inline void
328{
329 Parameters_ ptmp = P_; // temporary copy in case of errors
330 ptmp.set( d, S_, this );
331 State_ stmp = S_; // temporary copy in case of errors
332 stmp.set( d, this ); // throws if BadProperty
333
334 // We now know that (ptmp, stmp) are consistent. We do not
335 // write them back to (P_, S_) before we are also sure that
336 // the properties to be set in the parent class are internally
337 // consistent.
339
340 // if we get here, temporaries contain consistent set of properties
341 P_ = ptmp;
342 S_ = stmp;
343}
344
345} // namespace
346
347#endif // IAF_CHS_2007_H
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
A node which archives spike history for the purposes of spike-timing dependent plasticity (STDP)
Definition archiving_node.h:49
void get_status(Dictionary &d) const override
Export properties of the node by setting entries in the status dictionary.
Definition archiving_node.cpp:220
void set_status(const Dictionary &d) override
Change properties of the node according to the entries in the dictionary.
Definition archiving_node.cpp:236
Request data to be logged/logged data to be sent.
Definition event.h:636
Base class for all NEST network objects.
Definition node.h:99
std::string get_name() const
Return class name.
Definition node.cpp:105
Map names of recordables to data access functions.
Definition recordables_map.h:61
Buffer Layout.
Definition ring_buffer.h:83
Event for spike information.
Definition event.h:418
Definition nest_time.h:135
Exception to be thrown if the specified receptor type does not exist in the node.
Definition exceptions.h:417
Definition iaf_chs_2007.h:115
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition iaf_chs_2007.h:297
State_ S_
Definition iaf_chs_2007.h:278
double get_V_m_() const
Read out the real membrane potential.
Definition iaf_chs_2007.h:264
static RecordablesMap< iaf_chs_2007 > recordablesMap_
Mapping of recordables names to access functions.
Definition iaf_chs_2007.h:284
void init_buffers_() override
Configure persistent internal data structures.
Definition iaf_chs_2007.cpp:186
size_t send_test_event(Node &, size_t, synindex, bool) override
Send an event to the receiving_node passed as an argument.
Definition iaf_chs_2007.h:288
void get_status(Dictionary &) const override
Export properties of the node by setting entries in the status dictionary.
Definition iaf_chs_2007.h:317
Buffers_ B_
Definition iaf_chs_2007.h:280
void update(const Time &, const long, const long) override
Advance the state of the node in time through the given interval.
Definition iaf_chs_2007.cpp:221
Parameters_ P_
Instances of private data structures for the different types of data pertaining to the model.
Definition iaf_chs_2007.h:277
void pre_run_hook() override
Re-calculate dependent parameters of the node.
Definition iaf_chs_2007.cpp:195
Variables_ V_
Definition iaf_chs_2007.h:279
void handle(SpikeEvent &) override
Handle incoming spike events.
Definition iaf_chs_2007.cpp:261
iaf_chs_2007()
Definition iaf_chs_2007.cpp:164
void set_status(const Dictionary &) override
Change properties of the node according to the entries in the dictionary.
Definition iaf_chs_2007.h:327
friend class UniversalDataLogger< iaf_chs_2007 >
Definition iaf_chs_2007.h:148
virtual size_t handles_test_event(SpikeEvent &, size_t receptor_type)
Check if the node can handle a particular event and receptor type.
Definition node.cpp:271
virtual void handle(SpikeEvent &e)
Handle incoming spike events.
Definition node.cpp:265
const std::string recordables("recordables")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
void register_iaf_chs_2007(const std::string &name)
Definition iaf_chs_2007.cpp:45
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:115
Buffers of the model.
Definition iaf_chs_2007.h:224
RingBuffer spikes_ex_
buffers and sums up incoming spikes/currents
Definition iaf_chs_2007.h:229
UniversalDataLogger< iaf_chs_2007 > logger_
Logger for all analog data.
Definition iaf_chs_2007.h:233
RingBuffer currents_
Definition iaf_chs_2007.h:230
Independent parameters of the model.
Definition iaf_chs_2007.h:177
std::vector< double > noise_
Noise signal.
Definition iaf_chs_2007.h:203
double tau_reset_
Refractory time constant in ms.
Definition iaf_chs_2007.h:182
double E_L_
Resting potential.
Definition iaf_chs_2007.h:185
void get(Dictionary &) const
Store current values in dictionary.
Definition iaf_chs_2007.cpp:92
double C_
Membrane capacitance.
Definition iaf_chs_2007.h:197
double U_noise_
Noise scale.
Definition iaf_chs_2007.h:200
double tau_epsp_
Membrane time constant in ms.
Definition iaf_chs_2007.h:179
double U_th_
Threshold.
Definition iaf_chs_2007.h:188
void set(const Dictionary &, State_ &s, Node *node)
Set values from dictionary.
Definition iaf_chs_2007.cpp:103
Parameters_()
Sets default parameter values.
Definition iaf_chs_2007.cpp:64
double U_reset_
Normalized magnitude of the membrane potential reset.
Definition iaf_chs_2007.h:194
double U_epsp_
Normalized maximum amplitude of the EPSP.
Definition iaf_chs_2007.h:191
State variables of the model.
Definition iaf_chs_2007.h:156
double V_syn_
Definition iaf_chs_2007.h:159
double i_syn_ex_
Definition iaf_chs_2007.h:158
double V_m_
Definition iaf_chs_2007.h:161
State_()
Default initialization.
Definition iaf_chs_2007.cpp:79
void set(Dictionary const &, Node *)
Definition iaf_chs_2007.cpp:145
unsigned long position_
Definition iaf_chs_2007.h:163
void get(Dictionary &) const
Definition iaf_chs_2007.cpp:139
double V_spike_
Definition iaf_chs_2007.h:160
Internal variables of the model.
Definition iaf_chs_2007.h:242
double P20_
Amplitude of the synaptic current.
Definition iaf_chs_2007.h:251
double P22_
Definition iaf_chs_2007.h:254
double P11ex_
Definition iaf_chs_2007.h:252
double P30_
Definition iaf_chs_2007.h:255
normal_distribution normal_dist_
random distribution
Definition iaf_chs_2007.h:257
double P21ex_
Definition iaf_chs_2007.h:253