NEST main@caf0ae8
 
Loading...
Searching...
No Matches
static_synapse_hom_w.h
Go to the documentation of this file.
1/*
2 * static_synapse_hom_w.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_HOM_W_H
24#define STATICSYNAPSE_HOM_W_H
25
26// Includes from nestkernel:
28#include "connection.h"
29
30namespace nest
31{
32
33/* BeginUserDocs: synapse, chemical, static
34
35Short description
36+++++++++++++++++
37
38Synapse type for static connections with homogeneous weight
39
40Description
41+++++++++++
42
43``static_synapse_hom_w`` does not support any kind of plasticity. It simply
44stores the parameters delay, target, and receiver port for each connection
45and uses a common weight for all connections.
46
47The common weight for all connections of this model must be set by
48``SetDefaults`` on the model. If you create copies of this model using
49``CopyModel``, each derived model can have a different weight.
50
51Transmits
52+++++++++
53
54SpikeEvent, RateEvent, CurrentEvent, ConductanceEvent,
55DataLoggingRequest, DoubleDataEvent
56
57See also
58++++++++
59
60static_synapse
61
62Examples using this model
63+++++++++++++++++++++++++
64
65.. listexamples:: static_synapse_hom_w
66
67EndUserDocs */
68
69void register_static_synapse_hom_w( const std::string& name );
70
71template < typename targetidentifierT >
72class static_synapse_hom_w : public Connection< targetidentifierT >
73{
74
75public:
76 // this line determines which common properties to use
79
80 // Explicitly declare all methods inherited from the dependent base
81 // ConnectionBase. This avoids explicit name prefixes in all places these
82 // functions are used. Since ConnectionBase depends on the template parameter,
83 // they are not automatically found in the base class.
87
91
93 {
94 public:
95 // Ensure proper overriding of overloaded virtual functions.
96 // Return values from functions are ignored.
98 size_t
99 handles_test_event( SpikeEvent&, size_t ) override
100 {
101 return invalid_port;
102 }
103 size_t
104 handles_test_event( RateEvent&, size_t ) override
105 {
106 return invalid_port;
107 }
108 size_t
110 {
111 return invalid_port;
112 }
113 size_t
114 handles_test_event( CurrentEvent&, size_t ) override
115 {
116 return invalid_port;
117 }
118 size_t
120 {
121 return invalid_port;
122 }
123 size_t
125 {
126 return invalid_port;
127 }
128 size_t
129 handles_test_event( DSSpikeEvent&, size_t ) override
130 {
131 return invalid_port;
132 }
133 size_t
135 {
136 return invalid_port;
137 }
138 };
139
140 void get_status( Dictionary& d ) const;
141
142 void
143 check_connection( Node& s, Node& t, size_t receptor_type, const CommonPropertiesType& )
144 {
145 ConnTestDummyNode dummy_target;
146 ConnectionBase::check_connection_( dummy_target, s, t, receptor_type );
147 }
148
152 void
153 check_synapse_params( const Dictionary& syn_spec ) const
154 {
155 if ( syn_spec.known( names::weight ) )
156 {
157 throw BadProperty(
158 "Weight cannot be specified since it needs to be equal "
159 "for all connections when static_synapse_hom_w is used." );
160 }
161 }
162
169 bool
170 send( Event& e, const size_t tid, const CommonPropertiesHomW& cp )
171 {
172 e.set_weight( cp.get_weight() );
173 e.set_delay_steps( get_delay_steps() );
174 e.set_receiver( *get_target( tid ) );
175 e.set_rport( get_rport() );
176 e();
177
178 return true;
179 }
180
181 void
182 set_weight( double )
183 {
184 throw BadProperty(
185 "Setting of individual weights is not possible! The common weights can "
186 "be changed via "
187 "CopyModel()." );
188 }
189};
190
191template < typename targetidentifierT >
193
194template < typename targetidentifierT >
195void
197{
198 ConnectionBase::get_status( d );
199 d[ names::size_of ] = static_cast< long >( sizeof( *this ) );
200}
201
202} // namespace
203
204#endif /* #ifndef STATICSYNAPSE_HOM_W_H */
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
bool known(const std::string &key) const
Check whether there exists a value with specified key in the dictionary.
Definition dictionary.h:677
Exception to be thrown if a status parameter is incomplete or inconsistent.
Definition exceptions.h:680
Class containing the common properties for all synapses with common weight.
Definition common_properties_hom_w.h:36
double get_weight() const
Definition common_properties_hom_w.h:52
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
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_hom_w.h:93
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition static_synapse_hom_w.h:99
size_t handles_test_event(RateEvent &, size_t) override
Definition static_synapse_hom_w.h:104
size_t handles_test_event(ConductanceEvent &, size_t) override
Definition static_synapse_hom_w.h:119
size_t handles_test_event(DoubleDataEvent &, size_t) override
Definition static_synapse_hom_w.h:124
size_t handles_test_event(DSSpikeEvent &, size_t) override
Definition static_synapse_hom_w.h:129
size_t handles_test_event(CurrentEvent &, size_t) override
Definition static_synapse_hom_w.h:114
size_t handles_test_event(DSCurrentEvent &, size_t) override
Definition static_synapse_hom_w.h:134
size_t handles_test_event(DataLoggingRequest &, size_t) override
Definition static_synapse_hom_w.h:109
Definition static_synapse_hom_w.h:73
void check_connection(Node &s, Node &t, size_t receptor_type, const CommonPropertiesType &)
Definition static_synapse_hom_w.h:143
CommonPropertiesHomW CommonPropertiesType
Definition static_synapse_hom_w.h:77
static constexpr ConnectionModelProperties properties
Definition static_synapse_hom_w.h:88
long get_delay_steps() const
Return the delay of the connection in steps.
Definition connection.h:181
void check_synapse_params(const Dictionary &syn_spec) const
Checks to see if weight is given in syn_spec.
Definition static_synapse_hom_w.h:153
Node * get_target(const size_t tid) const
Definition connection.h:239
Connection< targetidentifierT > ConnectionBase
Definition static_synapse_hom_w.h:78
size_t get_rport() const
Definition connection.h:244
void set_weight(double)
Definition static_synapse_hom_w.h:182
bool send(Event &e, const size_t tid, const CommonPropertiesHomW &cp)
Send an event to the receiver of this connection.
Definition static_synapse_hom_w.h:170
void get_status(Dictionary &d) const
Definition static_synapse_hom_w.h:196
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_hom_w(const std::string &name)
Definition static_synapse_hom_w.cpp:32
ConnectionModelProperties
Definition connector_model.h:49
constexpr size_t invalid_port
Value for invalid connection port number.
Definition nest_types.h:141