22 #include "ns3/string.h" 
   23 #include <ns3/simulator.h> 
   33   : m_dlFirstWrite (true),
 
   50     .AddConstructor<MacStatsCalculator> ()
 
   51     .AddAttribute (
"DlOutputFilename",
 
   52                    "Name of the file where the downlink results will be saved.",
 
   56     .AddAttribute (
"UlOutputFilename",
 
   57                    "Name of the file where the uplink results will be saved.",
 
   91                                   uint16_t rnti, uint8_t mcsTb1, uint16_t sizeTb1, uint8_t mcsTb2, uint16_t sizeTb2)
 
   93   NS_LOG_FUNCTION (
this << cellId << imsi << frameNo << subframeNo << rnti << (uint32_t) mcsTb1 << sizeTb1 << (uint32_t) mcsTb2 << sizeTb2);
 
   96   std::ofstream outFile;
 
  100       if (!outFile.is_open ())
 
  106       outFile << 
"% time\tcellId\tIMSI\tframe\tsframe\tRNTI\tmcsTb1\tsizeTb1\tmcsTb2\tsizeTb2";
 
  107       outFile << std::endl;
 
  112       if (!outFile.is_open ())
 
  120   outFile << (uint32_t) cellId << 
"\t";
 
  121   outFile << imsi << 
"\t";
 
  122   outFile << frameNo << 
"\t";
 
  123   outFile << subframeNo << 
"\t";
 
  124   outFile << rnti << 
"\t";
 
  125   outFile << (uint32_t) mcsTb1 << 
"\t";
 
  126   outFile << sizeTb1 << 
"\t";
 
  127   outFile << (uint32_t) mcsTb2 << 
"\t";
 
  128   outFile << sizeTb2 << std::endl;
 
  134                                   uint32_t subframeNo, uint16_t rnti,uint8_t mcs, uint16_t size)
 
  136   NS_LOG_FUNCTION (
this << cellId << imsi << frameNo << subframeNo << rnti << (uint32_t) mcs << size);
 
  139   std::ofstream outFile;
 
  143       if (!outFile.is_open ())
 
  149       outFile << 
"% time\tcellId\tIMSI\tframe\tsframe\tRNTI\tmcs\tsize";
 
  150       outFile << std::endl;
 
  155       if (!outFile.is_open ())
 
  163   outFile << (uint32_t) cellId << 
"\t";
 
  164   outFile << imsi << 
"\t";
 
  165   outFile << frameNo << 
"\t";
 
  166   outFile << subframeNo << 
"\t";
 
  167   outFile << rnti << 
"\t";
 
  168   outFile << (uint32_t) mcs << 
"\t";
 
  169   outFile << size << std::endl;
 
  175                       std::string path, uint32_t frameNo, uint32_t subframeNo,
 
  176                       uint16_t rnti, uint8_t mcsTb1, uint16_t sizeTb1,
 
  177                       uint8_t mcsTb2, uint16_t sizeTb2)
 
  181   std::ostringstream pathAndRnti;
 
  182   pathAndRnti << path << 
"/" << rnti;
 
  183   if (macStats->ExistsImsiPath (pathAndRnti.str ()) == 
true)
 
  185       imsi = macStats->GetImsiPath (pathAndRnti.str ());
 
  190       macStats->SetImsiPath (pathAndRnti.str (), imsi);
 
  194   if (macStats->ExistsCellIdPath (pathAndRnti.str ()) == 
true)
 
  196       cellId = macStats->GetCellIdPath (pathAndRnti.str ());
 
  201       macStats->SetCellIdPath (pathAndRnti.str (), cellId);
 
  204   macStats->DlScheduling (cellId, imsi, frameNo, subframeNo, rnti, mcsTb1, sizeTb1, mcsTb2, sizeTb2);
 
  209                       uint32_t frameNo, uint32_t subframeNo, uint16_t rnti,
 
  210                       uint8_t mcs, uint16_t size)
 
  215   std::ostringstream pathAndRnti;
 
  216   pathAndRnti << path << 
"/" << rnti;
 
  217   if (macStats->ExistsImsiPath (pathAndRnti.str ()) == 
true)
 
  219       imsi = macStats->GetImsiPath (pathAndRnti.str ());
 
  224       macStats->SetImsiPath (pathAndRnti.str (), imsi);
 
  227   if (macStats->ExistsCellIdPath (pathAndRnti.str ()) == 
true)
 
  229       cellId = macStats->GetCellIdPath (pathAndRnti.str ());
 
  234       macStats->SetCellIdPath (pathAndRnti.str (), cellId);
 
  237   macStats->UlScheduling (cellId, imsi, frameNo, subframeNo, rnti, mcs, size);
 
smart pointer class similar to boost::intrusive_ptr 
 
#define NS_LOG_FUNCTION(parameters)
 
static uint64_t FindImsiFromEnbMac(std::string path, uint16_t rnti)
 
hold variables of type string 
 
static void DlSchedulingCallback(Ptr< MacStatsCalculator > macStats, std::string path, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcsTb1, uint16_t sizeTb1, uint8_t mcsTb2, uint16_t sizeTb2)
 
static uint16_t FindCellIdFromEnbMac(std::string path, uint16_t rnti)
 
void SetUlOutputFilename(std::string outputFilename)
 
void SetDlOutputFilename(std::string outputFilename)
 
NS_OBJECT_ENSURE_REGISTERED(AntennaModel)
 
static TypeId GetTypeId(void)
 
std::string GetUlOutputFilename(void)
 
void DlScheduling(uint16_t cellId, uint64_t imsi, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcsTb1, uint16_t sizeTb1, uint8_t mcsTb2, uint16_t sizeTb2)
 
void SetDlOutputFilename(std::string outputFilename)
 
std::string GetDlOutputFilename(void)
 
static void UlSchedulingCallback(Ptr< MacStatsCalculator > macStats, std::string path, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t size)
 
int64_t GetNanoSeconds(void) const 
 
std::string GetUlOutputFilename(void)
 
NS_LOG_COMPONENT_DEFINE("PacketLossCounter")
 
#define NS_LOG_ERROR(msg)
 
virtual ~MacStatsCalculator()
 
a unique identifier for an interface. 
 
void SetUlOutputFilename(std::string outputFilename)
 
TypeId SetParent(TypeId tid)
 
void UlScheduling(uint16_t cellId, uint64_t imsi, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t sizeTb)
 
std::string GetDlOutputFilename(void)