Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
CurrentInjector.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 CURRENTINJECTOR_H_
27 #define CURRENTINJECTOR_H_
28 
29 #include "auryn_definitions.h"
30 #include "AurynVector.h"
31 #include "System.h"
32 #include "Logger.h"
33 #include "Device.h"
34 #include "NeuronGroup.h"
35 
36 
37 namespace auryn {
38 
49 class CurrentInjector : protected Device
50 {
51 private:
52 
54  AurynVectorFloat * currents;
55 
57  AurynVectorFloat * target_vector;
58 
59  void free();
60 
62  AurynFloat get_lambda();
63 
65  AurynFloat alpha;
66 
67 protected:
68 
71 
72 
73 public:
74 
80  CurrentInjector(NeuronGroup * target, std::string neuron_state_name="mem", AurynFloat initial_current=0.0 );
81 
83  void set_target_state( std::string state_name = "mem" );
84 
86  virtual ~CurrentInjector();
87 
94  void set_current( NeuronID i, AurynFloat current );
95 
101  void set_all_currents( AurynFloat current );
102 
104  void execute();
105 
106 };
107 
108 }
109 
110 #endif /*CURRENTINJECTOR_H_*/
void set_target_state(std::string state_name="mem")
Sets the state to add the "current" in every timestep to.
Definition: CurrentInjector.cpp:70
NeuronGroup * dst
Definition: CurrentInjector.h:70
void set_current(NeuronID i, AurynFloat current)
Sets current strengh for neuron i.
Definition: CurrentInjector.cpp:62
virtual ~CurrentInjector()
Default Destructor.
Definition: CurrentInjector.cpp:50
Stimulator class to add values in each timestep to arbitrary neuronal states.
Definition: CurrentInjector.h:49
void set_all_currents(AurynFloat current)
Sets current strength for all neurons.
Definition: CurrentInjector.cpp:66
Definition: ABSConnection.h:38
float AurynFloat
Low precision floating point datatype.
Definition: auryn_definitions.h:157
CurrentInjector(NeuronGroup *target, std::string neuron_state_name="mem", AurynFloat initial_current=0.0)
Default Constructor.
Definition: CurrentInjector.cpp:30
Abstract base class for all neuron groups.
Definition: NeuronGroup.h:45
Default AurynVectorFloat class for performance computation.
Definition: AurynVector.h:796
Abstract base class for all Device, Stimulator, etc objects.
Definition: Device.h:47
std::string string
Standard library string type which is imported into Auryn namespace.
Definition: auryn_definitions.h:156
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
void execute()
Definition: CurrentInjector.cpp:55