ResultFilters.h Source File

Simu5G: ResultFilters.h Source File
Simu5G
ResultFilters.h
1//
2// Simu5G
3//
4// Authors: Andras Varga
5//
6// This file is part of a software released under the license included in file
7// "license.pdf". Please read LICENSE and README files before using it.
8// The above files and the present reference are part of the software itself,
9// and cannot be removed from it.
10//
11
12#ifndef __SIMU5G_RESULTFILTERS_H_
13#define __SIMU5G_RESULTFILTERS_H_
14
15#include <omnetpp.h>
16
17using namespace omnetpp;
18
19namespace simu5g {
20
21// NOTE: This class is a copy of the similarly named result filter in OMNeT++.
22// It was added here because it will only appear in OMNeT++ 6.4, which is not
23// yet released at the time of writing (November 2025).
24
45class RateAverageFilter : public cNumericResultFilter
46{
47 protected:
48 simtime_t lastTime = SIMTIME_ZERO;
49 double weightedSum = 0;
50 simtime_t totalTime = SIMTIME_ZERO;
51 protected:
52 virtual bool process(simtime_t& t, double& value, cObject *details) override;
53 public:
54 RateAverageFilter() {}
55 double getRateAverage() const;
56 virtual std::string str() const override;
57};
58
59} // namespace simu5g
60
61#endif
Definition AlertReceiver.h:24