Falcon
Loading...
Searching...
No Matches
muaestimator.hpp
1// ---------------------------------------------------------------------
2// This file is part of falcon-core.
3//
4// Copyright (C) 2015, 2016, 2017 Neuro-Electronics Research Flanders
5//
6// Falcon-server is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10//
11// Falcon-sever is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with falcon-core. If not, see <http://www.gnu.org/licenses/>.
18// ---------------------------------------------------------------------
19
20#pragma once
21#include <string>
22
23#include "iprocessor.hpp"
24#include "muadata/muadata.hpp"
25#include "options/units.hpp"
26#include "spikedata/spikedata.hpp"
27
28class MUAEstimator : public IProcessor {
29 // CONSTRUCTOR and OVERLOADED METHODS
30 public:
31 MUAEstimator();
32 void CreatePorts() override;
33 void CompleteStreamInfo() override;
34 void Prepare(GlobalContext& context) override;
35 void Process(ProcessingContext& context) override;
36
37 // DATA PORTS
38 protected:
39 PortIn<SpikeType>* data_in_port_;
40 PortOut<MUAType>* data_out_port_;
41
42 // STATES
43 protected:
44 StaticState<double>* bin_size_;
45 BroadcasterState<double>* mua_;
46
47 // VARIABLES
48 protected:
49 double current_bin_size_;
50 double previous_bin_size_;
51 double spike_buffer_size_;
52 std::size_t n_spike_buffers_;
53
54 // CONSTANTS
55 public:
56 const std::string BIN_SIZE = "bin_size";
57
58 // OPTIONS
59 protected:
60 options::Measurement<double, false> initial_bin_size_{10., "ms",
61 options::positive<double>(true)};
62};
Definition context.hpp:54
Definition streamports.hpp:256
Definition streamports.hpp:98
Definition runinfo.hpp:248