NEST  2.6.0,not_revisioned_source_dir@0
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 #include "nest.h"
27 #include "event.h"
28 #include "archiving_node.h"
29 #include "ring_buffer.h"
30 #include "connection.h"
31 #include "universal_data_logger.h"
32 #include "recordables_map.h"
33 #include "normal_randomdev.h"
34 
35 namespace nest
36 {
37  class Network;
38 
39  /* BeginDocumentation
40  Name: iaf_chs_2007 - Spike-response model used in Carandini et al 2007.
41 
42  Description:
43  The membrane potential is the sum of stereotyped events: the postsynaptic
44  potentials (V_syn), waveforms that include a spike and the subsequent
45  after-hyperpolarization (V_spike) and Gaussian-distributed white noise.
46 
47  The postsynaptic potential is described by alpha function where where
48  U_epsp is the maximal amplitude of the EPSP and tau_epsp is the time to
49  peak of the EPSP.
50 
51  The spike waveform is described as a delta peak followed by a membrane
52  potential reset and exponential decay. U_reset is the magnitude of the
53  reset/after-hyperpolarization and tau_reset is the time constant of
54  recovery from this hyperpolarization.
55 
56  The linear subthresold dynamics is integrated by the Exact
57  Integration scheme [1]. The neuron dynamics is solved on the time
58  grid given by the computation step size. Incoming as well as emitted
59  spikes are forced to that grid.
60 
61  Note:
62  The way the noise term was implemented in the original model makes it
63  unsuitable for simulation in NEST. The workaround was to prepare the
64  noise signal externally prior to simulation. The noise signal,
65  if present, has to be at least as long as the simulation.
66 
67  Parameters:
68  The following parameters can be set in the status dictionary.
69 
70  tau_epsp double - Membrane time constant in ms.
71  tau_reset double - Refractory time constant in ms.
72  U_epsp double - Maximum amplitude of the EPSP. Normalized.
73  U_reset double - Reset value of the membrane potential. Normalized.
74  U_noise double - Noise scale. Normalized.
75  noise vector<double>- Noise signal.
76 
77  References:
78  [1] Carandini M, Horton JC, Sincich LC (2007) Thalamic filtering of retinal
79  spike trains by postsynaptic summation. J Vis 7(14):20,1-11.
80  [2] Rotter S & Diesmann M (1999) Exact simulation of time-invariant linear
81  systems with applications to neuronal modeling. Biologial Cybernetics
82  81:381-402.
83 
84  Sends: SpikeEvent
85 
86  Receives: SpikeEvent, DataLoggingRequest
87 
88  FirstVersion: May 2012
89  Author: Thomas Heiberg, Birgit Kriener
90  */
91 
95  class iaf_chs_2007:
96  public Archiving_Node
97  {
98 
99  public:
100 
101  iaf_chs_2007();
102  iaf_chs_2007(const iaf_chs_2007&);
103 
108  using Node::handle;
110 
112 
113  void handle(SpikeEvent &);
114  void handle(DataLoggingRequest &);
115 
118 
119  void get_status(DictionaryDatum &) const;
120  void set_status(const DictionaryDatum &);
121 
122  private:
123 
124  void init_node_(const Node& proto);
125  void init_state_(const Node& proto);
126  void init_buffers_();
127  void calibrate();
128 
129  void update(const Time &, const long_t, const long_t);
130 
131  // The next two classes need to be friends to access the State_ class/member
133  friend class UniversalDataLogger<iaf_chs_2007>;
134 
135  // ----------------------------------------------------------------
136 
140  struct State_
141  {
142  // state variables
143  double_t i_syn_ex_; // postsynaptic current for exc. inputs, variable 1
144  double_t V_syn_; // psp waveform, variable 2
145  double_t V_spike_; // post spike reset waveform, variable 3
146  double_t V_m_; // membrane potential, variable 4
147 
149 
150  State_();
151 
152  void get(DictionaryDatum &) const;
153  void set(DictionaryDatum const &);
154  };
155 
156  // ----------------------------------------------------------------
157 
161  struct Parameters_
162  {
163 
166 
169 
172 
175 
178 
181 
184 
187 
189  std::vector<double_t> noise_;
190 
191  Parameters_();
192 
193  void get(DictionaryDatum&) const;
194 
200  void set(const DictionaryDatum&, State_& s);
201  };
202 
203 
204  // ----------------------------------------------------------------
205 
209  struct Buffers_
210  {
212  Buffers_(const Buffers_ &, iaf_chs_2007 &);
213 
217 
220  };
221 
222  // ----------------------------------------------------------------
223 
227  struct Variables_
228  {
234  // double_t PSCInitialValue_;
235 
236  // time evolution operator
242 
244  };
245 
246  // Access functions for UniversalDataLogger -------------------------------
247 
249  double_t get_V_m_() const { return S_.V_m_ + P_.E_L_; }
250 
251  // ----------------------------------------------------------------
252 
268  };
269 
270  inline
272  {
273  SpikeEvent e;
274  e.set_sender(*this);
275 
276  return target.handles_test_event(e, receptor_type);
277  }
278 
279  inline
281  {
282  if (receptor_type != 0)
283  throw UnknownReceptorType(receptor_type, get_name());
284  return 0;
285  }
286 
287  inline
290  {
291  if (receptor_type != 0)
292  throw UnknownReceptorType(receptor_type, get_name());
293  return B_.logger_.connect_logging_device(dlr, recordablesMap_);
294  }
295 
296  inline
298  {
299  P_.get(d);
300  S_.get(d);
302 
303  (*d)[names::recordables] = recordablesMap_.get_list();
304  }
305 
306  inline
308  {
309  Parameters_ ptmp = P_; // temporary copy in case of errors
310  ptmp.set(d, S_);
311  State_ stmp = S_; // temporary copy in case of errors
312  stmp.set(d); // throws if BadProperty
313 
314  // We now know that (ptmp, stmp) are consistent. We do not
315  // write them back to (P_, S_) before we are also sure that
316  // the properties to be set in the parent class are internally
317  // consistent.
319 
320  // if we get here, temporaries contain consistent set of properties
321  P_ = ptmp;
322  S_ = stmp;
323  }
324 
325 } // namespace
326 
327 #endif // IAF_CHS_2007_H
const Name recordables("recordables")
List of recordable state data (Device parameters)
Definition: nest_names.h:244
static RecordablesMap< iaf_chs_2007 > recordablesMap_
Mapping of recordables names to access functions.
Definition: iaf_chs_2007.h:267
Definition of Archiving_Node which is capable of recording and managing a spike history.
void set(const DictionaryDatum &, State_ &s)
Set values from dictionary.
Definition: iaf_chs_2007.cpp:93
const Name receptor_type("receptor_type")
Connection parameters.
Definition: nest_names.h:240
void init_state_(const Node &proto)
Private function to initialize the state of a node to model defaults.
Definition: iaf_chs_2007.cpp:169
Parameters_()
Sets default parameter values.
Definition: iaf_chs_2007.cpp:57
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
void get_status(DictionaryDatum &) const
Definition: iaf_chs_2007.h:297
double_t V_syn_
Definition: iaf_chs_2007.h:144
void set_status(const DictionaryDatum &)
Definition: iaf_chs_2007.h:307
void set_sender(Node &)
Change pointer to sending Node.
Definition: event.h:714
void set(DictionaryDatum const &)
Definition: iaf_chs_2007.cpp:125
double_t U_reset_
Normalized magnitude of the membrane potential reset.
Definition: iaf_chs_2007.h:180
State_ S_
Definition: iaf_chs_2007.h:261
Buffers_ B_
Definition: iaf_chs_2007.h:263
double_t P11ex_
Definition: iaf_chs_2007.h:238
librandom::NormalRandomDev normal_dev_
random deviate generator
Definition: iaf_chs_2007.h:243
Create normal (Gaussian) random numbers with uniform variance.
Definition: normal_randomdev.h:59
std::vector< double_t > noise_
Noise signal.
Definition: iaf_chs_2007.h:189
UniversalDataLogger< iaf_chs_2007 > logger_
Logger for all analog data.
Definition: iaf_chs_2007.h:219
double_t U_noise_
Noise scale.
Definition: iaf_chs_2007.h:186
long_t rport
Connection port number to distinguish incoming connections, also called receiver port.
Definition: nest.h:147
Independent parameters of the model.
Definition: iaf_chs_2007.h:161
Internal variables of the model.
Definition: iaf_chs_2007.h:227
State_()
Default initialization.
Definition: iaf_chs_2007.cpp:71
ulong_t position_
Definition: iaf_chs_2007.h:148
double_t P22_
Definition: iaf_chs_2007.h:240
RingBuffer spikes_ex_
buffers and sums up incoming spikes/currents
Definition: iaf_chs_2007.h:215
double_t E_L_
Resting potential.
Definition: iaf_chs_2007.h:171
void get(DictionaryDatum &) const
Definition: iaf_chs_2007.cpp:120
Map names of recordables to data access functions.
Definition: recordables_map.h:58
Definition: nest_time.h:130
double_t tau_reset_
Refractory time constant in ms.
Definition: iaf_chs_2007.h:168
double_t U_epsp_
Normalized maximum amplitude of the EPSP.
Definition: iaf_chs_2007.h:177
std::string get_name() const
Return class name.
Definition: node.cpp:83
void set_status(const DictionaryDatum &d)
Definition: archiving_node.cpp:185
void init_buffers_()
Private function to initialize the buffers of a node.
Definition: iaf_chs_2007.cpp:175
double_t P21ex_
Definition: iaf_chs_2007.h:239
Exception to be thrown if the specified receptor type does not exist in the node. ...
Definition: exceptions.h:254
void handle(SpikeEvent &)
Handle incoming spike events.
Definition: iaf_chs_2007.cpp:249
const Name target("target")
Connection parameters.
Definition: nest_names.h:282
RingBuffer currents_
Definition: iaf_chs_2007.h:216
double_t tau_epsp_
Membrane time constant in ms.
Definition: iaf_chs_2007.h:165
iaf_chs_2007()
Definition: iaf_chs_2007.cpp:142
a node which archives spike history for the purposes of timing dependent plasticity ...
Definition: archiving_node.h:50
long_t port
Connection port number to distinguis outgoing connections.
Definition: nest.h:155
void calibrate()
Re-calculate dependent parameters of the node.
Definition: iaf_chs_2007.cpp:183
virtual void handle(SpikeEvent &e)
Handle incoming spike events.
Definition: node.cpp:198
double double_t
Double precision floating point numbers.
Definition: nest.h:93
virtual port handles_test_event(SpikeEvent &, rport receptor_type)
Check if the node can handle a particular event and receptor type.
Definition: node.cpp:203
port handles_test_event(SpikeEvent &, rport)
Check if the node can handle a particular event and receptor type.
Definition: iaf_chs_2007.h:280
double_t V_m_
Definition: iaf_chs_2007.h:146
Request data to be logged/logged data to be sent.
Definition: event.h:486
void get(DictionaryDatum &) const
Store current values in dictionary.
Definition: iaf_chs_2007.cpp:82
Neuron model used in Carandini et al 2007.
Definition: iaf_chs_2007.h:95
void init_node_(const Node &proto)
Definition: iaf_chs_2007.cpp:162
unsigned char synindex
Unsigned char type for enumerations of synapse types.
Definition: nest.h:115
friend class UniversalDataLogger< iaf_chs_2007 >
Definition: iaf_chs_2007.h:133
State variables of the model.
Definition: iaf_chs_2007.h:140
Default types used by the NEST kernel.
void get_status(DictionaryDatum &d) const
Definition: archiving_node.cpp:175
Event for spike information.
Definition: event.h:320
double_t i_syn_ex_
Definition: iaf_chs_2007.h:143
double_t C_
Membrane capacitance.
Definition: iaf_chs_2007.h:183
port send_test_event(Node &, rport, synindex, bool)
Send an event to the receiving_node passed as an argument.
Definition: iaf_chs_2007.h:271
Base class for all NEST network objects.
Definition: node.h:96
Buffers of the model.
Definition: iaf_chs_2007.h:209
double_t V_spike_
Definition: iaf_chs_2007.h:145
double_t P20_
Amplitude of the synaptic current.
Definition: iaf_chs_2007.h:237
Buffers_(iaf_chs_2007 &)
Definition: iaf_chs_2007.cpp:130
double_t get_V_m_() const
Read out the real membrane potential.
Definition: iaf_chs_2007.h:249
double_t P30_
Definition: iaf_chs_2007.h:241
double_t U_th_
Threshold.
Definition: iaf_chs_2007.h:174
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
const double e
Definition: numerics.cpp:62
void update(const Time &, const long_t, const long_t)
Bring the node from state $t$ to $t+n*dt$.
Definition: iaf_chs_2007.cpp:206
Buffer Layout.
Definition: ring_buffer.h:77
Parameters_ P_
Definition: iaf_chs_2007.h:260
Variables_ V_
Definition: iaf_chs_2007.h:262
unsigned long ulong_t
Unsigned long_t.
Definition: nest.h:98