NEST main@f146f75
Loading...
Searching...
No Matches
gap_junction.h
Go to the documentation of this file.
1/*
2 * gap_junction.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 GAP_JUNCTION_H
24#define GAP_JUNCTION_H
25
26#include "connection.h"
27
28namespace nest
29{
30
31/* BeginUserDocs: synapse, electrical
32
33Short description
34+++++++++++++++++
35
36Synapse type for gap-junction connections
37
38Description
39+++++++++++
40
41``gap_junction`` is a connector to create gap junctions between pairs of
42neurons. Gap junctions are bidirectional connections. In order to
43create one accurate gap-junction connection between neurons i and j
44two NEST connections are required: For each created connection a
45second connection with the exact same parameters in the opposite
46direction is required. NEST provides the possibility to create both
47connections with a single call to Connect via the make_symmetric flag.
48
49The value of the parameter ``delay`` is ignored for connections of
50type ``gap_junction``.
51
52See also :footcite:p:`Hahne2015`, :footcite:p:`Mancilla2007`.
53
54Sends
55+++++
56
57GapJunctionEvent
58
59References
60++++++++++
61
62.. footbibliography::
63
64See also
65++++++++
66
67hh_psc_alpha_gap
68
69Examples using this model
70+++++++++++++++++++++++++
71
72.. listexamples:: gap_junction
73
74EndUserDocs */
75
76void register_gap_junction( const std::string& name );
77
78template < typename targetidentifierT >
79class gap_junction : public Connection< targetidentifierT, TotalDelay >
80{
81
82public:
83 // this line determines which common properties to use
86
89
96 , weight_( 1.0 )
97 {
98 }
99
100 std::unique_ptr< SecondaryEvent > get_secondary_event();
101
102 // Explicitly declare all methods inherited from the dependent base
103 // ConnectionBase. This avoids explicit name prefixes in all places these
104 // functions are used. Since ConnectionBase depends on the template parameter,
105 // they are not automatically found in the base class.
109
110 void
111 check_connection( Node& s, Node& t, const size_t receptor_type, const synindex, const CommonPropertiesType& )
112 {
114
115 s.sends_secondary_event( ge );
116 ge.set_sender( s );
119 }
120
126 bool
127 send( Event& e, size_t t, const CommonSynapseProperties& )
128 {
129 e.set_weight( weight_ );
130 e.set_receiver( *get_target( t ) );
131 e.set_rport( get_rport() );
132 e();
133 return true;
134 }
135
136 void get_status( Dictionary& d ) const;
137
138 void set_status( const Dictionary& d, ConnectorModel& cm );
139
140 void
141 set_weight( double w )
142 {
143 weight_ = w;
144 }
145
146 void
147 set_delay_ms( double )
148 {
149 throw BadProperty( "gap_junction connection has no delay" );
150 }
151
152 void
154 {
155 throw BadProperty( "gap_junction connection has no delay" );
156 }
157
158private:
159 double weight_;
160};
161
162template < typename targetidentifierT >
164
165template < typename targetidentifierT >
166void
168{
169 // We have to include the delay here to prevent errors due to internal calls of this function in SLI/pyNEST
171 d[ names::weight ] = weight_;
172 d[ names::size_of ] = static_cast< long >( sizeof( *this ) );
173}
174
175template < typename targetidentifierT >
176std::unique_ptr< SecondaryEvent >
178{
179 return std::make_unique< GapJunctionEvent >();
180}
181
182template < typename targetidentifierT >
183void
185{
186 // If the delay is set, we throw a BadProperty
187 if ( d.known( names::delay ) or d.known( names::dendritic_delay ) or d.known( names::axonal_delay ) )
188 {
189 throw BadProperty( "gap_junction connection has no delay" );
190 }
191
193 d.update_value( names::weight, weight_ );
194}
195
196} // namespace
197
198#endif /* #ifndef GAP_JUNCTION_H */
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
size_t get_rport() const
Definition connection.h:316
long get_delay_steps() const
Definition connection.h:271
void set_status(const Dictionary &d, ConnectorModel &cm)
Node * get_target(const size_t tid) const
Definition connection.h:311
targetidentifierT target_
Definition connection.h:383
Definition connector_model.h:69
Encapsulate information sent between nodes.
Definition event.h:103
void set_sender(Node &)
Change pointer to sending Node.
Definition event.h:959
Event for gap-junction information.
Definition secondary_event.h:299
Base class for all NEST network objects.
Definition node.h:99
void get_status(Dictionary &d) const
Definition gap_junction.h:167
size_t get_rport() const
Definition connection.h:316
std::unique_ptr< SecondaryEvent > get_secondary_event()
Definition gap_junction.h:177
double weight_
connection weight
Definition gap_junction.h:159
void check_connection(Node &s, Node &t, const size_t receptor_type, const synindex, const CommonPropertiesType &)
Definition gap_junction.h:111
bool send(Event &e, size_t t, const CommonSynapseProperties &)
Send an event to the receiver of this connection.
Definition gap_junction.h:127
void set_delay_ms(double)
Definition gap_junction.h:147
CommonSynapseProperties CommonPropertiesType
Definition gap_junction.h:84
void set_delay_steps(long)
Definition gap_junction.h:153
void set_weight(double w)
Definition gap_junction.h:141
Node * get_target(const size_t tid) const
Definition connection.h:311
void set_status(const Dictionary &d, ConnectorModel &cm)
Definition gap_junction.h:184
gap_junction()
Default Constructor.
Definition gap_junction.h:94
Connection< targetidentifierT, TotalDelay > ConnectionBase
Definition gap_junction.h:85
static constexpr ConnectionModelProperties properties
Definition gap_junction.h:87
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
virtual void sends_secondary_event(GapJunctionEvent &ge)
Required to check, if source neuron may send a SecondaryEvent.
Definition node.cpp:400
const std::string delay("delay")
const std::string axonal_delay("axonal_delay")
const std::string weight("weight")
const std::string size_of("sizeof")
const std::string dendritic_delay("dendritic_delay")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
void register_gap_junction(const std::string &name)
Definition gap_junction.cpp:32
ConnectionModelProperties
Definition connector_model.h:49
@ REQUIRES_SYMMETRIC
Definition connector_model.h:56
@ SUPPORTS_WFR
Definition connector_model.h:55
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:121