24 #include "ns3/string.h"
25 #include <ns3/simulator.h>
37 : m_dlTxFirstWrite (true),
38 m_ulTxFirstWrite (true)
54 .AddConstructor<PhyTxStatsCalculator> ()
55 .AddAttribute (
"DlTxOutputFilename",
56 "Name of the file where the downlink results will be saved.",
60 .AddAttribute (
"UlTxOutputFilename",
61 "Name of the file where the uplink results will be saved.",
99 std::ofstream outFile;
103 if (!outFile.is_open ())
110 outFile <<
"% time\tcellId\tIMSI\tRNTI\tlayer\tmcs\tsize\trv\tndi";
111 outFile << std::endl;
116 if (!outFile.is_open ())
125 outFile << (uint32_t) params.
m_cellId <<
"\t";
126 outFile << params.
m_imsi <<
"\t";
127 outFile << params.
m_rnti <<
"\t";
129 outFile << (uint32_t) params.
m_layer <<
"\t";
130 outFile << (uint32_t) params.
m_mcs <<
"\t";
131 outFile << params.
m_size <<
"\t";
132 outFile << (uint32_t) params.
m_rv <<
"\t";
133 outFile << (uint32_t) params.
m_ndi << std::endl;
143 std::ofstream outFile;
147 if (!outFile.is_open ())
154 outFile <<
"% time\tcellId\tIMSI\tRNTI\tlayer\tmcs\tsize\trv\tndi";
155 outFile << std::endl;
160 if (!outFile.is_open ())
169 outFile << (uint32_t) params.
m_cellId <<
"\t";
170 outFile << params.
m_imsi <<
"\t";
171 outFile << params.
m_rnti <<
"\t";
173 outFile << (uint32_t) params.
m_layer <<
"\t";
174 outFile << (uint32_t) params.
m_mcs <<
"\t";
175 outFile << params.
m_size <<
"\t";
176 outFile << (uint32_t) params.
m_rv <<
"\t";
177 outFile << (uint32_t) params.
m_ndi << std::endl;
187 std::ostringstream pathAndRnti;
188 pathAndRnti << path <<
"/" << params.
m_rnti;
189 if (phyTxStats->ExistsImsiPath (pathAndRnti.str ()) ==
true)
191 imsi = phyTxStats->GetImsiPath (pathAndRnti.str ());
196 phyTxStats->SetImsiPath (pathAndRnti.str (), imsi);
200 phyTxStats->DlPhyTransmission (params);
209 std::ostringstream pathAndRnti;
210 pathAndRnti << path <<
"/" << params.
m_rnti;
211 if (phyTxStats->ExistsImsiPath (pathAndRnti.str ()) ==
true)
213 imsi = phyTxStats->GetImsiPath (pathAndRnti.str ());
218 phyTxStats->SetImsiPath (pathAndRnti.str (), imsi);
222 phyTxStats->UlPhyTransmission (params);
Doxygen introspection did not find any typical Config paths.
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
hold variables of type string
PhyTxStatsCalculator()
Constructor.
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
uint8_t m_rv
the redundancy version (HARQ)
void SetUlOutputFilename(std::string outputFilename)
Set the name of the file where the uplink statistics will be stored.
uint64_t m_imsi
IMSI of the scheduled UE.
static uint64_t FindImsiForEnb(std::string path, uint16_t rnti)
void SetDlTxOutputFilename(std::string outputFilename)
Set the name of the file where the DL TX PHY statistics will be stored.
std::string GetDlTxOutputFilename(void)
Get the name of the file where the DL TX PHY statistics will be stored.
void DlPhyTransmission(PhyTransmissionStatParameters params)
Notifies the stats calculator that an downlink trasmission has occurred.
uint8_t m_mcs
MCS for transport block.
std::string GetUlTxOutputFilename(void)
Get the name of the file where the UL RX PHY statistics will be stored.
std::string GetUlOutputFilename(void)
Get the name of the file where the uplink statistics will be stored.
static void DlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
void SetDlOutputFilename(std::string outputFilename)
Set the name of the file where the downlink statistics will be stored.
static uint64_t FindImsiForUe(std::string path, uint16_t rnti)
uint16_t m_size
Size of transport block.
virtual ~PhyTxStatsCalculator()
Destructor.
uint8_t m_ndi
new data indicator flag
static void UlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
uint16_t m_cellId
Cell ID of the attached Enb.
uint8_t m_layer
the layer (cw) of the transmission
void SetUlTxOutputFilename(std::string outputFilename)
Set the name of the file where the UL Tx PHY statistics will be stored.
#define NS_LOG_ERROR(msg)
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
uint16_t m_rnti
C-RNTI scheduled.
static TypeId GetTypeId(void)
void UlPhyTransmission(PhyTransmissionStatParameters params)
Notifies the stats calculator that an uplink trasmission has occurred.
std::string GetDlOutputFilename(void)
Get the name of the file where the downlink statistics will be stored.