Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
StateMonitor.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 STATEMONITOR_H_
27 #define STATEMONITOR_H_
28 
29 #include "auryn_definitions.h"
30 #include "AurynVector.h"
31 #include "Monitor.h"
32 #include "System.h"
33 #include "Connection.h"
34 #include <fstream>
35 #include <iomanip>
36 
37 namespace auryn {
38 
40 class StateMonitor : public Monitor
41 {
42 protected:
45 
48 
52 
55 
58 
61 
63  void init(string filename, AurynDouble stepsize);
64 
65 public:
76 
85  StateMonitor(SpikingGroup * source, NeuronID id, string statename, string filename, AurynDouble sampling_interval=auryn_timestep);
86 
93  StateMonitor(AurynStateVector * state, NeuronID id, string filename, AurynDouble sampling_interval=auryn_timestep);
94 
101  StateMonitor(AurynSynStateVector * state, NeuronID id, string filename, AurynDouble sampling_interval=auryn_timestep);
102 
109  StateMonitor(Trace * trace, NeuronID id, string filename, AurynDouble sampling_interval=auryn_timestep);
110 
117  void record_for(AurynDouble time=10.0);
118 
120  void set_stop_time(AurynDouble time=10.0);
121 
127  void set_step_size(int step=1);
128 
129  virtual ~StateMonitor();
130  void execute();
131 };
132 
133 }
134 
135 #endif /*STATEMONITOR_H_*/
Default Auryn vector template.
Definition: auryn_definitions.h:327
Abstract base class for all Monitor objects.
Definition: Monitor.h:47
Abstract base class of all objects producing spikes.
Definition: SpikingGroup.h:67
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
Abstract base class of synaptic traces.
Definition: Trace.h:36
SpikingGroup * src
The source SpikingGroup to record from.
Definition: StateMonitor.h:44
void init()
Standard initializer to be called by the constructor.
Definition: Device.cpp:32
Definition: ABSConnection.h:38
AurynTime ssize
The step size (sampling interval) in units of auryn_timestep.
Definition: StateMonitor.h:57
AurynFloat AurynState
Type for Auryn state variables (default single precision since it needs to be compatible with auryn_v...
Definition: auryn_definitions.h:160
StateMonitor(SpikingGroup *source, NeuronID id, string statename, string filename, AurynDouble sampling_interval=auryn_timestep)
Standard constructor.
Definition: StateMonitor.cpp:31
double auryn_timestep
Simulation timestep in seconds.
Definition: auryn_definitions.cpp:31
void set_stop_time(AurynDouble time=10.0)
Set an absolute time when to stop recording.
Definition: StateMonitor.cpp:141
NeuronID nid
The source neuron id to record from.
Definition: StateMonitor.h:54
AurynState * target_variable
Target variable.
Definition: StateMonitor.h:47
AurynState lastder
Definition: StateMonitor.h:51
void record_for(AurynDouble time=10.0)
Sets relative time at which to stop recording.
Definition: StateMonitor.cpp:153
Default AurynVectorFloat class for performance computation.
Definition: AurynVector.h:796
void execute()
Definition: StateMonitor.cpp:118
void set_step_size(int step=1)
Sets the step size.
Definition: StateMonitor.cpp:147
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
AurynState lastval
Last value (used for compression)
Definition: StateMonitor.h:50
virtual ~StateMonitor()
Definition: StateMonitor.cpp:107
Records from an arbitray state vector of one unit from the source SpikingGroup to a file...
Definition: StateMonitor.h:40
AurynTime t_stop
Defines the maximum recording time in AurynTime to save space.
Definition: StateMonitor.h:60
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
bool enable_compression
Switch to enable/disable output compression.
Definition: StateMonitor.h:75