5G-LENA nr-v3.3-161-gad18933f
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
3gpp-outdoor-calibration/power-output-stats.h
1// Copyright (c) 2020 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#ifndef POWER_OUTPUT_STATS_H
6#define POWER_OUTPUT_STATS_H
7
8#include "ns3/nstime.h"
9#include "ns3/sfnsf.h"
10#include "ns3/spectrum-value.h"
11#include "ns3/sqlite-output.h"
12
13#include <vector>
14
15namespace ns3
16{
17
30{
31 public:
36
61 void SetDb(SQLiteOutput* db, const std::string& tableName = "power");
62
75 void SavePower(const SfnSf& sfnSf,
76 Ptr<const SpectrumValue> txPsd,
77 const Time& t,
78 uint16_t rnti,
79 uint64_t imsi,
80 uint16_t bwpId,
81 uint16_t cellId);
82
86 void EmptyCache();
87
88 private:
89 struct PowerResultCache
90 {
91 uint16_t frame;
92 uint8_t subFrame;
93 uint16_t slot;
94 uint16_t rnti;
95 uint64_t imsi;
96 uint16_t bwpId;
97 uint16_t cellId;
98 double txPowerRb;
99 double txPowerTotal;
100 uint32_t rbNumActive;
101 uint32_t rbNumTotal;
102 };
103
104 static void DeleteWhere(SQLiteOutput* p, uint32_t seed, uint32_t run, const std::string& table);
105
106 void WriteCache();
107
108 SQLiteOutput* m_db;
109 std::vector<PowerResultCache> m_powerCache;
110 std::string m_tableName;
111};
112
113} // namespace ns3
114
115#endif // POWER_OUTPUT_STATS_H
Class to collect and store the transmission power values obtained from a simulation.
void SavePower(const SfnSf &sfnSf, Ptr< const SpectrumValue > txPsd, const Time &t, uint16_t rnti, uint64_t imsi, uint16_t bwpId, uint16_t cellId)
Store power values.
void EmptyCache()
Force the cache write to disk, emptying the cache itself.
void SetDb(SQLiteOutput *db, const std::string &tableName="power")
Install the output database.
The SfnSf class.
Definition sfnsf.h:32