NEST main@caf0ae8
 
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 >
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, size_t receptor_type, const CommonPropertiesType& )
112 {
114
115 s.sends_secondary_event( ge );
116 ge.set_sender( s );
117 Connection< targetidentifierT >::target_.set_rport( t.handles_test_event( ge, receptor_type ) );
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( double )
148 {
149 throw BadProperty( "gap_junction connection has no delay" );
150 }
151
152private:
153 double weight_;
154};
155
156template < typename targetidentifierT >
158
159template < typename targetidentifierT >
160void
162{
163 // We have to include the delay here to prevent
164 // errors due to internal calls of
165 // this function in SLI/pyNEST
166 ConnectionBase::get_status( d );
167 d[ names::weight ] = weight_;
168 d[ names::size_of ] = static_cast< long >( sizeof( *this ) );
169}
170
171template < typename targetidentifierT >
172std::unique_ptr< SecondaryEvent >
174{
175 return std::make_unique< GapJunctionEvent >();
176}
177
178template < typename targetidentifierT >
179void
181{
182 // If the delay is set, we throw a BadProperty
183 if ( d.known( names::delay ) )
184 {
185 throw BadProperty( "gap_junction connection has no delay" );
186 }
187
188 ConnectionBase::set_status( d, cm );
189 d.update_value( names::weight, weight_ );
190}
191
192} // namespace
193
194#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
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
Encapsulate information sent between nodes.
Definition event.h:103
void set_sender(Node &)
Change pointer to sending Node.
Definition event.h:920
Event for gap-junction information.
Definition secondary_event.h:299
Base class for all NEST network objects.
Definition node.h:99
Definition gap_junction.h:80
void get_status(Dictionary &d) const
Definition gap_junction.h:161
std::unique_ptr< SecondaryEvent > get_secondary_event()
Definition gap_junction.h:173
double weight_
connection weight
Definition gap_junction.h:153
bool send(Event &e, size_t t, const CommonSynapseProperties &)
Send an event to the receiver of this connection.
Definition gap_junction.h:127
Node * get_target(const size_t tid) const
Definition connection.h:239
CommonSynapseProperties CommonPropertiesType
Definition gap_junction.h:84
void set_weight(double w)
Definition gap_junction.h:141
size_t get_rport() const
Definition connection.h:244
void set_status(const Dictionary &d, ConnectorModel &cm)
Definition gap_junction.h:180
Connection< targetidentifierT > ConnectionBase
Definition gap_junction.h:85
void check_connection(Node &s, Node &t, size_t receptor_type, const CommonPropertiesType &)
Definition gap_junction.h:111
gap_junction()
Default Constructor.
Definition gap_junction.h:94
static constexpr ConnectionModelProperties properties
Definition gap_junction.h:87
void set_delay(double)
Definition gap_junction.h:147
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 delay("delay")
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_gap_junction(const std::string &name)
Definition gap_junction.cpp:32
ConnectionModelProperties
Definition connector_model.h:49