A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::PhyStatsCalculator Class Reference

Takes care of storing the information generated at PHY layer. More...

#include "phy-stats-calculator.h"

+ Inheritance diagram for ns3::PhyStatsCalculator:
+ Collaboration diagram for ns3::PhyStatsCalculator:

Public Member Functions

 PhyStatsCalculator ()
 Constructor.
 
 ~PhyStatsCalculator () override
 Destructor.
 
std::string GetCurrentCellRsrpSinrFilename ()
 Get the name of the file where the RSRP/SINR statistics will be stored.
 
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 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 ReportInterference (uint16_t cellId, Ptr< SpectrumValue > interference)
 Notifies the stats calculator that an interference report has occurred.
 
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.
 
void SetCurrentCellRsrpSinrFilename (std::string filename)
 Set the name of the file where the RSRP/SINR statistics will be stored.
 
void SetInterferenceFilename (std::string filename)
 Set the name of the file where the interference statistics will be stored.
 
void SetUeSinrFilename (std::string filename)
 Set the name of the file where the UE SINR statistics will be stored.
 
- Public Member Functions inherited from ns3::LteStatsCalculator
 LteStatsCalculator ()
 Constructor.
 
 ~LteStatsCalculator () override
 Destructor.
 
bool ExistsCellIdPath (std::string path)
 Checks if there is an already stored cell id for the given path.
 
bool ExistsImsiPath (std::string path)
 Checks if there is an already stored IMSI for the given path.
 
uint16_t GetCellIdPath (std::string path)
 Retrieves the cell id information for the given path.
 
std::string GetDlOutputFilename ()
 Get the name of the file where the downlink statistics will be stored.
 
uint64_t GetImsiPath (std::string path)
 Retrieves the imsi information for the given path.
 
std::string GetUlOutputFilename ()
 Get the name of the file where the uplink statistics will be stored.
 
void SetCellIdPath (std::string path, uint16_t cellId)
 Stores the (path, cellId) pairs in a map.
 
void SetDlOutputFilename (std::string outputFilename)
 Set the name of the file where the downlink statistics will be stored.
 
void SetImsiPath (std::string path, uint64_t imsi)
 Stores the (path, imsi) pairs in a map.
 
void SetUlOutputFilename (std::string outputFilename)
 Set the name of the file where the uplink statistics will be stored.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Register this type.
 
static void ReportCurrentCellRsrpSinrCallback (Ptr< PhyStatsCalculator > phyStats, std::string path, uint16_t cellId, uint16_t rnti, double rsrp, double sinr, uint8_t componentCarrierId)
 trace sink
 
static void ReportInterference (Ptr< PhyStatsCalculator > phyStats, std::string path, uint16_t cellId, Ptr< SpectrumValue > interference)
 trace sink
 
static void ReportUeSinr (Ptr< PhyStatsCalculator > phyStats, std::string path, uint16_t cellId, uint16_t rnti, double sinrLinear, uint8_t componentCarrierId)
 trace sink
 
- Static Public Member Functions inherited from ns3::LteStatsCalculator
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Private Attributes

std::string m_interferenceFilename
 Name of the file where the interference statistics will be saved.
 
bool m_InterferenceFirstWrite
 When writing interference statistics first time to file, columns description is added.
 
std::ofstream m_interferenceOutFile
 Interference statistics output trace file.
 
std::ofstream m_rsrpOutFile
 RSRP statistics output trace file.
 
std::string m_RsrpSinrFilename
 Name of the file where the RSRP/SINR statistics will be saved.
 
bool m_RsrpSinrFirstWrite
 When writing RSRP SINR statistics first time to file, columns description is added.
 
std::string m_ueSinrFilename
 Name of the file where the UE SINR statistics will be saved.
 
bool m_UeSinrFirstWrite
 When writing UE SINR statistics first time to file, columns description is added.
 
std::ofstream m_ueSinrOutFile
 UE SINR statistics output trace file.
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 
- Static Protected Member Functions inherited from ns3::LteStatsCalculator
static uint16_t FindCellIdFromEnbMac (std::string path, uint16_t rnti)
 Retrieves CellId from Enb MAC path in the attribute system.
 
static uint16_t FindCellIdFromEnbRlcPath (std::string path)
 Retrieves CellId from Enb RLC path in the attribute system.
 
static uint64_t FindImsiForEnb (std::string path, uint16_t rnti)
 Retrieves IMSI from path for Enb in the attribute system.
 
static uint64_t FindImsiForUe (std::string path, uint16_t rnti)
 Retrieves IMSI from path for Ue in the attribute system.
 
static uint64_t FindImsiFromEnbMac (std::string path, uint16_t rnti)
 Retrieves IMSI from Enb MAC path in the attribute system.
 
static uint64_t FindImsiFromEnbRlcPath (std::string path)
 Retrieves IMSI from Enb RLC path in the attribute system.
 
static uint64_t FindImsiFromLteNetDevice (std::string path)
 Retrieves IMSI from LteNetDevice path in the attribute system.
 
static uint64_t FindImsiFromUePhy (std::string path)
 Retrieves IMSI from Ue PHY path in the attribute system.
 

Detailed Description

Takes care of storing the information generated at PHY layer.

Metrics saved are:

  • RSRP and average SINR for DL
    • Timestamp (in seconds)
    • IMSI
    • C-RNTI
    • RSRP
    • SINR
    • componentCarrierId
  • UE SINR
    • Timestamp (in seconds)
    • Cell ID of the reported Enb
    • IMSI
    • C-RNTI
    • measured and reported SINR value in linear
    • componentCarrierId
  • Interference for UL
    • Cell ID of the reported Enb
    • IMSI of the scheduled UE
    • C-RNTI scheduled
    • Measured interference for each RB

Definition at line 48 of file phy-stats-calculator.h.

Constructor & Destructor Documentation

◆ PhyStatsCalculator()

ns3::PhyStatsCalculator::PhyStatsCalculator ( )

Constructor.

Definition at line 24 of file phy-stats-calculator.cc.

References NS_LOG_FUNCTION.

◆ ~PhyStatsCalculator()

ns3::PhyStatsCalculator::~PhyStatsCalculator ( )
override

Destructor.

Definition at line 32 of file phy-stats-calculator.cc.

References m_interferenceOutFile, m_rsrpOutFile, m_ueSinrOutFile, and NS_LOG_FUNCTION.

Member Function Documentation

◆ GetCurrentCellRsrpSinrFilename()

std::string ns3::PhyStatsCalculator::GetCurrentCellRsrpSinrFilename ( )

Get the name of the file where the RSRP/SINR statistics will be stored.

Returns
the name of the file where the RSRP/SINR statistics will be stored

Definition at line 84 of file phy-stats-calculator.cc.

References m_RsrpSinrFilename.

Referenced by ReportCurrentCellRsrpSinr().

+ Here is the caller graph for this function:

◆ GetInterferenceFilename()

std::string ns3::PhyStatsCalculator::GetInterferenceFilename ( )

Get the name of the file where the interference statistics will be stored.

Returns
the name of the file where the interference statistics will be stored

Definition at line 108 of file phy-stats-calculator.cc.

References m_interferenceFilename.

Referenced by ReportInterference().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::PhyStatsCalculator::GetTypeId ( )
static

Register this type.

Returns
The object TypeId.

Definition at line 52 of file phy-stats-calculator.cc.

References ns3::MakeStringAccessor(), ns3::MakeStringChecker(), SetCurrentCellRsrpSinrFilename(), SetInterferenceFilename(), ns3::TypeId::SetParent(), and SetUeSinrFilename().

+ Here is the call graph for this function:

◆ GetUeSinrFilename()

std::string ns3::PhyStatsCalculator::GetUeSinrFilename ( )

Get the name of the file where the UE SINR statistics will be stored.

Returns
the name of the file where the UE SINR statistics will be stored

Definition at line 96 of file phy-stats-calculator.cc.

References m_ueSinrFilename.

Referenced by ReportUeSinr().

+ Here is the caller graph for this function:

◆ ReportCurrentCellRsrpSinr()

void ns3::PhyStatsCalculator::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.

Parameters
cellIdCellId for which stats are generated
imsiIMSI of the scheduled UE
rntiC-RNTI scheduled
rsrpReference Signal Received Power
sinrSINR averaged among RBs
componentCarrierId

Definition at line 114 of file phy-stats-calculator.cc.

References GetCurrentCellRsrpSinrFilename(), ns3::Time::GetSeconds(), m_rsrpOutFile, m_RsrpSinrFirstWrite, ns3::Simulator::Now(), NS_LOG_ERROR, NS_LOG_FUNCTION, and NS_LOG_INFO.

+ Here is the call graph for this function:

◆ ReportCurrentCellRsrpSinrCallback()

void ns3::PhyStatsCalculator::ReportCurrentCellRsrpSinrCallback ( Ptr< PhyStatsCalculator > phyStats,
std::string path,
uint16_t cellId,
uint16_t rnti,
double rsrp,
double sinr,
uint8_t componentCarrierId )
static

trace sink

Parameters
phyStats
path
cellId
rnti
rsrp
sinr
componentCarrierId

Definition at line 201 of file phy-stats-calculator.cc.

References ns3::LteStatsCalculator::FindImsiFromLteNetDevice(), and NS_LOG_FUNCTION.

Referenced by ns3::LteHelper::EnableDlPhyTraces().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReportInterference() [1/2]

void ns3::PhyStatsCalculator::ReportInterference ( Ptr< PhyStatsCalculator > phyStats,
std::string path,
uint16_t cellId,
Ptr< SpectrumValue > interference )
static

trace sink

Parameters
phyStats
path
cellId
interference

Definition at line 254 of file phy-stats-calculator.cc.

References NS_LOG_FUNCTION.

◆ ReportInterference() [2/2]

void ns3::PhyStatsCalculator::ReportInterference ( uint16_t cellId,
Ptr< SpectrumValue > interference )

Notifies the stats calculator that an interference report has occurred.

Parameters
cellIdCell ID of the reported Enb
interferenceMeasured interference for each RB

Definition at line 177 of file phy-stats-calculator.cc.

References GetInterferenceFilename(), ns3::Time::GetSeconds(), m_InterferenceFirstWrite, m_interferenceOutFile, ns3::Simulator::Now(), NS_LOG_ERROR, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by ns3::LteHelper::EnableUlPhyTraces().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReportUeSinr() [1/2]

void ns3::PhyStatsCalculator::ReportUeSinr ( Ptr< PhyStatsCalculator > phyStats,
std::string path,
uint16_t cellId,
uint16_t rnti,
double sinrLinear,
uint8_t componentCarrierId )
static

trace sink

Parameters
phyStats
path
cellId
rnti
sinrLinear
componentCarrierId

Definition at line 226 of file phy-stats-calculator.cc.

References ns3::LteStatsCalculator::FindImsiFromEnbMac(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ ReportUeSinr() [2/2]

void ns3::PhyStatsCalculator::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.

Parameters
cellIdCell ID of the reported Enb
imsiIMSI of the scheduled UE
rntiC-RNTI scheduled
sinrLinearmeasured and reported SINR value in linear
componentCarrierId

Definition at line 147 of file phy-stats-calculator.cc.

References ns3::Time::GetSeconds(), GetUeSinrFilename(), m_UeSinrFirstWrite, m_ueSinrOutFile, ns3::Simulator::Now(), NS_LOG_ERROR, NS_LOG_FUNCTION, and NS_LOG_INFO.

Referenced by ns3::LteHelper::EnableUlPhyTraces().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetCurrentCellRsrpSinrFilename()

void ns3::PhyStatsCalculator::SetCurrentCellRsrpSinrFilename ( std::string filename)

Set the name of the file where the RSRP/SINR statistics will be stored.

Parameters
filenamestring with the name of the file

Definition at line 78 of file phy-stats-calculator.cc.

References m_RsrpSinrFilename.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetInterferenceFilename()

void ns3::PhyStatsCalculator::SetInterferenceFilename ( std::string filename)

Set the name of the file where the interference statistics will be stored.

Parameters
filenamestring with the name of the file

Definition at line 102 of file phy-stats-calculator.cc.

References m_interferenceFilename.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ SetUeSinrFilename()

void ns3::PhyStatsCalculator::SetUeSinrFilename ( std::string filename)

Set the name of the file where the UE SINR statistics will be stored.

Parameters
filenamestring with the name of the file

Definition at line 90 of file phy-stats-calculator.cc.

References m_ueSinrFilename.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_interferenceFilename

std::string ns3::PhyStatsCalculator::m_interferenceFilename
private

Name of the file where the interference statistics will be saved.

Definition at line 231 of file phy-stats-calculator.h.

Referenced by GetInterferenceFilename(), and SetInterferenceFilename().

◆ m_InterferenceFirstWrite

bool ns3::PhyStatsCalculator::m_InterferenceFirstWrite
private

When writing interference statistics first time to file, columns description is added.

Then next lines are appended to file. This value is true if output files have not been opened yet

Definition at line 216 of file phy-stats-calculator.h.

Referenced by ReportInterference().

◆ m_interferenceOutFile

std::ofstream ns3::PhyStatsCalculator::m_interferenceOutFile
private

Interference statistics output trace file.

Definition at line 246 of file phy-stats-calculator.h.

Referenced by ~PhyStatsCalculator(), and ReportInterference().

◆ m_rsrpOutFile

std::ofstream ns3::PhyStatsCalculator::m_rsrpOutFile
private

RSRP statistics output trace file.

Definition at line 236 of file phy-stats-calculator.h.

Referenced by ~PhyStatsCalculator(), and ReportCurrentCellRsrpSinr().

◆ m_RsrpSinrFilename

std::string ns3::PhyStatsCalculator::m_RsrpSinrFilename
private

Name of the file where the RSRP/SINR statistics will be saved.

Definition at line 221 of file phy-stats-calculator.h.

Referenced by GetCurrentCellRsrpSinrFilename(), and SetCurrentCellRsrpSinrFilename().

◆ m_RsrpSinrFirstWrite

bool ns3::PhyStatsCalculator::m_RsrpSinrFirstWrite
private

When writing RSRP SINR statistics first time to file, columns description is added.

Then next lines are appended to file. This value is true if output files have not been opened yet

Definition at line 200 of file phy-stats-calculator.h.

Referenced by ReportCurrentCellRsrpSinr().

◆ m_ueSinrFilename

std::string ns3::PhyStatsCalculator::m_ueSinrFilename
private

Name of the file where the UE SINR statistics will be saved.

Definition at line 226 of file phy-stats-calculator.h.

Referenced by GetUeSinrFilename(), and SetUeSinrFilename().

◆ m_UeSinrFirstWrite

bool ns3::PhyStatsCalculator::m_UeSinrFirstWrite
private

When writing UE SINR statistics first time to file, columns description is added.

Then next lines are appended to file. This value is true if output files have not been opened yet

Definition at line 208 of file phy-stats-calculator.h.

Referenced by ReportUeSinr().

◆ m_ueSinrOutFile

std::ofstream ns3::PhyStatsCalculator::m_ueSinrOutFile
private

UE SINR statistics output trace file.

Definition at line 241 of file phy-stats-calculator.h.

Referenced by ~PhyStatsCalculator(), and ReportUeSinr().


The documentation for this class was generated from the following files: