NEST  2.6.0,not_revisioned_source_dir@0
ht_connection.h
Go to the documentation of this file.
1 /*
2  * ht_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 HT_CONNECTION_H
24 #define HT_CONNECTION_H
25 
26 #include "connection.h"
27 
28 /* BeginDocumentation
29  Name: ht_synapse - Synapse with depression after Hill & Tononi (2005).
30 
31  Description:
32  This synapse implements the depression model described in [1, p 1678].
33  Synaptic dynamics are given by
34 
35  P'(t) = ( 1 - P ) / tau_p
36  P(T+) = (1 - delta_P) P(T-) for T : time of a spike
37  P(t=0) = 1
38 
39  w(t) = w_max * P(t) is the resulting synaptic weight
40 
41  Parameters:
42  The following parameters can be set in the status dictionary:
43  tauP double - synaptic vesicle pool recovery time constant [ms]
44  delta_P double - fractional change in vesicle pool on incoming spikes [unitless]
45  P double - current size of the vesicle pool [unitless, 0 <= P <= 1]
46 
47  Warning:
48  THIS SYNAPSE MODEL HAS NOT BEEN TESTED EXTENSIVELY!
49 
50  References:
51  [1] S Hill and G Tononi (2005). J Neurophysiol 93:1671-1698.
52 
53  Sends: SpikeEvent
54 
55  FirstVersion: March 2009
56  Author: Hans Ekkehard Plesser, based on markram_synapse
57  SeeAlso: ht_neuron, tsodyks_synapse, stdp_synapse, static_synapse
58 */
59 
66 namespace nest {
67 
68 template<typename targetidentifierT>
69 class HTConnection : public Connection<targetidentifierT>
70 {
71  public:
72 
75 
80  HTConnection();
81 
86  HTConnection(const HTConnection &);
87 
88  // Explicitly declare all methods inherited from the dependent base ConnectionBase.
89  // This avoids explicit name prefixes in all places these functions are used.
90  // Since ConnectionBase depends on the template parameter, they are not automatically
91  // found in the base class.
96 
100  virtual ~HTConnection() {}
101 
105  virtual void get_status(DictionaryDatum & d) const;
106 
110  virtual void set_status(const DictionaryDatum & d, ConnectorModel &cm);
111 
118  void send(Event& e,thread t, double_t t_lastspike, const CommonSynapseProperties &cp);
119 
121  {
122  public:
123  // Ensure proper overriding of overloaded virtual functions.
124  // Return values from functions are ignored.
127  };
128 
130  {
131  ConnTestDummyNode dummy_target;
132  ConnectionBase::check_connection_(dummy_target, s, t, receptor_type);
133  }
134 
137 
138  private:
140 
143 
145 };
146 
147 
154 template<typename targetidentifierT>
155 inline
157  const CommonSynapseProperties &)
158 {
159  double_t h = e.get_stamp().get_ms() - t_lastspike;
160  Node *target = get_target(t);
161  // t_lastspike_ = 0 initially
162 
163  // propagation t_lastspike -> t_spike, t_lastspike_ = 0 initially, p_ = 1
164  p_ = 1 - ( 1 - p_ ) * std::exp(-h/tau_P_);
165 
166  // send the spike to the target
167  e.set_receiver(*target);
168  e.set_weight( weight_ * p_ );
169  e.set_delay( get_delay_steps() );
170  e.set_rport( get_rport() );
171  e();
172 
173  // reduce pool after spike is sent
174  p_ *= ( 1 - delta_P_ );
175 }
176 
177 template<typename targetidentifierT>
179  ConnectionBase(),
180  weight_(1.0),
181  tau_P_(50.0),
182  delta_P_(0.2),
183  p_(1.0)
184  { }
185 
186 template<typename targetidentifierT>
188  ConnectionBase(rhs),
189  weight_(rhs.weight_),
190  tau_P_(rhs.tau_P_),
191  delta_P_(rhs.delta_P_),
192  p_(rhs.p_)
193  { }
194 
195 template<typename targetidentifierT>
197  {
198  ConnectionBase::get_status(d);
199  def<double_t>(d, names::weight, weight_);
200  def<double_t>(d, "tau_P", tau_P_);
201  def<double_t>(d, "delta_P", delta_P_);
202  def<double_t>(d, "P", p_);
203  def<long_t>(d, names::size_of, sizeof(*this));
204  }
205 
206 template<typename targetidentifierT>
208  {
209  ConnectionBase::set_status(d, cm);
210 
211  updateValue<double_t>(d, names::weight, weight_);
212  updateValue<double_t>(d, "tau_P", tau_P_);
213  updateValue<double_t>(d, "delta_P", delta_P_);
214  updateValue<double_t>(d, "P", p_);
215 
216  if ( tau_P_ <= 0.0 )
217  throw BadProperty("tau_P >= 0 required.");
218 
219  if ( delta_P_ < 0.0 || delta_P_ > 1.0 )
220  throw BadProperty("0 <= delta_P <= 1 required.");
221 
222  if ( p_ < 0.0 || p_ > 1.0 )
223  throw BadProperty("0 <= P <= 1 required.");
224  }
225 
226 } // namespace
227 
228 #endif // HT_CONNECTION_H
void set_weight(double_t w)
allows efficient initialization from ConnectorModel::add_connection()
Definition: ht_connection.h:136
Connection< targetidentifierT > ConnectionBase
Definition: ht_connection.h:74
void set_rport(rport p)
Set the receiver port number (r-port).
Definition: event.h:817
virtual void get_status(DictionaryDatum &d) const
Get all properties of this connection and put them into a dictionary.
Definition: ht_connection.h:196
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
Definition: lockptrdatum.h:40
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
const Name weight("weight")
Connection parameters.
Definition: nest_names.h:344
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
Node * get_target(thread t) const
Definition: connection.h:155
HTConnection()
Default Constructor.
Definition: ht_connection.h:178
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
void check_connection(Node &s, Node &t, rport receptor_type, double_t, const CommonPropertiesType &)
Definition: ht_connection.h:129
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
double_t weight_
synpatic weight
Definition: ht_connection.h:139
Time const & get_stamp() const
Return time stamp of the event.
Definition: event.h:757
const Name target("target")
Connection parameters.
Definition: nest_names.h:282
Base class for dummy nodes used in connection testing.
Definition: connection.h:64
port handles_test_event(SpikeEvent &, rport)
Check if the node can handle a particular event and receptor type.
Definition: ht_connection.h:126
double_t delta_P_
fractional decrease in pool size per spike
Definition: ht_connection.h:142
Definition: ht_connection.h:120
Exception to be thrown if a status parameter is incomplete or inconsistent.
Definition: exceptions.h:420
virtual void set_status(const DictionaryDatum &d, ConnectorModel &cm)
Set properties of this connection from the values given in dictionary.
Definition: ht_connection.h:207
double_t tau_P_
[ms] time constant for recovery
Definition: ht_connection.h:141
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
double_t get_ms() const
Definition: nest_time.h:389
Definition: ht_connection.h:69
void send(Event &e, thread t, double_t t_lastspike, const CommonSynapseProperties &cp)
Send an event to the receiver of this connection.
Definition: ht_connection.h:156
const Name size_of("sizeof")
Connection parameters.
Definition: nest_names.h:259
Class containing the common properties for all connections of a certain type.
Definition: common_synapse_properties.h:44
CommonSynapseProperties CommonPropertiesType
Definition: ht_connection.h:73
Base class for representing connections.
Definition: connection.h:85
double_t p_
current pool size
Definition: ht_connection.h:144
Event for spike information.
Definition: event.h:320
Base class for all NEST network objects.
Definition: node.h:96
Definition: connector_model.h:38
int_t thread
Thread index type.
Definition: nest.h:133
const double e
Definition: numerics.cpp:62
virtual ~HTConnection()
Default Destructor.
Definition: ht_connection.h:100