23#ifndef CLOPATH_SYNAPSE_H
24#define CLOPATH_SYNAPSE_H
109template <
typename target
identifierT >
217template <
typename target
identifierT >
226template <
typename target
identifierT >
230 double t_spike = e.get_stamp().get_ms();
233 Node* target = get_target( t );
234 double dendritic_delay = get_delay();
237 std::deque< histentry_extended >::iterator start;
238 std::deque< histentry_extended >::iterator finish;
248 target->get_LTP_history( t_lastspike_ - dendritic_delay, t_spike - dendritic_delay, &start, &finish );
249 while ( start != finish )
251 const double minus_dt = t_lastspike_ - ( start->t_ + dendritic_delay );
254 weight_ = facilitate_( weight_, start->dw_, x_bar_ * exp( minus_dt / tau_x_ ) );
260 weight_ = depress_( weight_, target->get_LTD_value( t_spike - dendritic_delay ) );
262 e.set_receiver( *target );
263 e.set_weight( weight_ );
266 e.set_delay_steps( get_delay_steps() );
267 e.set_rport( get_rport() );
271 x_bar_ = x_bar_ * std::exp( ( t_lastspike_ - t_spike ) / tau_x_ ) + 1.0 / tau_x_;
273 t_lastspike_ = t_spike;
279template <
typename target
identifierT >
287 , t_lastspike_( 0.0 )
291template <
typename target
identifierT >
295 ConnectionBase::get_status( d );
304template <
typename target
identifierT >
308 ConnectionBase::set_status( d, cm );
316 if ( not( ( ( weight_ >= 0 ) - ( weight_ < 0 ) ) == ( ( Wmin_ >= 0 ) - ( Wmin_ < 0 ) ) ) )
318 throw BadProperty(
"Weight and Wmin must have same sign." );
322 if ( not( ( ( weight_ >= 0 ) - ( weight_ < 0 ) ) == ( ( Wmax_ > 0 ) - ( Wmax_ <= 0 ) ) ) )
324 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 clopath_synapse.h:164
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition clopath_synapse.h:170
Definition clopath_synapse.h:111
double tau_x_
Definition clopath_synapse.h:210
clopath_synapse(const clopath_synapse &)=default
Copy constructor.
double depress_(double w, double dw)
Definition clopath_synapse.h:194
void check_connection(Node &s, Node &t, size_t receptor_type, const CommonPropertiesType &)
Definition clopath_synapse.h:177
Connection< targetidentifierT > ConnectionBase
Definition clopath_synapse.h:115
void get_status(Dictionary &d) const
Get all properties of this connection and put them into a dictionary.
Definition clopath_synapse.h:293
bool send(Event &e, size_t t, const CommonSynapseProperties &cp)
Send an event to the receiver of this connection.
Definition clopath_synapse.h:228
CommonSynapseProperties CommonPropertiesType
Definition clopath_synapse.h:114
double weight_
Definition clopath_synapse.h:208
double get_delay() const
Return the delay of the connection in ms.
Definition connection.h:172
double x_bar_
Definition clopath_synapse.h:209
double Wmax_
Definition clopath_synapse.h:212
double t_lastspike_
Definition clopath_synapse.h:214
clopath_synapse()
Default Constructor.
Definition clopath_synapse.h:280
void set_status(const Dictionary &d, ConnectorModel &cm)
Set properties of this connection from the values given in dictionary.
Definition clopath_synapse.h:306
double Wmin_
Definition clopath_synapse.h:211
double facilitate_(double w, double dw, double x_bar)
Definition clopath_synapse.h:201
void set_weight(double w)
Definition clopath_synapse.h:187
static constexpr ConnectionModelProperties properties
Definition clopath_synapse.h:117
clopath_synapse & operator=(const clopath_synapse &)=default
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 x_bar("x_bar")
const std::string Wmin("Wmin")
const std::string tau_x("tau_x")
const std::string weight("weight")
const std::string size_of("sizeof")
const std::string Wmax("Wmax")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
void register_clopath_synapse(const std::string &name)
Definition clopath_synapse.cpp:32
ConnectionModelProperties
Definition connector_model.h:49
@ REQUIRES_CLOPATH_ARCHIVING
constexpr size_t invalid_port
Value for invalid connection port number.
Definition nest_types.h:141