Spike
Loading...
Searching...
No Matches
FiringRateSimulation.h
Go to the documentation of this file.
1
5#ifndef SPIKE_FIRINGRATESIMULATION_H
6#define SPIKE_FIRINGRATESIMULATION_H
7
8#include "Spike/Neuron/IF.h"
9#include "Spike/SpikeTrain/SpikeTrain.h"
10#include "Spike/TimeFrame/TimeFrame.h"
11
12namespace Spike {
13
18 protected:
21 std::unique_ptr<IF> neuron;
22 std::unique_ptr<Signal> signal;
23
24 size_t N_neurons;
25
26 std::vector<double>
28
29 public:
34 explicit FiringRateSimulation(const std::string &input_file);
35
40 virtual void calculate(int trials);
41
46 void add_to_firing_rate(const std::vector<double> &tmp_firing_rate);
47
52 [[nodiscard]] size_t get_N_neurons() const { return N_neurons; };
53
58 [[nodiscard]] size_t get_firing_rate_size() const {
59 return firing_rate.size();
60 };
61
66 [[nodiscard]] const TimeFrame &get_time_frame() const {
67 return time_frame;
68 };
69
74 [[nodiscard]] const std::vector<double> &get_firing_rate() const {
75 return firing_rate;
76 };
77};
78
80 private:
81 std::vector<std::vector<double>> spike_trains;
82
83 public:
84 RasterPlot(const std::string &input_file);
85 void calculate();
86
87 [[nodiscard]] const std::vector<std::vector<double>> &get_spike_trains() {
88 return spike_trains;
89 }
90};
91
92} // namespace Spike
93
94#endif // SPIKE_FIRINGRATESIMULATION_H
Implements a simulation during which we calculate the firing rate.
Definition FiringRateSimulation.h:17
TimeFrame time_frame
the time frame
Definition FiringRateSimulation.h:19
SpikeTrain spike_train
the spike train
Definition FiringRateSimulation.h:20
size_t get_firing_rate_size() const
Returns the size of the firing rate array.
Definition FiringRateSimulation.h:58
const TimeFrame & get_time_frame() const
Returns the time frame.
Definition FiringRateSimulation.h:66
void add_to_firing_rate(const std::vector< double > &tmp_firing_rate)
Adds a given vector of firing rate values to the firing_rate array.
Definition FiringRateSimulation.cpp:54
std::unique_ptr< IF > neuron
pointer to an IF neuron
Definition FiringRateSimulation.h:21
size_t N_neurons
number of trials
Definition FiringRateSimulation.h:24
FiringRateSimulation(const std::string &input_file)
Constructs a firing rate simulation from .ini file.
Definition FiringRateSimulation.cpp:13
const std::vector< double > & get_firing_rate() const
Returns the firing rate array.
Definition FiringRateSimulation.h:74
size_t get_N_neurons() const
Returns the number of neurons.
Definition FiringRateSimulation.h:52
std::vector< double > firing_rate
array containing the firing rate values
Definition FiringRateSimulation.h:27
virtual void calculate(int trials)
Calculates the firing rate for a given number of trials.
Definition FiringRateSimulation.cpp:35
std::unique_ptr< Signal > signal
pointer to a signal
Definition FiringRateSimulation.h:22
Definition FiringRateSimulation.h:79
A spike train for discretized times. For a given time discretization with time step dt,...
Definition SpikeTrain.h:18
A time frame with discrete time steps.
Definition TimeFrame.h:13