NEST  2.6.0,not_revisioned_source_dir@0
parrot_neuron.h
Go to the documentation of this file.
1 /*
2  * parrot_neuron.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  /* BeginDocumentation
25 Name: parrot_neuron - Neuron that repeats incoming spikes.
26 
27 Description:
28 
29  The parrot neuron simply emits one spike for every incoming spike.
30  One possible application for this is to create different channels
31  for the output of generator devices such as the poisson_generator
32  or the mip_generator.
33 
34 Remarks:
35 
36  Network-wise the parrot neuron behaves like other neuron models
37  regarding connections and communication. While the number of
38  outgoing spikes equals that of incoming ones, the weigth of the
39  outgoing spikes solely depends on the weigth of outgoing connections.
40 
41  A Poisson generator that would send multiple spikes during a single
42  time step due to a high rate will send single spikes with
43  multiple synaptic strength instead, for effiacy reasons.
44  This can be realized because of the way devices are implemented
45  in the threaded environment. A parrot neuron on the other
46  hand always emits single spikes. Hence, in a situation where for
47  example a poisson generator with a high firing rate is connected
48  to a parrot neuron, the communication cost associated with outgoing
49  spikes is much bigger for the latter.
50 
51 Receives: SpikeEvent
52 
53 Sends: SpikeEvent
54 
55 Parameters:
56 
57  No parameters to be set in the status dictionary.
58 
59 References:
60  No references
61 
62 Author: May 2006, Reichert, Morrison
63 */
64 
65 
66 
77 #ifndef PARROT_NEURON_H
78 #define PARROT_NEURON_H
79 
80 #include "nest.h"
81 #include "event.h"
82 #include "archiving_node.h"
83 #include "ring_buffer.h"
84 #include "connection.h"
85 
86 namespace nest
87 {
88  class Network;
89 
91  {
92 
93  public:
94 
95  parrot_neuron();
96 
102  using Node::handle;
104 
106 
107  void handle(SpikeEvent &);
109 
110  void get_status(DictionaryDatum &) const;
111  void set_status(const DictionaryDatum &);
112 
113  private:
114 
115  void init_state_(const Node&){} // no state
116  void init_buffers_();
117  void calibrate(){} // no variables
118 
119  void update(Time const &, const long_t, const long_t);
120 
125  struct Buffers_ {
127  };
128 
130  };
131 
132  inline
134  {
135  SpikeEvent e;
136  e.set_sender(*this);
137 
138  return target.handles_test_event(e, receptor_type);
139  }
140 
141  inline
143  {
144  if (receptor_type != 0)
145  throw UnknownReceptorType(receptor_type, get_name());
146  return 0;
147  }
148 
149 } // namespace
150 
151 #endif //PARROT_NEURON_H
Definition of Archiving_Node which is capable of recording and managing a spike history.
const Name receptor_type("receptor_type")
Connection parameters.
Definition: nest_names.h:240
void set_sender(Node &)
Change pointer to sending Node.
Definition: event.h:714
parrot_neuron()
Definition: parrot_neuron.cpp:36
void set_status(const DictionaryDatum &)
Definition: parrot_neuron.cpp:73
RingBuffer n_spikes_
Definition: parrot_neuron.h:126
void calibrate()
Re-calculate dependent parameters of the node.
Definition: parrot_neuron.h:117
long_t rport
Connection port number to distinguish incoming connections, also called receiver port.
Definition: nest.h:147
void init_state_(const Node &)
Private function to initialize the state of a node to model defaults.
Definition: parrot_neuron.h:115
port send_test_event(Node &, rport, synindex, bool)
Send an event to the receiving_node passed as an argument.
Definition: parrot_neuron.h:133
void init_buffers_()
Private function to initialize the buffers of a node.
Definition: parrot_neuron.cpp:40
Definition: nest_time.h:130
port handles_test_event(SpikeEvent &, rport)
Check if the node can handle a particular event and receptor type.
Definition: parrot_neuron.h:142
std::string get_name() const
Return class name.
Definition: node.cpp:83
void handle(SpikeEvent &)
Handle incoming spike events.
Definition: parrot_neuron.cpp:78
void get_status(DictionaryDatum &) const
Definition: parrot_neuron.cpp:68
Buffers_ B_
Definition: parrot_neuron.h:129
Exception to be thrown if the specified receptor type does not exist in the node. ...
Definition: exceptions.h:254
const Name target("target")
Connection parameters.
Definition: nest_names.h:282
a node which archives spike history for the purposes of timing dependent plasticity ...
Definition: archiving_node.h:50
long_t port
Connection port number to distinguis outgoing connections.
Definition: nest.h:155
virtual void handle(SpikeEvent &e)
Handle incoming spike events.
Definition: node.cpp:198
Definition: parrot_neuron.h:90
virtual port handles_test_event(SpikeEvent &, rport receptor_type)
Check if the node can handle a particular event and receptor type.
Definition: node.cpp:203
void update(Time const &, const long_t, const long_t)
Bring the node from state $t$ to $t+n*dt$.
Definition: parrot_neuron.cpp:46
unsigned char synindex
Unsigned char type for enumerations of synapse types.
Definition: nest.h:115
Default types used by the NEST kernel.
Event for spike information.
Definition: event.h:320
Base class for all NEST network objects.
Definition: node.h:96
Buffers and accumulates the number of incoming spikes per time step; RingBuffer stores doubles; for n...
Definition: parrot_neuron.h:125
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
const double e
Definition: numerics.cpp:62
Buffer Layout.
Definition: ring_buffer.h:77