Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
PatternStimulator.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 PATTERNSTIMULATOR_H_
27 #define PATTERNSTIMULATOR_H_
28 
29 #include "auryn_definitions.h"
30 #include "AurynVector.h"
31 #include "System.h"
32 #include "Monitor.h"
33 #include "NeuronGroup.h"
34 #include <fstream>
35 #include <iomanip>
36 
37 namespace auryn {
38 
44 class PatternStimulator : protected Monitor
45 {
46 private:
48  NeuronID maxpat;
50  std::vector<type_pattern> * patterns;
52  AurynState * currents;
54  AurynState * newcurrents;
56  std::ifstream timeseriesfile;
58  auryn_vector_float * mem;
59 
61  AurynFloat scl;
62 
64  AurynTime filetime;
65 
66 
67 protected:
71  void init(NeuronGroup * target, string filename, AurynFloat scale, NeuronID maximum_patterns);
72 
73 public:
79  string filename,
80  string patfile="",
81  AurynFloat scale=1,
82  NeuronID maximum_patterns=10);
84  virtual ~PatternStimulator();
85  void set_scale(AurynFloat scale);
88  void propagate();
90  void load_patterns( string filename );
91 
93  void load_1_pattern( );
94 };
95 
96 }
97 
98 #endif /*PATTERNSTIMULATOR_H_*/
virtual ~PatternStimulator()
Definition: PatternStimulator.cpp:44
Abstract base class for all Monitor objects.
Definition: Monitor.h:47
PatternStimulator(NeuronGroup *target, string filename, string patfile="", AurynFloat scale=1, NeuronID maximum_patterns=10)
Definition: PatternStimulator.cpp:30
NeuronGroup * dst
Definition: PatternStimulator.h:69
AurynFloat get_scale()
Definition: PatternStimulator.cpp:206
void set_scale(AurynFloat scale)
Definition: PatternStimulator.cpp:202
void init()
Standard initializer to be called by the constructor.
Definition: Device.cpp:32
Definition: ABSConnection.h:38
AurynFloat AurynState
Type for Auryn state variables (default single precision since it needs to be compatible with auryn_v...
Definition: auryn_definitions.h:160
void load_1_pattern()
Definition: PatternStimulator.cpp:115
float AurynFloat
Low precision floating point datatype.
Definition: auryn_definitions.h:157
void load_patterns(string filename)
Definition: PatternStimulator.cpp:131
void propagate()
Definition: PatternStimulator.cpp:75
Stimulator class to inject timeseries of currents to patterns (subpopulations) of neurons...
Definition: PatternStimulator.h:44
Abstract base class for all neuron groups.
Definition: NeuronGroup.h:45
Default AurynVectorFloat class for performance computation.
Definition: AurynVector.h:796
NeuronID AurynTime
Defines Auryns discrete time unit of the System clock. Change to AurynLong if 120h of simtime are not...
Definition: auryn_definitions.h:155
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151