NEST  2.6.0,not_revisioned_source_dir@0
quantal_stp_connection.h
Go to the documentation of this file.
1 /*
2  * quantal_stp_connection.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 QUANTAL_STP_CONNECTION_H
24 #define QUANTAL_STP_CONNECTION_H
25 
26 #include "connection.h"
27 
28 #include "binomial_randomdev.h"
29 
30 /* BeginDocumentation
31  Name: quantal_stp_synapse - Probabilistic synapse model with short term plasticity.
32 
33  Description:
34 
35  This synapse model implements synaptic short-term depression and
36  short-term facilitation according to the quantal release model
37  described by Fuhrmann et al. [1] and Loebel et al. [2].
38 
39  Each presynaptic spike will stochastically activate a fraction of
40  the available release sites. This fraction is binomialy
41  distributed and the release probability per site is governed by the
42  Fuhrmann et al. (2002) model. The solution of the differential
43  equations is taken from Maass and Markram 2002 [3].
44 
45  The connection weight is interpreted as the maximal weight that can
46  be obtained if all n release sites are activated.
47 
48  Parameters:
49  The following parameters can be set in the status dictionary:
50  U double - Maximal fraction of available resources [0,1], default=0.5
51  u double - available fraction of resources [0,1], default=0.5
52  p double - probability that a vesicle is available, default = 1.0
53  n long - total number of release sites, default = 1
54  a long - number of available release sites, default = n
55  tau_rec double - time constant for depression in ms, default=800 ms
56  tau_rec double - time constant for facilitation in ms, default=0 (off)
57 
58 
59  References:
60  [1] Fuhrmann, G., Segev, I., Markram, H., & Tsodyks, M. V. (2002). Coding of temporal
61  information by activity-dependent synapses. Journal of neurophysiology, 87(1), 140-8.
62  [2] Loebel, A., Silberberg, G., Helbig, D., Markram, H., Tsodyks,
63  M. V, & Richardson, M. J. E. (2009). Multiquantal release underlies
64  the distribution of synaptic efficacies in the neocortex. Frontiers
65  in computational neuroscience, 3(November), 27. doi:10.3389/neuro.10.027.2009
66  [3] Maass, W., & Markram, H. (2002). Synapses as dynamic memory buffers. Neural networks, 15(2), 155–61.
67 
68  Transmits: SpikeEvent
69 
70  FirstVersion: December 2013
71  Author: Marc-Oliver Gewaltig, based on tsodyks2_synapse
72  SeeAlso: tsodyks2_synapse, synapsedict, stdp_synapse, static_synapse
73 */
74 
75 
81 namespace nest {
82 
83 template<typename targetidentifierT>
84 class Quantal_StpConnection : public Connection<targetidentifierT>
85 {
86  public:
87 
90 
100 
101  // Explicitly declare all methods inherited from the dependent base ConnectionBase.
102  // This avoids explicit name prefixes in all places these functions are used.
103  // Since ConnectionBase depends on the template parameter, they are not automatically
104  // found in the base class.
109 
113  void get_status(DictionaryDatum & d) const;
114 
118  void set_status(const DictionaryDatum & d, ConnectorModel &cm);
119 
126  void send(Event& e, thread t, double_t t_lastspike, const CommonSynapseProperties &cp);
127 
129  {
130  public:
131  // Ensure proper overriding of overloaded virtual functions.
132  // Return values from functions are ignored.
135  };
136 
138  {
139  ConnTestDummyNode dummy_target;
140  ConnectionBase::check_connection_(dummy_target, s, t, receptor_type);
141  }
142 
144 
145  private:
151  int n_;
152  int a_;
153 };
154 
155 
163 template<typename targetidentifierT>
164 inline
166 {
167  Network *net=Node::network();
168  const int vp=get_target(t)->get_vp();
169 
170  const double_t h = e.get_stamp().get_ms() - t_lastspike;
171 
172  // Compute the decay factors, based on the time since the last spike.
173  const double_t p_decay = std::exp(-h/tau_rec_);
174  const double_t u_decay = (tau_fac_ < 1.0e-10) ? 0.0 : std::exp(-h/tau_fac_);
175 
176  // Compute release probability
177  u_= U_+u_*(1.-U_)*u_decay; // Eq. 4 from [2]
178 
179  // Compute number of sites that recovered during the interval.
180  for (int depleted=n_-a_; depleted > 0; --depleted)
181  {
182  if (net->get_rng(vp)->drand() < (1.0-p_decay))
183  ++a_;
184  }
185 
186  // Compute number of released sites
187  int n_release=0;
188  for (int i=a_; i> 0; --i)
189  {
190  if (net->get_rng(vp)->drand() < u_)
191  ++n_release;
192  }
193 
194  if(n_release>0)
195  {
196  e.set_receiver(*get_target(t));
197  e.set_weight( n_release*weight_);
198  e.set_delay( get_delay_steps() );
199  e.set_rport( get_rport() );
200  e();
201  a_ -= n_release;
202  }
203 }
204 
205 } // namespace
206 
207 #endif // QUANTAL_STP_CONNECTION_H
void set_rport(rport p)
Set the receiver port number (r-port).
Definition: event.h:817
void set_receiver(Node &)
Change pointer to receiving Node.
Definition: event.h:708
const Name receptor_type("receptor_type")
Connection parameters.
Definition: nest_names.h:240
Connection< targetidentifierT > ConnectionBase
Definition: quantal_stp_connection.h:89
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
long_t get_delay_steps() const
Return the delay of the connection in steps.
Definition: connection.h:126
void check_connection_(Node &dummy_target, Node &source, Node &target, rport receptor_type)
This function calls check_connection() on the sender to check if the receiver accepts the event type ...
Definition: connection.h:183
const rport invalid_port_
Value for invalid connection port number.
Definition: nest.h:160
void check_connection(Node &s, Node &t, rport receptor_type, double_t, const CommonPropertiesType &)
Definition: quantal_stp_connection.h:137
void set_weight(double_t w)
Definition: quantal_stp_connection.h:143
double_t tau_rec_
[ms] time constant for recovery from depression (D)
Definition: quantal_stp_connection.h:149
Encapsulates information which is sent between Nodes.
Definition: event.h:73
void set_weight(weight t)
Set weight of the event.
Definition: event.h:751
long_t rport
Connection port number to distinguish incoming connections, also called receiver port.
Definition: nest.h:147
port handles_test_event(SpikeEvent &, rport)
Check if the node can handle a particular event and receptor type.
Definition: quantal_stp_connection.h:134
double_t u_
dynamic value of probability of release
Definition: quantal_stp_connection.h:148
Node * get_target(thread t) const
Definition: connection.h:155
void send(Event &e, thread t, double_t t_lastspike, const CommonSynapseProperties &cp)
Send an event to the receiver of this connection.
Definition: quantal_stp_connection.h:165
const Name h("h")
Summed input to a neuron (Ginzburg neuron)
Definition: nest_names.h:158
double_t get_delay() const
Return the delay of the connection in ms.
Definition: connection.h:121
const Name w("w")
Specific to Brette & Gerstner 2005 (aeif_cond-*)
Definition: nest_names.h:343
void set_delay(delay)
Set the transmission delay of the event.
Definition: event.h:781
Quantal_StpConnection()
Default Constructor.
Definition: quantal_stp_connection_impl.h:63
Time const & get_stamp() const
Return time stamp of the event.
Definition: event.h:757
CommonSynapseProperties CommonPropertiesType
Definition: quantal_stp_connection.h:88
Base class for dummy nodes used in connection testing.
Definition: connection.h:64
librandom::RngPtr get_rng(thread thrd=0) const
Get random number client of a thread.
Definition: network.h:1157
const Name vp("vp")
Node parameter.
Definition: nest_names.h:341
Main administrative interface to the network.
Definition: network.h:135
double_t tau_fac_
[ms] time constant for facilitation (F)
Definition: quantal_stp_connection.h:150
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
rport get_rport() const
Definition: connection.h:156
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
int n_
Number of release sites.
Definition: quantal_stp_connection.h:151
Definition: quantal_stp_connection.h:84
double_t get_ms() const
Definition: nest_time.h:389
Class containing the common properties for all connections of a certain type.
Definition: common_synapse_properties.h:44
static Network * network()
Return pointer to network driver class.
Definition: node.h:813
void set_status(const DictionaryDatum &d, ConnectorModel &cm)
Set default properties of this connection from the values given in dictionary.
Definition: quantal_stp_connection_impl.h:102
Base class for representing connections.
Definition: connection.h:85
Definition: quantal_stp_connection.h:128
double_t weight_
synaptic weight
Definition: quantal_stp_connection.h:146
Event for spike information.
Definition: event.h:320
Base class for all NEST network objects.
Definition: node.h:96
double_t U_
unit increment of a facilitating synapse (U)
Definition: quantal_stp_connection.h:147
void get_status(DictionaryDatum &d) const
Get all properties of this connection and put them into a dictionary.
Definition: quantal_stp_connection_impl.h:88
Definition: connector_model.h:38
int_t thread
Thread index type.
Definition: nest.h:133
const double e
Definition: numerics.cpp:62
int a_
Number of available release sites.
Definition: quantal_stp_connection.h:152