NEST main@caf0ae8
 
Loading...
Searching...
No Matches
static_synapse.h
Go to the documentation of this file.
1/*
2 * static_synapse.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 STATICSYNAPSE_H
24#define STATICSYNAPSE_H
25
26// Includes from nestkernel:
27#include "connection.h"
28
29namespace nest
30{
31
32/* BeginUserDocs: synapse, chemical, static
33
34Short description
35+++++++++++++++++
36
37Synapse type for static connections
38
39Description
40+++++++++++
41
42``static_synapse`` does not support any kind of plasticity. It simply stores
43the parameters target, weight, delay and receiver port for each connection.
44
45Transmits
46+++++++++
47
48SpikeEvent, RateEvent, CurrentEvent, ConductanceEvent,
49DoubleDataEvent, DataLoggingRequest
50
51See also
52++++++++
53
54tsodyks_synapse, stdp_synapse
55
56Examples using this model
57+++++++++++++++++++++++++
58
59.. listexamples:: static_synapse
60
61EndUserDocs */
62
63void register_static_synapse( const std::string& name );
64
65template < typename targetidentifierT >
66class static_synapse : public Connection< targetidentifierT >
67{
68 double weight_;
69
70public:
71 // this line determines which common properties to use
74
78
85 , weight_( 1.0 )
86 {
87 }
88
93 static_synapse( const static_synapse& rhs ) = default;
94 static_synapse& operator=( const static_synapse& rhs ) = default;
95
96 // Explicitly declare all methods inherited from the dependent base
97 // ConnectionBase. This avoids explicit name prefixes in all places these
98 // functions are used. Since ConnectionBase depends on the template parameter,
99 // they are not automatically found in the base class.
103
104
106 {
107 public:
108 // Ensure proper overriding of overloaded virtual functions.
109 // Return values from functions are ignored.
111 size_t
112 handles_test_event( SpikeEvent&, size_t ) override
113 {
114 return invalid_port;
115 }
116 size_t
117 handles_test_event( RateEvent&, size_t ) override
118 {
119 return invalid_port;
120 }
121 size_t
123 {
124 return invalid_port;
125 }
126 size_t
127 handles_test_event( CurrentEvent&, size_t ) override
128 {
129 return invalid_port;
130 }
131 size_t
133 {
134 return invalid_port;
135 }
136 size_t
138 {
139 return invalid_port;
140 }
141 size_t
142 handles_test_event( DSSpikeEvent&, size_t ) override
143 {
144 return invalid_port;
145 }
146 size_t
148 {
149 return invalid_port;
150 }
151 };
152
153 void
154 check_connection( Node& s, Node& t, size_t receptor_type, const CommonPropertiesType& )
155 {
156 ConnTestDummyNode dummy_target;
157 ConnectionBase::check_connection_( dummy_target, s, t, receptor_type );
158 }
159
160 bool
161 send( Event& e, const size_t tid, const CommonSynapseProperties& )
162 {
163 e.set_weight( weight_ );
164 e.set_delay_steps( get_delay_steps() );
165 e.set_receiver( *get_target( tid ) );
166 e.set_rport( get_rport() );
167 e();
168 return true;
169 }
170
171 void get_status( Dictionary& d ) const;
172
173 void set_status( const Dictionary& d, ConnectorModel& cm );
174
175 void
176 set_weight( double w )
177 {
178 weight_ = w;
179 }
180};
181
182template < typename targetidentifierT >
184
185template < typename targetidentifierT >
186void
188{
189
190 ConnectionBase::get_status( d );
191 d[ names::weight ] = weight_;
192 d[ names::size_of ] = static_cast< long >( sizeof( *this ) );
193}
194
195template < typename targetidentifierT >
196void
198{
199 ConnectionBase::set_status( d, cm );
200 d.update_value( names::weight, weight_ );
201}
202
203} // namespace
204
205#endif /* #ifndef STATICSYNAPSE_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
Event for electrical conductances.
Definition event.h:809
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
Definition connector_model.h:69
Event for electrical currents.
Definition event.h:569
"Callback request event" for use in Device.
Definition event.h:615
"Callback request event" for use in Device.
Definition event.h:521
Request data to be logged/logged data to be sent.
Definition event.h:636
Definition event.h:880
Encapsulate information sent between nodes.
Definition event.h:103
Base class for all NEST network objects.
Definition node.h:99
Event for firing rate information.
Definition event.h:535
Event for spike information.
Definition event.h:418
Definition static_synapse.h:106
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition static_synapse.h:112
size_t handles_test_event(DSSpikeEvent &, size_t) override
Definition static_synapse.h:142
size_t handles_test_event(DataLoggingRequest &, size_t) override
Definition static_synapse.h:122
size_t handles_test_event(DoubleDataEvent &, size_t) override
Definition static_synapse.h:137
size_t handles_test_event(RateEvent &, size_t) override
Definition static_synapse.h:117
size_t handles_test_event(CurrentEvent &, size_t) override
Definition static_synapse.h:127
size_t handles_test_event(ConductanceEvent &, size_t) override
Definition static_synapse.h:132
size_t handles_test_event(DSCurrentEvent &, size_t) override
Definition static_synapse.h:147
Definition static_synapse.h:67
CommonSynapseProperties CommonPropertiesType
Definition static_synapse.h:72
bool send(Event &e, const size_t tid, const CommonSynapseProperties &)
Definition static_synapse.h:161
long get_delay_steps() const
Return the delay of the connection in steps.
Definition connection.h:181
void set_status(const Dictionary &d, ConnectorModel &cm)
Definition static_synapse.h:197
Connection< targetidentifierT > ConnectionBase
Definition static_synapse.h:73
Node * get_target(const size_t tid) const
Definition connection.h:239
double weight_
Definition static_synapse.h:68
void get_status(Dictionary &d) const
Definition static_synapse.h:187
size_t get_rport() const
Definition connection.h:244
static_synapse(const static_synapse &rhs)=default
Copy constructor from a property object.
void set_weight(double w)
Definition static_synapse.h:176
static_synapse & operator=(const static_synapse &rhs)=default
void check_connection(Node &s, Node &t, size_t receptor_type, const CommonPropertiesType &)
Definition static_synapse.h:154
static_synapse()
Default Constructor.
Definition static_synapse.h:83
static constexpr ConnectionModelProperties properties
Definition static_synapse.h:75
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 weight("weight")
const std::string size_of("sizeof")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
void register_static_synapse(const std::string &name)
Definition static_synapse.cpp:32
ConnectionModelProperties
Definition connector_model.h:49
constexpr size_t invalid_port
Value for invalid connection port number.
Definition nest_types.h:141