Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
BinarySpikeMonitor.h
Go to the documentation of this file.
1 /*
2 * Copyright 2014-2018 Friedemann Zenke
3 * Contributed by Ankur Sinha
4 *
5 * This file is part of Auryn, a simulation package for plastic
6 * spiking neural networks.
7 *
8 * Auryn is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * Auryn is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with Auryn. If not, see <http://www.gnu.org/licenses/>.
20 *
21 * If you are using Auryn or parts of it for your work please cite:
22 * Zenke, F. and Gerstner, W., 2014. Limits to high-speed simulations
23 * of spiking neural networks using general-purpose computers.
24 * Front Neuroinform 8, 76. doi: 10.3389/fninf.2014.00076
25 */
26 
27 #ifndef BINARYSPIKEMONITOR_H_
28 #define BINARYSPIKEMONITOR_H_
29 
30 #include "auryn_definitions.h"
31 #include "AurynVector.h"
32 #include "SpikingGroup.h"
33 #include "Monitor.h"
34 #include "System.h"
35 #include <fstream>
36 
37 namespace auryn {
38 
49 {
50 private:
51  static const std::string default_extension;
52  NeuronID n_from;
53  NeuronID n_to;
54  NeuronID n_every;
55  SpikeContainer::const_iterator it;
56  SpikingGroup * src;
57  NeuronID offset;
58  void init(SpikingGroup * source, std::string filename, NeuronID from, NeuronID to);
59  virtual void open_output_file(std::string filename);
60  void free();
61 
62 public:
63  BinarySpikeMonitor(SpikingGroup * source, std::string filename="");
64  BinarySpikeMonitor(SpikingGroup * source, std::string filename, NeuronID to);
65  BinarySpikeMonitor(SpikingGroup * source, std::string filename, NeuronID from, NeuronID to);
66  void set_offset(NeuronID of);
67  void set_every(NeuronID every);
68  virtual ~BinarySpikeMonitor();
69  virtual void execute();
70  virtual void flush();
71 };
72 
73 
74 }
75 
76 #endif /*BINARYSPIKEMONITOR_H_*/
Abstract base class for all Monitor objects.
Definition: Monitor.h:47
The standard Monitor object to record spikes from a SpikingGroup and write them to a binary file...
Definition: BinarySpikeMonitor.h:48
Abstract base class of all objects producing spikes.
Definition: SpikingGroup.h:67
void set_offset(NeuronID of)
Definition: BinarySpikeMonitor.cpp:98
void init()
Standard initializer to be called by the constructor.
Definition: Device.cpp:32
Definition: ABSConnection.h:38
virtual ~BinarySpikeMonitor()
Definition: BinarySpikeMonitor.cpp:48
virtual void flush()
Flush to file.
Definition: BinarySpikeMonitor.cpp:125
void set_every(NeuronID every)
Definition: BinarySpikeMonitor.cpp:103
BinarySpikeMonitor(SpikingGroup *source, std::string filename="")
Definition: BinarySpikeMonitor.cpp:43
virtual void execute()
Definition: BinarySpikeMonitor.cpp:108
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