24 #include "ns3/string.h"
26 #include <ns3/simulator.h>
36 : m_dlTxFirstWrite(true),
37 m_ulTxFirstWrite(true)
60 TypeId(
"ns3::PhyTxStatsCalculator")
64 .AddAttribute(
"DlTxOutputFilename",
65 "Name of the file where the downlink results will be saved.",
69 .AddAttribute(
"UlTxOutputFilename",
70 "Name of the file where the uplink results will be saved.",
118 m_dlTxOutFile <<
"% time\tcellId\tIMSI\tRNTI\tlayer\tmcs\tsize\trv\tndi\tccId";
153 m_ulTxOutFile <<
"% time\tcellId\tIMSI\tRNTI\tlayer\tmcs\tsize\trv\tndi\tccId";
177 std::ostringstream pathAndRnti;
178 std::string pathEnb = path.substr(0, path.find(
"/ComponentCarrierMap"));
179 pathAndRnti << pathEnb <<
"/LteEnbRrc/UeMap/" <<
params.m_rnti;
180 if (phyTxStats->ExistsImsiPath(pathAndRnti.str()))
182 imsi = phyTxStats->GetImsiPath(pathAndRnti.str());
187 phyTxStats->SetImsiPath(pathAndRnti.str(), imsi);
191 phyTxStats->DlPhyTransmission(
params);
201 std::ostringstream pathAndRnti;
202 pathAndRnti << path <<
"/" <<
params.m_rnti;
203 std::string pathUePhy = path.substr(0, path.find(
"/ComponentCarrierMapUe"));
204 if (phyTxStats->ExistsImsiPath(pathAndRnti.str()))
206 imsi = phyTxStats->GetImsiPath(pathAndRnti.str());
211 phyTxStats->SetImsiPath(pathAndRnti.str(), imsi);
215 phyTxStats->UlPhyTransmission(
params);
Base class for ***StatsCalculator classes.
std::string GetUlOutputFilename()
Get the name of the file where the uplink statistics will be stored.
void SetDlOutputFilename(std::string outputFilename)
Set the name of the file where the downlink statistics will be stored.
static uint64_t FindImsiFromEnbRlcPath(std::string path)
Retrieves IMSI from Enb RLC path in the attribute system.
void SetUlOutputFilename(std::string outputFilename)
Set the name of the file where the uplink statistics will be stored.
std::string GetDlOutputFilename()
Get the name of the file where the downlink statistics will be stored.
static uint64_t FindImsiFromLteNetDevice(std::string path)
Retrieves IMSI from LteNetDevice path in the attribute system.
Takes care of storing the information generated at PHY layer regarding transmission.
bool m_ulTxFirstWrite
When writing UL TX PHY statistics first time to file, columns description is added.
void SetDlTxOutputFilename(std::string outputFilename)
Set the name of the file where the DL TX PHY statistics will be stored.
void SetUlTxOutputFilename(std::string outputFilename)
Set the name of the file where the UL Tx PHY statistics will be stored.
bool m_dlTxFirstWrite
When writing DL TX PHY statistics first time to file, columns description is added.
static void DlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
PhyTxStatsCalculator()
Constructor.
std::ofstream m_ulTxOutFile
UL TX PHY statistics output trace file.
void DlPhyTransmission(PhyTransmissionStatParameters params)
Notifies the stats calculator that an downlink transmission has occurred.
std::string GetDlTxOutputFilename()
Get the name of the file where the DL TX PHY statistics will be stored.
std::ofstream m_dlTxOutFile
DL TX PHY statistics output trace file.
void UlPhyTransmission(PhyTransmissionStatParameters params)
Notifies the stats calculator that an uplink transmission has occurred.
std::string GetUlTxOutputFilename()
Get the name of the file where the UL RX PHY statistics will be stored.
static TypeId GetTypeId()
Register this type.
static void UlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
~PhyTxStatsCalculator() override
Destructor.
Smart pointer class similar to boost::intrusive_ptr.
Hold variables of type string.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeStringChecker()
Ptr< const AttributeAccessor > MakeStringAccessor(T1 a1)
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
PhyTransmissionStatParameters structure.