A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
phy-rx-stats-calculator.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Jaume Nin <jnin@cttc.es>
7 * modified by: Marco Miozzo <mmiozzo@cttc.es>
8 * Convert MacStatsCalculator in PhyRxStatsCalculator
9 */
10
11#ifndef PHY_RX_STATS_CALCULATOR_H_
12#define PHY_RX_STATS_CALCULATOR_H_
13
15
16#include "ns3/nstime.h"
17#include "ns3/uinteger.h"
18#include <ns3/lte-common.h>
19
20#include <fstream>
21#include <string>
22
23namespace ns3
24{
25
26/**
27 * \ingroup lte
28 *
29 * Takes care of storing the information generated at PHY layer regarding
30 * reception. Metrics saved are:
31 *
32 * - Timestamp (in seconds)
33 * - Frame index
34 * - Subframe index
35 * - C-RNTI
36 * - MCS for transport block 1
37 * - Size of transport block 1
38 * - MCS for transport block 2 (0 if not used)
39 * - Size of transport block 2 (0 if not used)
40 */
42{
43 public:
44 /**
45 * Constructor
46 */
48
49 /**
50 * Destructor
51 */
52 ~PhyRxStatsCalculator() override;
53
54 // Inherited from ns3::Object
55 /**
56 * Register this type.
57 * \return The object TypeId.
58 */
59 static TypeId GetTypeId();
60
61 /**
62 * Set the name of the file where the UL Rx PHY statistics will be stored.
63 *
64 * \param outputFilename string with the name of the file
65 */
66 void SetUlRxOutputFilename(std::string outputFilename);
67
68 /**
69 * Get the name of the file where the UL RX PHY statistics will be stored.
70 * @return the name of the file where the UL RX PHY statistics will be stored
71 */
72 std::string GetUlRxOutputFilename();
73
74 /**
75 * Set the name of the file where the DL RX PHY statistics will be stored.
76 *
77 * @param outputFilename string with the name of the file
78 */
79 void SetDlRxOutputFilename(std::string outputFilename);
80
81 /**
82 * Get the name of the file where the DL RX PHY statistics will be stored.
83 * @return the name of the file where the DL RX PHY statistics will be stored
84 */
85 std::string GetDlRxOutputFilename();
86
87 /**
88 * Notifies the stats calculator that an downlink reception has occurred.
89 * @param params Trace information regarding PHY reception stats
90 */
92
93 /**
94 * Notifies the stats calculator that an uplink reception has occurred.
95 * @param params Trace information regarding PHY reception stats
96 */
98
99 /**
100 * trace sink
101 *
102 * \param phyRxStats
103 * \param path
104 * \param params
105 */
107 std::string path,
109
110 /**
111 * trace sink
112 *
113 * \param phyRxStats
114 * \param path
115 * \param params
116 */
118 std::string path,
120
121 private:
122 /**
123 * When writing DL RX PHY statistics first time to file,
124 * columns description is added. Then next lines are
125 * appended to file. This value is true if output
126 * files have not been opened yet
127 */
129
130 /**
131 * When writing UL RX PHY statistics first time to file,
132 * columns description is added. Then next lines are
133 * appended to file. This value is true if output
134 * files have not been opened yet
135 */
137
138 /**
139 * DL RX PHY output trace file
140 */
141 std::ofstream m_dlRxOutFile;
142
143 /**
144 * UL RX PHY output trace file
145 */
146 std::ofstream m_ulRxOutFile;
147};
148
149} // namespace ns3
150
151#endif /* PHY_RX_STATS_CALCULATOR_H_ */
Base class for ***StatsCalculator classes.
Takes care of storing the information generated at PHY layer regarding reception.
static TypeId GetTypeId()
Register this type.
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.
bool m_ulRxFirstWrite
When writing UL RX PHY statistics first time to file, columns description is added.
static void UlPhyReceptionCallback(Ptr< PhyRxStatsCalculator > phyRxStats, std::string path, PhyReceptionStatParameters params)
trace sink
std::string GetUlRxOutputFilename()
Get the name of the file where the UL 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.
std::string GetDlRxOutputFilename()
Get the name of the file where the DL RX PHY statistics will be stored.
~PhyRxStatsCalculator() override
Destructor.
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.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.
PhyReceptionStatParameters structure.
Definition lte-common.h:201