ResultRecorders.h Source File

Simu5G: ResultRecorders.h Source File
Simu5G
ResultRecorders.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_RESULTRECORDERS_H_
13#define __SIMU5G_RESULTRECORDERS_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 recorder 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
40class RateAverageRecorder : public cNumericResultRecorder
41{
42 protected:
43 simtime_t lastTime = SIMTIME_ZERO;
44 double weightedSum = 0;
45 simtime_t totalTime = SIMTIME_ZERO;
46 protected:
47 virtual void collect(simtime_t_cref t, double value, cObject *details) override;
48 virtual void finish(cResultFilter *prev) override;
49 public:
50 RateAverageRecorder() {}
51 double getRateAverage() const;
52 virtual std::string str() const override;
53};
54
55} // namespace simu5g
56
57#endif
Definition AlertReceiver.h:24