22 #include "ns3/string.h"
23 #include <ns3/simulator.h>
33 : m_RsrpSinrFirstWrite (true),
34 m_UeSinrFirstWrite (true),
35 m_InterferenceFirstWrite (true)
51 .AddConstructor<PhyStatsCalculator> ()
52 .AddAttribute (
"DlRsrpSinrFilename",
53 "Name of the file where the RSRP/SINR statistics will be saved.",
57 .AddAttribute (
"UlSinrFilename",
58 "Name of the file where the UE SINR statistics will be saved.",
62 .AddAttribute (
"UlInterferenceFilename",
63 "Name of the file where the interference statistics will be saved.",
111 double rsrp,
double sinr)
116 std::ofstream outFile;
120 if (!outFile.is_open ())
126 outFile <<
"% time\tcellId\tIMSI\tRNTI\trsrp\tsinr";
127 outFile << std::endl;
132 if (!outFile.is_open ())
140 outFile << cellId <<
"\t";
141 outFile << imsi <<
"\t";
142 outFile << rnti <<
"\t";
143 outFile << rsrp <<
"\t";
144 outFile << sinr << std::endl;
154 std::ofstream outFile;
158 if (!outFile.is_open ())
164 outFile <<
"% time\tcellId\tIMSI\tRNTI\tsinrLinear";
165 outFile << std::endl;
170 if (!outFile.is_open ())
178 outFile << cellId <<
"\t";
179 outFile << imsi <<
"\t";
180 outFile << rnti <<
"\t";
181 outFile << sinrLinear << std::endl;
191 std::ofstream outFile;
195 if (!outFile.is_open ())
201 outFile <<
"% time\tcellId\tInterference";
202 outFile << std::endl;
207 if (!outFile.is_open ())
215 outFile << cellId <<
"\t";
216 outFile << *interference;
223 std::string path, uint16_t cellId, uint16_t rnti,
224 double rsrp,
double sinr)
228 std::string pathUePhy = path.substr (0, path.find (
"/ReportCurrentCellRsrpSinr"));
244 uint16_t cellId, uint16_t rnti,
double sinrLinear)
249 std::ostringstream pathAndRnti;
250 pathAndRnti << path <<
"/" << rnti;
251 std::string pathEnbMac = path.substr (0, path.find (
"LteEnbPhy/ReportUeSinr"));
252 pathEnbMac +=
"LteEnbMac/DlScheduling";
263 phyStats->
ReportUeSinr (cellId, imsi, rnti, sinrLinear);