23#ifndef URBANCZIK_SYNAPSE_H
24#define URBANCZIK_SYNAPSE_H
108template <
typename target
identifierT >
207template <
typename target
identifierT >
216template <
typename target
identifierT >
220 double t_spike = e.get_stamp().get_ms();
222 Node* target = get_target( t );
223 double dendritic_delay = get_delay();
226 std::deque< histentry_extended >::iterator start;
227 std::deque< histentry_extended >::iterator finish;
233 target->get_urbanczik_history( t_lastspike_ - dendritic_delay, t_spike - dendritic_delay, &start, &finish, comp );
235 double const g_L = target->get_g_L( comp );
236 double const tau_L = target->get_tau_L( comp );
237 double const C_m = target->get_C_m( comp );
238 double const tau_s = weight_ > 0.0 ? target->get_tau_syn_ex( comp ) : target->get_tau_syn_in( comp );
239 double dPI_exp_integral = 0.0;
241 while ( start != finish )
243 double const t_up = start->t_ + dendritic_delay;
244 double const minus_delta_t_up = t_lastspike_ - t_up;
245 double const minus_t_down = t_up - t_spike;
247 ( tau_L_trace_ * exp( minus_delta_t_up / tau_L ) - tau_s_trace_ * exp( minus_delta_t_up / tau_s ) ) * start->dw_;
249 dPI_exp_integral += exp( minus_t_down / tau_Delta_ ) * PI;
253 PI_exp_integral_ = ( exp( ( t_lastspike_ - t_spike ) / tau_Delta_ ) * PI_exp_integral_ + dPI_exp_integral );
254 weight_ = PI_integral_ - PI_exp_integral_;
255 weight_ = init_weight_ + weight_ * 15.0 * C_m * tau_s * eta_ / ( g_L * ( tau_L - tau_s ) );
257 if ( weight_ > Wmax_ )
261 else if ( weight_ < Wmin_ )
266 e.set_receiver( *target );
267 e.set_weight( weight_ );
269 e.set_delay_steps( get_delay_steps() );
270 e.set_rport( get_rport() );
274 tau_L_trace_ = tau_L_trace_ * std::exp( ( t_lastspike_ - t_spike ) / tau_L ) + 1.0;
275 tau_s_trace_ = tau_s_trace_ * std::exp( ( t_lastspike_ - t_spike ) / tau_s ) + 1.0;
277 t_lastspike_ = t_spike;
283template <
typename target
identifierT >
287 , init_weight_( 1.0 )
288 , tau_Delta_( 100.0 )
292 , PI_integral_( 0.0 )
293 , PI_exp_integral_( 0.0 )
294 , tau_L_trace_( 0.0 )
295 , tau_s_trace_( 0.0 )
296 , t_lastspike_( -1.0 )
300template <
typename target
identifierT >
304 ConnectionBase::get_status( d );
313template <
typename target
identifierT >
317 ConnectionBase::set_status( d, cm );
324 init_weight_ = weight_;
326 if ( std::signbit( weight_ ) != std::signbit( Wmax_ ) )
328 throw BadProperty(
"Weight and Wmin must have same sign." );
332 if ( not( ( ( weight_ >= 0 ) - ( weight_ < 0 ) ) == ( ( Wmax_ > 0 ) - ( Wmax_ <= 0 ) ) ) )
334 throw BadProperty(
"Weight and Wmax must have same sign." );
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Exception to be thrown if a status parameter is incomplete or inconsistent.
Definition exceptions.h:680
Class containing the common properties for all connections of a certain type.
Definition common_synapse_properties.h:50
Base class for dummy nodes used in connection testing.
Definition connection.h:67
Base class for representing connections.
Definition connection.h:110
void check_connection_(Node &dummy_target, Node &source, Node &target, const size_t receptor_type)
This function calls check_connection() on the sender to check if the receiver accepts the event type ...
Definition connection.h:319
long get_delay_steps() const
Return the delay of the connection in steps.
Definition connection.h:181
Node * get_target(const size_t tid) const
Definition connection.h:239
size_t get_rport() const
Definition connection.h:244
double get_delay() const
Return the delay of the connection in ms.
Definition connection.h:172
Definition connector_model.h:69
Encapsulate information sent between nodes.
Definition event.h:103
Base class for all NEST network objects.
Definition node.h:99
virtual void register_stdp_connection(double, double)
Register a STDP connection.
Definition node.cpp:211
Event for spike information.
Definition event.h:418
Definition urbanczik_synapse.h:163
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition urbanczik_synapse.h:169
Definition urbanczik_synapse.h:110
double tau_L_trace_
Definition urbanczik_synapse.h:201
void check_connection(Node &s, Node &t, size_t receptor_type, const CommonPropertiesType &)
Definition urbanczik_synapse.h:176
double weight_
Definition urbanczik_synapse.h:193
Connection< targetidentifierT > ConnectionBase
Definition urbanczik_synapse.h:114
double eta_
Definition urbanczik_synapse.h:196
static constexpr ConnectionModelProperties properties
Definition urbanczik_synapse.h:116
double Wmax_
Definition urbanczik_synapse.h:198
urbanczik_synapse()
Default Constructor.
Definition urbanczik_synapse.h:284
void set_status(const Dictionary &d, ConnectorModel &cm)
Set properties of this connection from the values given in dictionary.
Definition urbanczik_synapse.h:315
double PI_exp_integral_
Definition urbanczik_synapse.h:200
double PI_integral_
Definition urbanczik_synapse.h:199
urbanczik_synapse & operator=(const urbanczik_synapse &)=default
double t_lastspike_
Definition urbanczik_synapse.h:204
double get_delay() const
Return the delay of the connection in ms.
Definition connection.h:172
double tau_Delta_
Definition urbanczik_synapse.h:195
double tau_s_trace_
Definition urbanczik_synapse.h:202
urbanczik_synapse(const urbanczik_synapse &)=default
Copy constructor.
bool send(Event &e, size_t t, const CommonSynapseProperties &cp)
Send an event to the receiver of this connection.
Definition urbanczik_synapse.h:218
double init_weight_
Definition urbanczik_synapse.h:194
void set_weight(double w)
Definition urbanczik_synapse.h:186
CommonSynapseProperties CommonPropertiesType
Definition urbanczik_synapse.h:113
void get_status(Dictionary &d) const
Get all properties of this connection and put them into a dictionary.
Definition urbanczik_synapse.h:302
double Wmin_
Definition urbanczik_synapse.h:197
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
const std::string eta("eta")
const std::string Wmin("Wmin")
const std::string weight("weight")
const std::string size_of("sizeof")
const std::string tau_Delta("tau_Delta")
const std::string Wmax("Wmax")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
void register_urbanczik_synapse(const std::string &name)
Definition urbanczik_synapse.cpp:32
ConnectionModelProperties
Definition connector_model.h:49
@ REQUIRES_URBANCZIK_ARCHIVING
constexpr size_t invalid_port
Value for invalid connection port number.
Definition nest_types.h:141