NEST  2.6.0,not_revisioned_source_dir@0
mip_generator.h
Go to the documentation of this file.
1 /*
2  * mip_generator.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 MIP_GENERATOR_H
24 #define MIP_GENERATOR_H
25 /****************************************/
26 /* class mip_generator */
27 /* Vers. 1.0 moritz */
28 /* */
29 /****************************************/
30 
31 #include "nest.h"
32 #include "event.h"
33 #include "node.h"
34 #include "stimulating_device.h"
35 #include "connection.h"
36 #include "poisson_randomdev.h"
37 
38 namespace nest
39 {
41 
46 /*BeginDocumentation
47 Name: mip_generator - create spike trains as described by the MIP model.
48 Description:
49  The mip_generator generates correlated spike trains using an Multiple Interaction
50  Process (MIP) as described in [1]. Underlying principle is a Poisson mother process
51  with rate r, the spikes of which are copied into the child processes with a certain
52  probability p. Every node the mip_generator is connected to receives a distinct
53  child process as input, whose rate is p*r. The value of the pairwise correlation
54  coefficient of two child processes created by a MIP process equals p.
55 
56 
57 Parameters:
58  The following parameters appear in the element's status dictionary:
59 
60  rate double - Mean firing rate of the mother process in Hz
61  p_copy double - Copy probability
62  mother_rng rng - Random number generator of mother process
63  mother_seed long - Seed of RNG of mother process
64 
65 Remarks:
66  The MIP generator may emit more than one spike through a child process
67  during a single time step, especially at high rates. If this happens,
68  the generator does not actually send out n spikes. Instead, it emits
69  a single spike with n-fold synaptic weight for the sake of efficiency.
70  Furthermore, note that as with the Poisson generator, different threads
71  have their own copy of a MIP generator. By using the same mother_seed
72  it is ensured that the mother process is identical for each of the
73  generators.
74 
75  IMPORTANT: The mother_seed of mpi_generator must be different from any
76  seeds used for the global or thread-specific RNGs set in
77  the kernel.
78 
79 Sends: SpikeEvent
80 
81 References:
82  [1] Alexandre Kuhn, Ad Aertsen, Stefan Rotter
83  Higher-Order Statistics of Input Ensembles and the Response of Simple
84  Model Neurons
85  Neural Computation 15, 67-101 (2003)
86 
87 Author: May 2006, Helias
88 SeeAlso: Device
89 */
90 
97  class mip_generator : public Node
98  {
99 
100  public:
101 
107  mip_generator();
108 
114  mip_generator(const mip_generator & rhs);
115 
116  bool has_proxies() const {return false;}
117 
122  using Node::event_hook;
123 
125 
126  void get_status(DictionaryDatum &) const;
127  void set_status(const DictionaryDatum &) ;
128 
129  private:
130 
131  void init_state_(const Node&);
132  void init_buffers_();
133  void calibrate();
134 
135  void update(Time const &, const long_t, const long_t);
136 
140  void event_hook(DSSpikeEvent&);
141 
142  // ------------------------------------------------------------
143 
151  struct Parameters_ {
156 
157  Parameters_();
158  Parameters_(const Parameters_&);
159 
160  void get(DictionaryDatum&) const;
161  void set(const DictionaryDatum&);
162  };
163 
164  // ------------------------------------------------------------
165 
166  struct Variables_ {
168  };
169 
170  // ------------------------------------------------------------
171 
175 
176  };
177 
178  inline
180  {
181  device_.enforce_single_syn_type(syn_id);
182 
183  if ( dummy_target )
184  {
185  DSSpikeEvent e;
186  e.set_sender(*this);
187  return target.handles_test_event(e, receptor_type);
188  }
189  else
190  {
191  SpikeEvent e;
192  e.set_sender(*this);
193  return target.handles_test_event(e, receptor_type);
194  }
195  }
196 
197  inline
199  {
200  P_.get(d);
201  device_.get_status(d);
202  }
203 
204  inline
206  {
207  Parameters_ ptmp = P_; // temporary copy in case of errors
208  ptmp.set(d); // throws if BadProperty
209 
210  // We now know that ptmp is consistent. We do not write it back
211  // to P_ before we are also sure that the properties to be set
212  // in the parent class are internally consistent.
213  device_.set_status(d);
214 
215  // if we get here, temporaries contain consistent set of properties
216  P_ = ptmp;
217  }
218 
219 } // namespace nest
220 
221 #endif
double_t rate_
process rate in Hz
Definition: mip_generator.h:152
const Name receptor_type("receptor_type")
Connection parameters.
Definition: nest_names.h:240
Definition: lockptrdatum.h:40
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
Declarations for base class Node.
Store independent parameters of the model.
Definition: mip_generator.h:151
"Callback request event" for use in Device.
Definition: event.h:374
Base class for common properties of Stimulating Devices.
Definition: stimulating_device.h:117
void set_sender(Node &)
Change pointer to sending Node.
Definition: event.h:714
long_t rport
Connection port number to distinguish incoming connections, also called receiver port.
Definition: nest.h:147
double_t p_copy_
copy probability for each spike in the mother process
Definition: mip_generator.h:153
Definition: mip_generator.h:166
void event_hook(DSSpikeEvent &)
Definition: mip_generator.cpp:151
Parameters_ P_
Definition: mip_generator.h:173
void init_state_(const Node &)
Private function to initialize the state of a node to model defaults.
Definition: mip_generator.cpp:103
void set(const DictionaryDatum &)
Set values from dicitonary.
Definition: mip_generator.cpp:62
Definition: nest_time.h:130
bool has_proxies() const
Returns true if the node has proxies on remote threads.
Definition: mip_generator.h:116
void get_status(DictionaryDatum &) const
Definition: mip_generator.h:198
void init_buffers_()
Private function to initialize the buffers of a node.
Definition: mip_generator.cpp:110
StimulatingDevice< SpikeEvent > device_
Definition: mip_generator.h:172
Parameters_()
Sets default parameter values.
Definition: mip_generator.cpp:35
void get(DictionaryDatum &) const
Store current values in dictionary.
Definition: mip_generator.cpp:55
librandom::PoissonRandomDev poisson_dev_
random deviate generator
Definition: mip_generator.h:167
const Name target("target")
Connection parameters.
Definition: nest_names.h:282
mip_generator()
The generator is threaded, so the RNG to use is determined at run-time, depending on thread...
Definition: mip_generator.cpp:86
Class PoissonRandomDev Create Poisson distributed random numbers.
Definition: poisson_randomdev.h:103
class mip_generator
Definition: mip_generator.h:97
ulong_t mother_seed_
seed of the mother process
Definition: mip_generator.h:154
long_t port
Connection port number to distinguis outgoing connections.
Definition: nest.h:155
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
librandom::RngPtr rng_
random number generator for mother process
Definition: mip_generator.h:155
unsigned char synindex
Unsigned char type for enumerations of synapse types.
Definition: nest.h:115
void calibrate()
Re-calculate dependent parameters of the node.
Definition: mip_generator.cpp:115
Default types used by the NEST kernel.
Event for spike information.
Definition: event.h:320
Base class for all NEST network objects.
Definition: node.h:96
Variables_ V_
Definition: mip_generator.h:174
virtual void event_hook(DSSpikeEvent &)
Modify Event object parameters during event delivery.
Definition: node.cpp:301
void update(Time const &, const long_t, const long_t)
Bring the node from state $t$ to $t+n*dt$.
Definition: mip_generator.cpp:128
port send_test_event(Node &, rport, synindex, bool)
Send an event to the receiving_node passed as an argument.
Definition: mip_generator.h:179
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
const double e
Definition: numerics.cpp:62
void set_status(const DictionaryDatum &)
Definition: mip_generator.h:205
unsigned long ulong_t
Unsigned long_t.
Definition: nest.h:98