Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
RateChecker.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 RATECHECKER_H_
27 #define RATECHECKER_H_
28 
29 #include "auryn_definitions.h"
30 #include "AurynVector.h"
31 #include "System.h"
32 #include "Checker.h"
33 #include "SpikingGroup.h"
34 
35 namespace auryn {
36 
59 class RateChecker : public Checker
60 {
61 private:
62  AurynFloat decay_multiplier;
63  AurynDouble popmin;
64  AurynDouble popmax;
65  AurynDouble state;
66  AurynFloat timeconstant;
67  NeuronID size;
68  void init(AurynFloat min, AurynFloat max, AurynFloat tau);
69 
70  virtual void virtual_serialize(boost::archive::binary_oarchive & ar, const unsigned int version );
71  virtual void virtual_serialize(boost::archive::binary_iarchive & ar, const unsigned int version );
72 protected:
74 
75 public:
82  RateChecker(SpikingGroup * source, AurynFloat min, AurynFloat max, AurynFloat tau=1.0);
83  virtual ~RateChecker();
85  virtual bool propagate();
87  virtual AurynFloat get_property();
92  void set_rate(AurynFloat r);
93  void reset();
94 };
95 
96 }
97 
98 #endif /*RATECHECKER_H_*/
r
Definition: mkpat.py:9
virtual bool propagate()
Definition: RateChecker.cpp:55
virtual AurynFloat get_property()
Definition: RateChecker.cpp:63
virtual ~RateChecker()
Definition: RateChecker.cpp:38
Abstract base class of all objects producing spikes.
Definition: SpikingGroup.h:67
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
A Checker class that tracks population firing rate as a moving average and breaks a run if it goes ou...
Definition: RateChecker.h:59
AurynFloat get_rate()
Definition: RateChecker.cpp:68
void set_rate(AurynFloat r)
Definition: RateChecker.cpp:73
Definition: ABSConnection.h:38
void reset()
Definition: RateChecker.cpp:78
float AurynFloat
Low precision floating point datatype.
Definition: auryn_definitions.h:157
The abstract base class for all checkers.
Definition: Checker.h:47
SpikingGroup * src
Definition: RateChecker.h:73
RateChecker(SpikingGroup *source, AurynFloat min, AurynFloat max, AurynFloat tau=1.0)
Definition: RateChecker.cpp:32
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151