Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
SpikeMonitor.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 SPIKEMONITOR_H_
27 #define SPIKEMONITOR_H_
28 
29 #include "auryn_definitions.h"
30 #include "AurynVector.h"
31 #include "SpikingGroup.h"
32 #include "Monitor.h"
33 #include "System.h"
34 #include <fstream>
35 
36 namespace auryn {
37 
52 class SpikeMonitor : public Monitor
53 {
54 private:
55  NeuronID n_from;
56  NeuronID n_to;
57  NeuronID n_every;
58  SpikeContainer::const_iterator it;
59  SpikingGroup * src;
60  void init(SpikingGroup * source, std::string filename, NeuronID from, NeuronID to);
61  void free();
62 
63 public:
65  bool active;
66 
73  SpikeMonitor(SpikingGroup * source, std::string filename);
74 
82  SpikeMonitor(SpikingGroup * source, std::string filename, NeuronID to);
83 
92  SpikeMonitor(SpikingGroup * source, std::string filename, NeuronID from, NeuronID to);
93 
97  void set_every(NeuronID every);
98 
100  virtual ~SpikeMonitor();
101 
103  void execute();
104 };
105 
106 }
107 
108 #endif /*SPIKEMONITOR_H_*/
Abstract base class for all Monitor objects.
Definition: Monitor.h:47
void set_every(NeuronID every)
Sets every parameter that ellow to record only from every X neuron.
Definition: SpikeMonitor.cpp:72
Abstract base class of all objects producing spikes.
Definition: SpikingGroup.h:67
The standard Monitor object to record spikes from a SpikingGroup and write them to a text file...
Definition: SpikeMonitor.h:52
void init()
Standard initializer to be called by the constructor.
Definition: Device.cpp:32
Definition: ABSConnection.h:38
void execute()
Propagate function for internal use.
Definition: SpikeMonitor.cpp:77
SpikeMonitor(SpikingGroup *source, std::string filename)
Default constructor.
Definition: SpikeMonitor.cpp:42
bool active
Definition: SpikeMonitor.h:65
virtual ~SpikeMonitor()
Default destructor.
Definition: SpikeMonitor.cpp:48
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