Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
PatternMonitor.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 PATTERNMONITOR_H_
27 #define PATTERNMONITOR_H_
28 
29 #include "auryn_definitions.h"
30 #include "AurynVector.h"
31 #include "Monitor.h"
32 #include "System.h"
33 #include "SpikingGroup.h"
34 #include "StimulusGroup.h"
35 #include <fstream>
36 #include <iomanip>
37 
38 namespace auryn {
39 
47 class PatternMonitor : protected Monitor
48 {
49 private:
51  NeuronID * counter;
53  AurynTime ssize;
55  AurynDouble bsize;
57  NeuronID maxpat;
59  std::vector<type_pattern> * patterns;
60 
61  bool linked_to_stimgroup;
62 
63 protected:
67  void init(SpikingGroup * source, string filename, NeuronID maximum_patterns, AurynFloat binsize);
68 
69  virtual void virtual_serialize(boost::archive::binary_oarchive & ar, const unsigned int version );
70  virtual void virtual_serialize(boost::archive::binary_iarchive & ar, const unsigned int version );
71 
72 public:
78  PatternMonitor(SpikingGroup * source, string filename,
79  string patfile,
80  NeuronID maximum_patterns=10,
81  AurynFloat binsize=1e-1);
87  PatternMonitor(SpikingGroup * source, string filename,
88  StimulusGroup * stimgroup,
89  NeuronID maximum_patterns=10,
90  AurynFloat binsize=1e-1);
92  virtual ~PatternMonitor();
94  void execute();
96  void load_patterns( string filename );
97 };
98 
99 }
100 
101 #endif /*PATTERNMONITOR_H_*/
Abstract base class for all Monitor objects.
Definition: Monitor.h:47
void execute()
Definition: PatternMonitor.cpp:81
Abstract base class of all objects producing spikes.
Definition: SpikingGroup.h:67
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
Monitor class to record population firing rates.
Definition: PatternMonitor.h:47
void init()
Standard initializer to be called by the constructor.
Definition: Device.cpp:32
Definition: ABSConnection.h:38
void load_patterns(string filename)
Definition: PatternMonitor.cpp:112
float AurynFloat
Low precision floating point datatype.
Definition: auryn_definitions.h:157
Provides a poisson stimulus at random intervals in one or more predefined subsets of the group that a...
Definition: StimulusGroup.h:50
virtual void virtual_serialize(boost::archive::binary_oarchive &ar, const unsigned int version)
Definition: PatternMonitor.cpp:180
SpikingGroup * src
Definition: PatternMonitor.h:65
virtual ~PatternMonitor()
Definition: PatternMonitor.cpp:48
PatternMonitor(SpikingGroup *source, string filename, string patfile, NeuronID maximum_patterns=10, AurynFloat binsize=1e-1)
Definition: PatternMonitor.cpp:30
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