A Discrete-Event Network Simulator
API
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 
23 #include "ns3/lte-stats-calculator.h"
24 #include "ns3/nstime.h"
25 #include "ns3/spectrum-value.h"
26 #include "ns3/uinteger.h"
27 
28 #include <fstream>
29 #include <string>
30 
31 namespace ns3
32 {
33 
59 {
60  public:
65 
69  ~PhyStatsCalculator() override;
70 
71  // Inherited from ns3::Object
76  static TypeId GetTypeId();
77 
83  void SetCurrentCellRsrpSinrFilename(std::string filename);
84 
89  std::string GetCurrentCellRsrpSinrFilename();
90 
96  void SetUeSinrFilename(std::string filename);
97 
102  std::string GetUeSinrFilename();
103 
109  void SetInterferenceFilename(std::string filename);
110 
115  std::string GetInterferenceFilename();
116 
126  void ReportCurrentCellRsrpSinr(uint16_t cellId,
127  uint64_t imsi,
128  uint16_t rnti,
129  double rsrp,
130  double sinr,
131  uint8_t componentCarrierId);
132 
141  void ReportUeSinr(uint16_t cellId,
142  uint64_t imsi,
143  uint16_t rnti,
144  double sinrLinear,
145  uint8_t componentCarrierId);
146 
152  void ReportInterference(uint16_t cellId, Ptr<SpectrumValue> interference);
153 
166  std::string path,
167  uint16_t cellId,
168  uint16_t rnti,
169  double rsrp,
170  double sinr,
171  uint8_t componentCarrierId);
172 
183  static void ReportUeSinr(Ptr<PhyStatsCalculator> phyStats,
184  std::string path,
185  uint16_t cellId,
186  uint16_t rnti,
187  double sinrLinear,
188  uint8_t componentCarrierId);
189 
198  static void ReportInterference(Ptr<PhyStatsCalculator> phyStats,
199  std::string path,
200  uint16_t cellId,
201  Ptr<SpectrumValue> interference);
202 
203  private:
211 
219 
227 
231  std::string m_RsrpSinrFilename;
232 
236  std::string m_ueSinrFilename;
237 
242 
246  std::ofstream m_rsrpOutFile;
247 
251  std::ofstream m_ueSinrOutFile;
252 
256  std::ofstream m_interferenceOutFile;
257 };
258 
259 } // namespace ns3
260 
261 #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.
a unique identifier for an interface.
Definition: type-id.h:60
Every class exported by the ns3 library is enclosed in the ns3 namespace.