A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
phy-stats-calculator.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Jaume Nin <jnin@cttc.es>
18 */
19
20#ifndef PHY_STATS_CALCULATOR_H_
21#define PHY_STATS_CALCULATOR_H_
22
24
25#include "ns3/nstime.h"
26#include "ns3/spectrum-value.h"
27#include "ns3/uinteger.h"
28
29#include <fstream>
30#include <string>
31
32namespace ns3
33{
34
60{
61 public:
66
70 ~PhyStatsCalculator() override;
71
72 // Inherited from ns3::Object
77 static TypeId GetTypeId();
78
84 void SetCurrentCellRsrpSinrFilename(std::string filename);
85
91
97 void SetUeSinrFilename(std::string filename);
98
103 std::string GetUeSinrFilename();
104
110 void SetInterferenceFilename(std::string filename);
111
116 std::string GetInterferenceFilename();
117
127 void ReportCurrentCellRsrpSinr(uint16_t cellId,
128 uint64_t imsi,
129 uint16_t rnti,
130 double rsrp,
131 double sinr,
132 uint8_t componentCarrierId);
133
142 void ReportUeSinr(uint16_t cellId,
143 uint64_t imsi,
144 uint16_t rnti,
145 double sinrLinear,
146 uint8_t componentCarrierId);
147
153 void ReportInterference(uint16_t cellId, Ptr<SpectrumValue> interference);
154
167 std::string path,
168 uint16_t cellId,
169 uint16_t rnti,
170 double rsrp,
171 double sinr,
172 uint8_t componentCarrierId);
173
184 static void ReportUeSinr(Ptr<PhyStatsCalculator> phyStats,
185 std::string path,
186 uint16_t cellId,
187 uint16_t rnti,
188 double sinrLinear,
189 uint8_t componentCarrierId);
190
199 static void ReportInterference(Ptr<PhyStatsCalculator> phyStats,
200 std::string path,
201 uint16_t cellId,
202 Ptr<SpectrumValue> interference);
203
204 private:
212
220
228
233
237 std::string m_ueSinrFilename;
238
243
247 std::ofstream m_rsrpOutFile;
248
252 std::ofstream m_ueSinrOutFile;
253
258};
259
260} // namespace ns3
261
262#endif /* PHY_STATS_CALCULATOR_H_ */
Base class for ***StatsCalculator classes.
Takes care of storing the information generated at PHY layer.
bool m_UeSinrFirstWrite
When writing UE SINR statistics first time to file, columns description is added.
bool m_InterferenceFirstWrite
When writing interference statistics first time to file, columns description is added.
std::string GetInterferenceFilename()
Get the name of the file where the interference statistics will be stored.
std::string GetUeSinrFilename()
Get the name of the file where the UE SINR statistics will be stored.
void SetInterferenceFilename(std::string filename)
Set the name of the file where the interference statistics will be stored.
void ReportUeSinr(uint16_t cellId, uint64_t imsi, uint16_t rnti, double sinrLinear, uint8_t componentCarrierId)
Notifies the stats calculator that an UE SINR report has occurred.
bool m_RsrpSinrFirstWrite
When writing RSRP SINR statistics first time to file, columns description is added.
std::string m_interferenceFilename
Name of the file where the interference statistics will be saved.
std::string m_ueSinrFilename
Name of the file where the UE SINR statistics will be saved.
void SetCurrentCellRsrpSinrFilename(std::string filename)
Set the name of the file where the RSRP/SINR statistics will be stored.
void ReportCurrentCellRsrpSinr(uint16_t cellId, uint64_t imsi, uint16_t rnti, double rsrp, double sinr, uint8_t componentCarrierId)
Notifies the stats calculator that an RSRP and SINR report has occurred.
void SetUeSinrFilename(std::string filename)
Set the name of the file where the UE SINR statistics will be stored.
std::ofstream m_interferenceOutFile
Interference statistics output trace file.
std::string GetCurrentCellRsrpSinrFilename()
Get the name of the file where the RSRP/SINR statistics will be stored.
static TypeId GetTypeId()
Register this type.
std::ofstream m_ueSinrOutFile
UE SINR statistics output trace file.
std::string m_RsrpSinrFilename
Name of the file where the RSRP/SINR statistics will be saved.
std::ofstream m_rsrpOutFile
RSRP statistics output trace file.
void ReportInterference(uint16_t cellId, Ptr< SpectrumValue > interference)
Notifies the stats calculator that an interference report has occurred.
static void ReportCurrentCellRsrpSinrCallback(Ptr< PhyStatsCalculator > phyStats, std::string path, uint16_t cellId, uint16_t rnti, double rsrp, double sinr, uint8_t componentCarrierId)
trace sink
~PhyStatsCalculator() override
Destructor.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.