24 #include "ns3/string.h"
25 #include <ns3/simulator.h>
35 : m_dlRxFirstWrite (true),
36 m_ulRxFirstWrite (true)
63 .AddAttribute (
"DlRxOutputFilename",
64 "Name of the file where the downlink results will be saved.",
68 .AddAttribute (
"UlRxOutputFilename",
69 "Name of the file where the uplink results will be saved.",
116 m_dlRxOutFile <<
"% time\tcellId\tIMSI\tRNTI\ttxMode\tlayer\tmcs\tsize\trv\tndi\tcorrect\tccId";
149 m_ulRxOutFile <<
"% time\tcellId\tIMSI\tRNTI\tlayer\tmcs\tsize\trv\tndi\tcorrect\tccId";
172 std::ostringstream pathAndRnti;
173 pathAndRnti << path <<
"/" << params.
m_rnti;
174 std::string pathUePhy = path.substr (0, path.find (
"/ComponentCarrierMapUe"));
175 if (phyRxStats->ExistsImsiPath (pathAndRnti.str ()) ==
true)
177 imsi = phyRxStats->GetImsiPath (pathAndRnti.str ());
182 phyRxStats->SetImsiPath (pathAndRnti.str (), imsi);
186 phyRxStats->DlPhyReception (params);
195 std::ostringstream pathAndRnti;
196 std::string pathEnb = path.substr (0, path.find (
"/ComponentCarrierMap"));
197 pathAndRnti << pathEnb <<
"/LteEnbRrc/UeMap/" << params.
m_rnti;
198 if (phyRxStats->ExistsImsiPath (pathAndRnti.str ()) ==
true)
200 imsi = phyRxStats->GetImsiPath (pathAndRnti.str ());
205 phyRxStats->SetImsiPath (pathAndRnti.str (), imsi);
209 phyRxStats->UlPhyReception (params);
Base class for ***StatsCalculator classes.
std::string GetDlOutputFilename(void)
Get the name of the file where the downlink 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 GetUlOutputFilename(void)
Get the name of the file where the uplink 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 reception.
std::string GetUlRxOutputFilename(void)
Get the name of the file where the UL RX PHY statistics will be stored.
bool m_dlRxFirstWrite
When writing DL RX PHY statistics first time to file, columns description is added.
std::ofstream m_ulRxOutFile
UL RX PHY output trace file.
static TypeId GetTypeId(void)
Register this type.
PhyRxStatsCalculator()
Constructor.
bool m_ulRxFirstWrite
When writing UL RX PHY statistics first time to file, columns description is added.
virtual ~PhyRxStatsCalculator()
Destructor.
static void UlPhyReceptionCallback(Ptr< PhyRxStatsCalculator > phyRxStats, std::string path, PhyReceptionStatParameters params)
trace sink
std::string GetDlRxOutputFilename(void)
Get the name of the file where the DL RX PHY statistics will be stored.
void DlPhyReception(PhyReceptionStatParameters params)
Notifies the stats calculator that an downlink reception has occurred.
void SetDlRxOutputFilename(std::string outputFilename)
Set the name of the file where the DL RX PHY statistics will be stored.
static void DlPhyReceptionCallback(Ptr< PhyRxStatsCalculator > phyRxStats, std::string path, PhyReceptionStatParameters params)
trace sink
void UlPhyReception(PhyReceptionStatParameters params)
Notifies the stats calculator that an uplink reception has occurred.
void SetUlRxOutputFilename(std::string outputFilename)
Set the name of the file where the UL Rx PHY statistics will be stored.
std::ofstream m_dlRxOutFile
DL RX PHY output trace file.
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.
Ptr< const AttributeAccessor > MakeStringAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeStringChecker(void)
#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.
PhyReceptionStatParameters structure.
uint8_t m_txMode
the transmission Mode
uint8_t m_rv
the redundancy version (HARQ)
uint8_t m_layer
the layer (cw) of the transmission
uint64_t m_imsi
IMSI of the scheduled UE.
uint8_t m_correctness
correctness of the TB received
uint16_t m_rnti
C-RNTI scheduled.
uint16_t m_cellId
Cell ID of the attached Enb.
uint8_t m_ndi
new data indicator flag
uint8_t m_mcs
MCS for transport block.
int64_t m_timestamp
in millisecond
uint16_t m_size
Size of transport block.
uint8_t m_ccId
component carrier id