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

Static Public Member Functions

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

Private Attributes

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

Additional Inherited Members

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

Detailed Description

Takes care of storing the information generated at PHY layer.

Introspection did not find any typical Config paths.

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


Attributes

  • DlRsrpSinrFilename: Name of the file where the RSRP/SINR statistics will be saved.
    • Set with class: StringValue
    • Underlying type:
    • Initial value: DlRsrpSinrStats.txt
    • Flags: construct write
  • UlSinrFilename: Name of the file where the UE SINR statistics will be saved.
    • Set with class: StringValue
    • Underlying type:
    • Initial value: UlSinrStats.txt
    • Flags: construct write
  • UlInterferenceFilename: Name of the file where the interference statistics will be saved.
    • Set with class: StringValue
    • Underlying type:
    • Initial value: UlInterferenceStats.txt
    • Flags: construct write

No TraceSources are defined for this type.
Size of this type is 176 bytes (on a 64-bit architecture).

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

Constructor & Destructor Documentation

ns3::PhyStatsCalculator::PhyStatsCalculator ( )

Constructor.

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

References NS_LOG_FUNCTION.

ns3::PhyStatsCalculator::~PhyStatsCalculator ( )
virtual

Destructor.

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

References NS_LOG_FUNCTION.

Member Function Documentation

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

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 80 of file phy-stats-calculator.cc.

References m_RsrpSinrFilename.

Referenced by ReportCurrentCellRsrpSinr().

+ Here is the caller graph for this function:

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

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 104 of file phy-stats-calculator.cc.

References m_interferenceFilename.

Referenced by ReportInterference().

+ Here is the caller graph for this function:

TypeId ns3::PhyStatsCalculator::GetTypeId ( void  )
static

Register this type.

Returns
The object TypeId.

Definition at line 48 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:

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

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 92 of file phy-stats-calculator.cc.

References m_ueSinrFilename.

Referenced by ReportUeSinr().

+ Here is the caller graph for this function:

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 112 of file phy-stats-calculator.cc.

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

+ Here is the call graph for this function:

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 226 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:

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 190 of file phy-stats-calculator.cc.

References GetInterferenceFilename(), ns3::Time::GetNanoSeconds(), m_InterferenceFirstWrite, 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:

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 271 of file phy-stats-calculator.cc.

References NS_LOG_FUNCTION.

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 152 of file phy-stats-calculator.cc.

References ns3::Time::GetNanoSeconds(), GetUeSinrFilename(), m_UeSinrFirstWrite, 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:

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 247 of file phy-stats-calculator.cc.

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

+ Here is the call graph for this function:

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 74 of file phy-stats-calculator.cc.

References m_RsrpSinrFilename.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

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 98 of file phy-stats-calculator.cc.

References m_interferenceFilename.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

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 86 of file phy-stats-calculator.cc.

References m_ueSinrFilename.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Member Data Documentation

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

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

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

Referenced by GetInterferenceFilename(), and SetInterferenceFilename().

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 207 of file phy-stats-calculator.h.

Referenced by ReportInterference().

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

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

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

Referenced by GetCurrentCellRsrpSinrFilename(), and SetCurrentCellRsrpSinrFilename().

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 191 of file phy-stats-calculator.h.

Referenced by ReportCurrentCellRsrpSinr().

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

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

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

Referenced by GetUeSinrFilename(), and SetUeSinrFilename().

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 199 of file phy-stats-calculator.h.

Referenced by ReportUeSinr().


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