NEST main@caf0ae8
 
Loading...
Searching...
No Matches
rate_connection_delayed.h
Go to the documentation of this file.
1/*
2 * rate_connection_delayed.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
24#ifndef RATE_CONNECTION_DELAYED_H
25#define RATE_CONNECTION_DELAYED_H
26
27#include "connection.h"
28
29namespace nest
30{
31
32/* BeginUserDocs: synapse, abstract, rate
33
34Short description
35+++++++++++++++++
36
37Synapse type for rate connections with delay
38
39Description
40+++++++++++
41
42``rate_connection_delayed`` is a connector to create connections with delay
43between rate model neurons.
44
45To create instantaneous rate connections please use
46the synapse type ``rate_connection_instantaneous``.
47
48See also :footcite:p:`Hahne2017`.
49
50Transmits
51+++++++++
52
53DelayedRateConnectionEvent
54
55References
56++++++++++
57
58.. footbibliography::
59
60See also
61++++++++
62
63rate_connection_instantaneous, rate_neuron_ipn, rate_neuron_opn
64
65Examples using this model
66+++++++++++++++++++++++++
67
68.. listexamples:: rate_connection_delayed
69
70EndUserDocs */
71
76void register_rate_connection_delayed( const std::string& name );
77
78template < typename targetidentifierT >
79class rate_connection_delayed : public Connection< targetidentifierT >
80{
81
82public:
83 // this line determines which common properties to use
86
88
95 , weight_( 1.0 )
96 {
97 }
98
99 std::unique_ptr< SecondaryEvent > get_secondary_event();
100
101 // Explicitly declare all methods inherited from the dependent base
102 // ConnectionBase.
103 // This avoids explicit name prefixes in all places these functions are used.
104 // Since ConnectionBase depends on the template parameter, they are not
105 // automatically
106 // found in the base class.
110
111 void
112 check_connection( Node& s, Node& t, size_t receptor_type, const CommonPropertiesType& )
113 {
115
116 s.sends_secondary_event( ge );
117 ge.set_sender( s );
118 Connection< targetidentifierT >::target_.set_rport( t.handles_test_event( ge, receptor_type ) );
120 }
121
127 bool
128 send( Event& e, size_t t, const CommonSynapseProperties& )
129 {
130 e.set_weight( weight_ );
131 e.set_delay_steps( get_delay_steps() );
132 e.set_receiver( *get_target( t ) );
133 e.set_rport( get_rport() );
134 e();
135
136 return true;
137 }
138
139 void get_status( Dictionary& d ) const;
140
141 void set_status( const Dictionary& d, ConnectorModel& cm );
142
143 void
144 set_weight( double w )
145 {
146 weight_ = w;
147 }
148
149private:
150 double weight_;
151};
152
153template < typename targetidentifierT >
155
156template < typename targetidentifierT >
157void
159{
160 ConnectionBase::get_status( d );
161 d[ names::weight ] = weight_;
162 d[ names::size_of ] = static_cast< long >( sizeof( *this ) );
163}
164
165template < typename targetidentifierT >
166void
168{
169 ConnectionBase::set_status( d, cm );
170 d.update_value( names::weight, weight_ );
171}
172
173template < typename targetidentifierT >
174std::unique_ptr< SecondaryEvent >
176{
177 return std::make_unique< DelayedRateConnectionEvent >();
178}
179
180} // namespace
181
182#endif /* #ifndef RATE_CONNECTION_DELAYED_H */
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Class containing the common properties for all connections of a certain type.
Definition common_synapse_properties.h:50
Base class for representing connections.
Definition connection.h:110
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
Definition connector_model.h:69
Event for rate model connections with delay.
Definition secondary_event.h:331
Encapsulate information sent between nodes.
Definition event.h:103
void set_sender(Node &)
Change pointer to sending Node.
Definition event.h:920
Base class for all NEST network objects.
Definition node.h:99
Definition rate_connection_delayed.h:80
CommonSynapseProperties CommonPropertiesType
Definition rate_connection_delayed.h:84
long get_delay_steps() const
Return the delay of the connection in steps.
Definition connection.h:181
Connection< targetidentifierT > ConnectionBase
Definition rate_connection_delayed.h:85
Node * get_target(const size_t tid) const
Definition connection.h:239
rate_connection_delayed()
Default Constructor.
Definition rate_connection_delayed.h:93
size_t get_rport() const
Definition connection.h:244
void check_connection(Node &s, Node &t, size_t receptor_type, const CommonPropertiesType &)
Definition rate_connection_delayed.h:112
static constexpr ConnectionModelProperties properties
Definition rate_connection_delayed.h:87
void get_status(Dictionary &d) const
Definition rate_connection_delayed.h:158
std::unique_ptr< SecondaryEvent > get_secondary_event()
Definition rate_connection_delayed.h:175
void set_status(const Dictionary &d, ConnectorModel &cm)
Definition rate_connection_delayed.h:167
bool send(Event &e, size_t t, const CommonSynapseProperties &)
Send an event to the receiver of this connection.
Definition rate_connection_delayed.h:128
void set_weight(double w)
Definition rate_connection_delayed.h:144
double weight_
connection weight
Definition rate_connection_delayed.h:150
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
virtual void sends_secondary_event(GapJunctionEvent &ge)
Required to check, if source neuron may send a SecondaryEvent.
Definition node.cpp:381
const std::string weight("weight")
const std::string size_of("sizeof")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
void register_rate_connection_delayed(const std::string &name)
Class representing a delayed rate connection.
Definition rate_connection_delayed.cpp:32
ConnectionModelProperties
Definition connector_model.h:49