23#ifndef STDP_PL_SYNAPSE_HOM_AX_DELAY_H
24#define STDP_PL_SYNAPSE_HOM_AX_DELAY_H
129template <
typename target
identifierT >
189 const double t_spike_critical_interval_end,
190 const double t_post_spike,
222 if (
kernel().sp_manager.is_structural_plasticity_enabled() )
224 throw IllegalConnection(
"Structural plasticity is not supported in combination with axonal delays." );
233 throw BadProperty(
"Combination of axonal and dendritic delay has to be more than 0." );
243 "Target model does not support synapses with predominantly axonal delay, i.e., with an axonal "
244 "delay of at least the dendritic delay." );
269 return w + ( cp.
lambda_ * std::pow( w, cp.
mu_ ) * kplus );
276 return new_w > 0.0 ? new_w : 0.0;
285template <
typename target
identifierT >
289template <
typename target
identifierT >
298 const double t_spike = e.get_stamp().get_ms();
304 std::deque< histentry >::iterator start;
305 std::deque< histentry >::iterator finish;
306 target->get_history(
t_lastspike_ - dendritic_delay_ms + axonal_delay_ms,
307 t_spike - dendritic_delay_ms + axonal_delay_ms,
313 const double K_plus_revert =
Kplus_;
316 double minus_dt = 0.;
317 while ( start != finish )
319 minus_dt =
t_lastspike_ + axonal_delay_ms - ( start->t_ + dendritic_delay_ms );
322 assert( minus_dt < -1.0 *
kernel().connection_manager.get_stdp_eps() );
329 const double weight_revert =
weight_;
332 const double K_minus = target->get_K_value( t_spike + axonal_delay_ms - dendritic_delay_ms );
335 e.set_receiver( *target );
347 if ( axonal_delay_ms >= dendritic_delay_ms )
350 const long time_while_critical =
354 if ( time_while_critical > 0 )
368template <
typename target
identifierT >
377template <
typename target
identifierT >
391template <
typename target
identifierT >
400template <
typename target
identifierT >
404 const double t_spike_critical_interval_end,
405 const double t_post_spike,
408 const double wrong_weight =
weight_;
413 const size_t lcid = entry.
get_lcid();
421 const double t_spike = t_spike_critical_interval_end + dendritic_delay_ms - axonal_delay_ms;
424 const double minus_dt = t_last_spike + axonal_delay_ms - ( t_post_spike + dendritic_delay_ms );
427 if ( minus_dt < -1.0 *
kernel().connection_manager.get_stdp_eps() )
442 const double K_minus = target->get_K_value( t_spike + axonal_delay_ms - dendritic_delay_ms );
449 e.set_receiver( *target );
450 e.set_weight( wrong_weight );
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
A node which buffers the information needed to retrospectively correct incoming STDP synapses with pr...
Definition axonal_delay_archiving_node.h:181
void update_weight_revert(const size_t lcid, const double weight_revert)
In case a correction is applied for a pre-synaptic spike, any other pre-synaptic spikes from the same...
Definition axonal_delay_archiving_node.cpp:150
void add_correction_entry_stdp_ax_delay(SpikeEvent &spike_event, const double t_last_pre_spike, const double weight_revert, const double new_weight, const double K_plus_revert, const double time_while_critical)
Buffer a correction entry for the critical time window.
Definition axonal_delay_archiving_node.cpp:67
Exception to be thrown if a status parameter is incomplete or inconsistent.
Definition exceptions.h:680
CommonSynapseProperties()
Standard constructor.
Definition common_synapse_properties.cpp:36
Base class for dummy nodes used in connection testing.
Definition connection.h:70
void get_status(Dictionary &d) const
size_t get_rport() const
Definition connection.h:316
long get_delay_steps() const
Definition connection.h:271
double get_axonal_delay_ms() const
Definition connection.h:235
void set_status(const Dictionary &d, ConnectorModel &cm)
long get_dendritic_delay_steps() const
Definition connection.h:199
Connection()
Definition connection.h:124
Node * get_target(const size_t tid) const
Definition connection.h:311
double get_axonal_delay_steps() const
Definition connection.h:253
double get_dendritic_delay_ms() const
Definition connection.h:190
void check_connection_(Node &dummy_target, Node &source, Node &target, const synindex syn_id, const size_t receptor_type)
Definition connector_model.h:69
Information on a received pre-synaptic spike which is buffered by an AxonalDelayArchivingNode,...
Definition axonal_delay_archiving_node.h:46
double get_K_plus_revert() const
Pre-synaptic trace before the possibly incorrect facilitation.
Definition axonal_delay_archiving_node.h:114
size_t get_lcid() const
Local connection index of the synapse which transmitted the spike.
Definition axonal_delay_archiving_node.h:67
void set_new_weight(const double new_weight)
Definition axonal_delay_archiving_node.h:107
double get_weight_revert() const
Synaptic weight to revert to (STDP depression needs to be undone) before a correction.
Definition axonal_delay_archiving_node.h:88
double get_t_last_pre_spike() const
Time of the last pre-synaptic spike before this spike.
Definition axonal_delay_archiving_node.h:81
Encapsulate information sent between nodes.
Definition event.h:103
To be thrown if a connection is not possible.
Definition exceptions.h:490
Base class for all NEST network objects.
Definition node.h:99
virtual bool supports_axonal_delay_corrections() const
Whether this model can be the target of a synapse with predominantly axonal delay.
Definition node.cpp:217
virtual void register_stdp_connection(double, double, double)
Register a STDP connection.
Definition node.cpp:211
Class containing the common properties for all synapses of type stdp_pl_synapse_hom_ax_delay.
Definition stdp_pl_synapse_hom_ax_delay.h:96
double tau_plus_
Definition stdp_pl_synapse_hom_ax_delay.h:116
STDPPLHomAxDelayCommonProperties()
Default constructor.
Definition stdp_pl_synapse_hom_ax_delay.cpp:44
double lambda_
Definition stdp_pl_synapse_hom_ax_delay.h:118
double mu_
Definition stdp_pl_synapse_hom_ax_delay.h:120
double alpha_
Definition stdp_pl_synapse_hom_ax_delay.h:119
void get_status(Dictionary &d) const
Get all properties and put them into a dictionary.
Definition stdp_pl_synapse_hom_ax_delay.cpp:55
double tau_plus_inv_
1 / tau_plus for efficiency
Definition stdp_pl_synapse_hom_ax_delay.h:117
void set_status(const Dictionary &d, ConnectorModel &cm)
Set properties from the values given in dictionary.
Definition stdp_pl_synapse_hom_ax_delay.cpp:66
Event for spike information.
Definition event.h:420
Definition stdp_pl_synapse_hom_ax_delay.h:194
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition stdp_pl_synapse_hom_ax_delay.h:200
void check_connection(Node &s, Node &t, const size_t receptor_type, const synindex syn_id, const CommonPropertiesType &)
Definition stdp_pl_synapse_hom_ax_delay.h:220
double get_dendritic_delay_ms() const
Return the proportion of the transmission delay attributed to the dendrite.
Definition connection.h:190
size_t get_rport() const
Definition connection.h:316
long get_delay_steps() const
Return the delay of the connection in steps.
Definition connection.h:271
stdp_pl_synapse_hom_ax_delay & operator=(const stdp_pl_synapse_hom_ax_delay &)=default
double facilitate_(double w, double kplus, const STDPPLHomAxDelayCommonProperties &cp)
Definition stdp_pl_synapse_hom_ax_delay.h:267
Connection< targetidentifierT, AxonalDendriticDelay > ConnectionBase
Definition stdp_pl_synapse_hom_ax_delay.h:135
void set_status(const Dictionary &d, ConnectorModel &cm)
Set properties of this connection from the values given in dictionary.
Definition stdp_pl_synapse_hom_ax_delay.h:393
bool send(Event &e, size_t t, const STDPPLHomAxDelayCommonProperties &)
Send an event to the receiver of this connection.
Definition stdp_pl_synapse_hom_ax_delay.h:291
long get_dendritic_delay_steps() const
Return the proportion of the transmission delay attributed to the dendrite.
Definition connection.h:199
void set_weight(double w)
Definition stdp_pl_synapse_hom_ax_delay.h:260
double get_axonal_delay_ms() const
Get the proportion of the transmission delay attributed to the axon.
Definition connection.h:235
void get_status(Dictionary &d) const
Get all properties of this connection and put them into a dictionary.
Definition stdp_pl_synapse_hom_ax_delay.h:379
double Kplus_
Definition stdp_pl_synapse_hom_ax_delay.h:281
static constexpr ConnectionModelProperties properties
Definition stdp_pl_synapse_hom_ax_delay.h:137
STDPPLHomAxDelayCommonProperties CommonPropertiesType
Definition stdp_pl_synapse_hom_ax_delay.h:134
stdp_pl_synapse_hom_ax_delay(const stdp_pl_synapse_hom_ax_delay &)=default
Copy constructor from a property object.
void correct_weight_stdp_ax_delay(const size_t tid, CorrectionEntrySTDPAxDelay &entry, const double t_spike_critical_interval_end, const double t_post_spike, const STDPPLHomAxDelayCommonProperties &cp)
Framework for STDP with predominantly axonal delays: Correct this synapse and the corresponding previ...
Definition stdp_pl_synapse_hom_ax_delay.h:402
Node * get_target(const size_t tid) const
Definition connection.h:311
stdp_pl_synapse_hom_ax_delay()
Default Constructor.
Definition stdp_pl_synapse_hom_ax_delay.h:369
double t_lastspike_
Definition stdp_pl_synapse_hom_ax_delay.h:282
double weight_
Definition stdp_pl_synapse_hom_ax_delay.h:280
double depress_(double w, double kminus, const STDPPLHomAxDelayCommonProperties &cp)
Definition stdp_pl_synapse_hom_ax_delay.h:273
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:282
const std::string Kplus("Kplus")
const std::string weight("weight")
const std::string size_of("sizeof")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
KernelManager & kernel()
Definition kernel_manager.h:311
ConnectionModelProperties
Definition connector_model.h:49
@ HAS_DELAY
Definition connector_model.h:54
@ SUPPORTS_LBL
Definition connector_model.h:52
@ SUPPORTS_HPC
Definition connector_model.h:51
@ IS_PRIMARY
Definition connector_model.h:53
void register_stdp_pl_synapse_hom_ax_delay(const std::string &name)
Class representing an STDP connection with homogeneous parameters, i.e.
Definition stdp_pl_synapse_hom_ax_delay.cpp:32
constexpr size_t invalid_port
Value for invalid connection port number.
Definition nest_types.h:147
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:121
Definition nest_time.h:264