|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
24 #include "ns3/string.h"
25 #include <ns3/simulator.h>
35 : m_dlTxFirstWrite (true),
36 m_ulTxFirstWrite (true)
54 .AddAttribute (
"DlTxOutputFilename",
55 "Name of the file where the downlink results will be saved.",
59 .AddAttribute (
"UlTxOutputFilename",
60 "Name of the file where the uplink results will be saved.",
98 std::ofstream outFile;
102 if (!outFile.is_open ())
108 outFile <<
"% time\tcellId\tIMSI\tRNTI\tlayer\tmcs\tsize\trv\tndi\tccId";
109 outFile << std::endl;
114 if (!outFile.is_open ())
122 outFile << (uint32_t) params.
m_cellId <<
"\t";
123 outFile << params.
m_imsi <<
"\t";
124 outFile << params.
m_rnti <<
"\t";
126 outFile << (uint32_t) params.
m_layer <<
"\t";
127 outFile << (uint32_t) params.
m_mcs <<
"\t";
128 outFile << params.
m_size <<
"\t";
129 outFile << (uint32_t) params.
m_rv <<
"\t";
130 outFile << (uint32_t) params.
m_ndi <<
"\t";
131 outFile << (uint32_t) params.
m_ccId << std::endl;
141 std::ofstream outFile;
145 if (!outFile.is_open ())
152 outFile <<
"% time\tcellId\tIMSI\tRNTI\tlayer\tmcs\tsize\trv\tndi\tccId";
153 outFile << std::endl;
158 if (!outFile.is_open ())
166 outFile << (uint32_t) params.
m_cellId <<
"\t";
167 outFile << params.
m_imsi <<
"\t";
168 outFile << params.
m_rnti <<
"\t";
170 outFile << (uint32_t) params.
m_layer <<
"\t";
171 outFile << (uint32_t) params.
m_mcs <<
"\t";
172 outFile << params.
m_size <<
"\t";
173 outFile << (uint32_t) params.
m_rv <<
"\t";
174 outFile << (uint32_t) params.
m_ndi <<
"\t";
175 outFile << (uint32_t) params.
m_ccId << std::endl;
185 std::ostringstream pathAndRnti;
186 std::string pathEnb = path.substr (0, path.find (
"/ComponentCarrierMap"));
187 pathAndRnti << pathEnb <<
"/LteEnbRrc/UeMap/" << params.
m_rnti;
188 if (phyTxStats->ExistsImsiPath (pathAndRnti.str ()) ==
true)
190 imsi = phyTxStats->GetImsiPath (pathAndRnti.str ());
195 phyTxStats->SetImsiPath (pathAndRnti.str (), imsi);
199 phyTxStats->DlPhyTransmission (params);
208 std::ostringstream pathAndRnti;
209 pathAndRnti << path <<
"/" << params.
m_rnti;
210 std::string pathUePhy = path.substr (0, path.find (
"/ComponentCarrierMapUe"));
211 if (phyTxStats->ExistsImsiPath (pathAndRnti.str ()) ==
true)
213 imsi = phyTxStats->GetImsiPath (pathAndRnti.str ());
218 phyTxStats->SetImsiPath (pathAndRnti.str (), imsi);
222 phyTxStats->UlPhyTransmission (params);
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint8_t m_ccId
component carrier id
#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.
void SetDlOutputFilename(std::string outputFilename)
Set the name of the file where the downlink statistics will be stored.
PhyTxStatsCalculator()
Constructor.
static uint64_t FindImsiFromLteNetDevice(std::string path)
Retrieves IMSI from LteNetDevice path in the attribute system.
static void DlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
uint64_t m_imsi
IMSI of the scheduled UE.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Base class for ***StatsCalculator classes.
bool m_dlTxFirstWrite
When writing DL TX PHY statistics first time to file, columns description is added.
Smart pointer class similar to boost::intrusive_ptr.
std::string GetDlTxOutputFilename(void)
Get the name of the file where the DL TX PHY statistics will be stored.
uint8_t m_rv
the redundancy version (HARQ)
virtual ~PhyTxStatsCalculator()
Destructor.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
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.
std::string GetUlOutputFilename(void)
Get the name of the file where the uplink statistics will be stored.
uint8_t m_mcs
MCS for transport block.
void DlPhyTransmission(PhyTransmissionStatParameters params)
Notifies the stats calculator that an downlink transmission has occurred.
uint16_t m_size
Size of transport block.
uint16_t m_cellId
Cell ID of the attached Enb.
Hold variables of type string.
std::string GetUlTxOutputFilename(void)
Get the name of the file where the UL RX PHY statistics will be stored.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
std::string GetDlOutputFilename(void)
Get the name of the file where the downlink statistics will be stored.
void SetDlTxOutputFilename(std::string outputFilename)
Set the name of the file where the DL TX PHY statistics will be stored.
static void UlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
uint8_t m_layer
the layer (cw) of the transmission
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void SetUlTxOutputFilename(std::string outputFilename)
Set the name of the file where the UL Tx PHY statistics will be stored.
uint8_t m_ndi
new data indicator flag
static uint64_t FindImsiFromEnbRlcPath(std::string path)
Retrieves IMSI from Enb RLC path in the attribute system.
Ptr< const AttributeChecker > MakeStringChecker(void)
uint16_t m_rnti
C-RNTI scheduled.
int64_t m_timestamp
in millisecond
PhyTransmissionStatParameters structure.
static TypeId GetTypeId(void)
Register this type.
void SetUlOutputFilename(std::string outputFilename)
Set the name of the file where the uplink statistics will be stored.
void UlPhyTransmission(PhyTransmissionStatParameters params)
Notifies the stats calculator that an uplink transmission has occurred.
Ptr< const AttributeAccessor > MakeStringAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.