Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
FanOutConnection.h
Go to the documentation of this file.
1 /*
2 * Copyright 2014-2018 Friedemann Zenke
3 *
4 * This file is part of Auryn, a simulation package for plastic
5 * spiking neural networks.
6 *
7 * Auryn is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * Auryn is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with Auryn. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * If you are using Auryn or parts of it for your work please cite:
21 * Zenke, F. and Gerstner, W., 2014. Limits to high-speed simulations
22 * of spiking neural networks using general-purpose computers.
23 * Front Neuroinform 8, 76. doi: 10.3389/fninf.2014.00076
24 */
25 
26 #ifndef FANOUTCONNECTION_H_
27 #define FANOUTCONNECTION_H_
28 
29 #include "auryn_definitions.h"
30 #include "AurynVector.h"
31 #include "Connection.h"
32 #include "System.h"
33 
34 #include <sstream>
35 #include <fstream>
36 #include <stdio.h>
37 
38 #include <boost/random/mersenne_twister.hpp>
39 #include <boost/random/uniform_int.hpp>
40 #include <boost/random/variate_generator.hpp>
41 #include <boost/random/exponential_distribution.hpp>
42 #include <boost/random/normal_distribution.hpp>
43 
44 namespace auryn {
45 
48 {
49 private:
50  NeuronID srcid;
51  SpikeContainer * spikes;
52  void init(NeuronID source_neuron_id, AurynWeight weight);
53  AurynWeight connection_weight;
54 
55 protected:
56  void free();
57 
58 
59 public:
62  SpikingGroup * source,
63  NeuronID source_neuron_id,
64  NeuronGroup * destination,
65  AurynWeight weight = 1.0,
66  TransmitterType transmitter = GLUT,
67  string name = "Default FanOutConnection"
68  );
69  virtual ~FanOutConnection();
70 
71  virtual AurynWeight get(NeuronID i, NeuronID j);
72  virtual AurynWeight * get_ptr(NeuronID i, NeuronID j);
73  virtual AurynWeight get_data(NeuronID i);
74  virtual AurynLong get_nonzero();
75 
76  virtual void set_data(NeuronID i, AurynWeight value);
77  virtual void set(NeuronID i, NeuronID j, AurynWeight value);
78  void finalize();
79 
80  virtual void propagate();
81 
85  virtual void stats(AurynDouble &mean, AurynDouble &std, StateID zid = 0);
86  virtual bool write_to_file(string filename);
87  virtual bool load_from_file(string filename);
88 
90  std::vector<neuron_pair> get_block(NeuronID lo_row, NeuronID lo_col, NeuronID hi_row, NeuronID hi_col);
91 
92 };
93 
94 }
95 
96 #endif /*FANOUTCONNECTION_H_*/
Provides all to all connectivity.
Definition: FanOutConnection.h:47
Standard Glutamatergic (excitatory) transmission.
Definition: auryn_definitions.h:139
The abstract base class for all Connection objects in Auryn.
Definition: Connection.h:53
virtual AurynWeight * get_ptr(NeuronID i, NeuronID j)
Return pointer to weight element i,j if it exists, otherwise return NULL.
Definition: FanOutConnection.cpp:92
std::vector< NeuronID > SpikeContainer
Spike container type. Used for storing spikes.
Definition: auryn_definitions.h:161
virtual AurynWeight get_data(NeuronID i)
Return weight element as index in data array.
Definition: FanOutConnection.cpp:76
STL namespace.
Abstract base class of all objects producing spikes.
Definition: SpikingGroup.h:67
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
AurynFloat AurynWeight
Unit of synaptic weights.
Definition: auryn_definitions.h:159
virtual AurynLong get_nonzero()
Return number of nonzero elements in this Connection.
Definition: FanOutConnection.cpp:119
virtual ~FanOutConnection()
Definition: FanOutConnection.cpp:43
void free()
Definition: FanOutConnection.cpp:57
virtual bool load_from_file(string filename)
Implements load from file functionality. Also called in save_network_state from System class...
Definition: FanOutConnection.cpp:114
Definition: ABSConnection.h:38
unsigned long AurynLong
An unsigned long type used to count synapses or similar.
Definition: auryn_definitions.h:154
virtual void stats(AurynDouble &mean, AurynDouble &std, StateID zid=0)
Return stats for connection.
Definition: FanOutConnection.cpp:103
TransmitterType
Specifies the different transmitter types that Auryn knows.
Definition: auryn_definitions.h:138
virtual void set_data(NeuronID i, AurynWeight value)
Definition: FanOutConnection.cpp:81
Abstract base class for all neuron groups.
Definition: NeuronGroup.h:45
void finalize()
Finalize Connection after initialization to prepare for use in simulation.
Definition: FanOutConnection.cpp:61
unsigned int StateID
StateID is an unsigned integeger type used to index synaptic states in Auryn.
Definition: auryn_definitions.h:153
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
virtual bool write_to_file(string filename)
Implements save to file functionality. Also called in save_network_state from System class...
Definition: FanOutConnection.cpp:109
virtual void propagate()
Propagate method to propagate spikes. Called by System run method.
Definition: FanOutConnection.cpp:65
std::vector< neuron_pair > get_block(NeuronID lo_row, NeuronID lo_col, NeuronID hi_row, NeuronID hi_col)
Returns a vector of ConnectionsID of a block specified by the arguments.
Definition: FanOutConnection.cpp:124