sot-core  4.11.8
Hierarchical task solver plug-in for dynamic-graph.
exp-moving-avg.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2018,
3  * Julian Viereck
4  *
5  * CNRS/AIST
6  *
7  */
8 
9 #ifndef __SOT_EXPMOVINGAVG_H__
10 #define __SOT_EXPMOVINGAVG_H__
11 
12 /* --------------------------------------------------------------------- */
13 /* --- INCLUDE --------------------------------------------------------- */
14 /* --------------------------------------------------------------------- */
15 
16 #include <dynamic-graph/entity.h>
17 #include <dynamic-graph/signal-ptr.h>
18 #include <dynamic-graph/signal-time-dependent.h>
19 
20 #include <sot/core/config.hh>
21 
22 namespace dynamicgraph {
23 namespace sot {
24 
25 /* --------------------------------------------------------------------- */
26 /* --- TRACER ---------------------------------------------------------- */
27 /* --------------------------------------------------------------------- */
28 
29 using dynamicgraph::Entity;
30 using dynamicgraph::SignalPtr;
31 using dynamicgraph::SignalTimeDependent;
32 
33 class SOT_CORE_DLLAPI ExpMovingAvg : public Entity {
34  DYNAMIC_GRAPH_ENTITY_DECL();
35 
36  public:
37  SignalPtr<dynamicgraph::Vector, int> updateSIN;
38  SignalTimeDependent<int, int> refresherSINTERN;
39  SignalTimeDependent<dynamicgraph::Vector, int> averageSOUT;
40 
41  public:
42  ExpMovingAvg(const std::string &n);
43  virtual ~ExpMovingAvg(void);
44 
45  void setAlpha(const double &alpha_);
46 
47  protected:
48  dynamicgraph::Vector &update(dynamicgraph::Vector &res, const int &inTime);
49 
50  dynamicgraph::Vector average;
51 
52  double alpha;
53  bool init;
54 };
55 
56 } /* namespace sot */
57 } /* namespace dynamicgraph */
58 
59 #endif /* #ifndef __SOT_TRACER_H__ */
Definition: exp-moving-avg.hh:33
SignalPtr< dynamicgraph::Vector, int > updateSIN
Definition: exp-moving-avg.hh:37
dynamicgraph::Vector & update(dynamicgraph::Vector &res, const int &inTime)
dynamicgraph::Vector average
Definition: exp-moving-avg.hh:50
double alpha
Definition: exp-moving-avg.hh:52
ExpMovingAvg(const std::string &n)
bool init
Definition: exp-moving-avg.hh:53
SignalTimeDependent< dynamicgraph::Vector, int > averageSOUT
Definition: exp-moving-avg.hh:39
void setAlpha(const double &alpha_)
SignalTimeDependent< int, int > refresherSINTERN
Definition: exp-moving-avg.hh:38
#define SOT_CORE_DLLAPI
Definition: config.hh:64
Definition: abstract-sot-external-interface.hh:17