A Discrete-Event Network Simulator
API
phy-stats-calculator.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Jaume Nin <jnin@cttc.es>
19  */
20 
21 #ifndef PHY_STATS_CALCULATOR_H_
22 #define PHY_STATS_CALCULATOR_H_
23 
24 #include "ns3/lte-stats-calculator.h"
25 #include "ns3/nstime.h"
26 #include "ns3/uinteger.h"
27 #include "ns3/spectrum-value.h"
28 #include <string>
29 #include <fstream>
30 
31 namespace ns3 {
32 
58 {
59 public:
64 
68  virtual ~PhyStatsCalculator ();
69 
70  // Inherited from ns3::Object
75  static TypeId GetTypeId (void);
76 
82  void SetCurrentCellRsrpSinrFilename (std::string filename);
83 
88  std::string GetCurrentCellRsrpSinrFilename (void);
89 
95  void SetUeSinrFilename (std::string filename);
96 
101  std::string GetUeSinrFilename (void);
102 
108  void SetInterferenceFilename (std::string filename);
109 
114  std::string GetInterferenceFilename (void);
115 
125  void ReportCurrentCellRsrpSinr (uint16_t cellId, uint64_t imsi, uint16_t rnti, double rsrp, double sinr, uint8_t componentCarrierId);
126 
135  void ReportUeSinr (uint16_t cellId, uint64_t imsi, uint16_t rnti, double sinrLinear, uint8_t componentCarrierId);
136 
142  void ReportInterference (uint16_t cellId, Ptr<SpectrumValue> interference);
143 
156  std::string path, uint16_t cellId, uint16_t rnti,
157  double rsrp, double sinr, uint8_t componentCarrierId);
158 
169  static void ReportUeSinr (Ptr<PhyStatsCalculator> phyStats, std::string path,
170  uint16_t cellId, uint16_t rnti, double sinrLinear, uint8_t componentCarrierId);
171 
180  static void ReportInterference (Ptr<PhyStatsCalculator> phyStats, std::string path,
181  uint16_t cellId, Ptr<SpectrumValue> interference);
182 
183 
184 private:
192 
200 
208 
212  std::string m_RsrpSinrFilename;
213 
217  std::string m_ueSinrFilename;
218 
223 
227  std::ofstream m_rsrpOutFile;
228 
232  std::ofstream m_ueSinrOutFile;
233 
237  std::ofstream m_interferenceOutFile;
238 };
239 
240 } // namespace ns3
241 
242 #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 GetUeSinrFilename(void)
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.
virtual ~PhyStatsCalculator()
Destructor.
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::string GetInterferenceFilename(void)
Get the name of the file where the interference statistics will be stored.
std::ofstream m_interferenceOutFile
Interference statistics output trace file.
std::ofstream m_ueSinrOutFile
UE SINR statistics output trace file.
static TypeId GetTypeId(void)
Register this type.
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
std::string GetCurrentCellRsrpSinrFilename(void)
Get the name of the file where the RSRP/SINR statistics will be stored.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.