OLD | NEW |
(Empty) | |
| 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
| 4 * |
| 5 * This program is free software; you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 2 as |
| 7 * published by the Free Software Foundation; |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software |
| 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 * |
| 18 * Author: Jaume Nin <jnin@cttc.es> |
| 19 * modified by: Marco Miozzo <mmiozzo@cttc.es> |
| 20 * Convert NistMacStatsCalculator in NistPhyRxStatsCalculator |
| 21 * Modified by: NIST |
| 22 */ |
| 23 |
| 24 #ifndef NIST_PHY_RX_STATS_CALCULATOR_H_ |
| 25 #define NIST_PHY_RX_STATS_CALCULATOR_H_ |
| 26 |
| 27 #include "ns3/nist-lte-stats-calculator.h" |
| 28 #include "ns3/nstime.h" |
| 29 #include "ns3/uinteger.h" |
| 30 #include <string> |
| 31 #include <fstream> |
| 32 #include <ns3/nist-lte-common.h> |
| 33 |
| 34 namespace ns3 { |
| 35 |
| 36 /** |
| 37 * \ingroup lte |
| 38 * |
| 39 * Takes care of storing the information generated at PHY layer regarding· |
| 40 * reception. Metrics saved are: |
| 41 * |
| 42 * - Timestamp (in seconds) |
| 43 * - Frame index |
| 44 * - Subframe index |
| 45 * - C-RNTI |
| 46 * - MCS for transport block 1 |
| 47 * - Size of transport block 1 |
| 48 * - MCS for transport block 2 (0 if not used) |
| 49 * - Size of transport block 2 (0 if not used) |
| 50 */ |
| 51 class NistPhyRxStatsCalculator : public NistLteStatsCalculator |
| 52 { |
| 53 public: |
| 54 /** |
| 55 * Constructor |
| 56 */ |
| 57 NistPhyRxStatsCalculator (); |
| 58 |
| 59 /** |
| 60 * Destructor |
| 61 */ |
| 62 virtual ~NistPhyRxStatsCalculator (); |
| 63 |
| 64 // Inherited from ns3::Object |
| 65 /** |
| 66 * Register this type. |
| 67 * \return The object TypeId. |
| 68 */ |
| 69 static TypeId GetTypeId (void); |
| 70 |
| 71 /** |
| 72 * Set the name of the file where the UL Rx PHY statistics will be stored. |
| 73 * |
| 74 * \param outputFilename string with the name of the file |
| 75 */ |
| 76 void SetUlRxOutputFilename (std::string outputFilename); |
| 77 |
| 78 /** |
| 79 * Get the name of the file where the UL RX PHY statistics will be stored. |
| 80 * @return the name of the file where the UL RX PHY statistics will be stored |
| 81 */ |
| 82 std::string GetUlRxOutputFilename (void); |
| 83 |
| 84 /** |
| 85 * Set the name of the file where the DL RX PHY statistics will be stored. |
| 86 * |
| 87 * @param outputFilename string with the name of the file |
| 88 */ |
| 89 void SetDlRxOutputFilename (std::string outputFilename); |
| 90 |
| 91 /** |
| 92 * Get the name of the file where the DL RX PHY statistics will be stored. |
| 93 * @return the name of the file where the DL RX PHY statistics will be stored |
| 94 */ |
| 95 std::string GetDlRxOutputFilename (void); |
| 96 |
| 97 /** |
| 98 * Set the name of the file where the SL RX PHY statistics will be stored. |
| 99 * |
| 100 * @param outputFilename string with the name of the file |
| 101 */ |
| 102 void SetSlRxOutputFilename (std::string outputFilename); |
| 103 |
| 104 /** |
| 105 * Get the name of the file where the SL RX PHY statistics will be stored. |
| 106 * @return the name of the file where the SL RX PHY statistics will be stored |
| 107 */ |
| 108 std::string GetSlRxOutputFilename (void); |
| 109 |
| 110 /** |
| 111 * Set the name of the file where the SL RX PSCCH statistics will be stored. |
| 112 * |
| 113 * @param outputFilename string with the name of the file |
| 114 */ |
| 115 void SetSlPscchRxOutputFilename (std::string outputFilename); |
| 116 |
| 117 /** |
| 118 * Get the name of the file where the SL RX PSCCH statistics will be stored. |
| 119 * @return the name of the file where the SL RX PHY statistics will be stored |
| 120 */ |
| 121 std::string GetSlPscchRxOutputFilename (void); |
| 122 |
| 123 /** |
| 124 * Notifies the stats calculator that an downlink reception has occurred. |
| 125 * @param params Trace information regarding PHY reception stats |
| 126 */ |
| 127 void DlPhyReception (NistPhyReceptionStatParameters params); |
| 128 |
| 129 /** |
| 130 * Notifies the stats calculator that an uplink reception has occurred. |
| 131 * @param params Trace information regarding PHY reception stats |
| 132 */ |
| 133 void UlPhyReception (NistPhyReceptionStatParameters params); |
| 134 |
| 135 /** |
| 136 * Notifies the stats calculator that an sidelink reception has occurred. |
| 137 * @param params Trace information regarding PHY reception stats |
| 138 */ |
| 139 void SlPhyReception (NistPhyReceptionStatParameters params); |
| 140 ·· |
| 141 /** |
| 142 * Notifies the stats calculator that an sidelink reception has occurred. |
| 143 * @param params Trace information regarding PHY reception stats |
| 144 */ |
| 145 void SlPscchReception (NistPhyReceptionStatParameters params); |
| 146 |
| 147 /**· |
| 148 * trace sink |
| 149 *· |
| 150 * \param phyRxStats· |
| 151 * \param path· |
| 152 * \param params· |
| 153 */ |
| 154 static void DlPhyReceptionCallback (Ptr<NistPhyRxStatsCalculator> phyRxStats, |
| 155 std::string path, NistPhyReceptionStatParameters
params); |
| 156 |
| 157 /**· |
| 158 * trace sink |
| 159 *· |
| 160 * \param phyRxStats· |
| 161 * \param path· |
| 162 * \param params· |
| 163 */ |
| 164 static void UlPhyReceptionCallback (Ptr<NistPhyRxStatsCalculator> phyRxStats, |
| 165 std::string path, NistPhyReceptionStatParameters
params); |
| 166 |
| 167 /**· |
| 168 * trace sink |
| 169 *· |
| 170 * \param phyRxStats· |
| 171 * \param path· |
| 172 * \param params· |
| 173 */ |
| 174 static void SlPhyReceptionCallback (Ptr<NistPhyRxStatsCalculator> phyRxStats, |
| 175 std::string path, NistPhyReceptionStatParameters
params); |
| 176 |
| 177 /**· |
| 178 * trace sink |
| 179 *· |
| 180 * \param phyRxStats· |
| 181 * \param path· |
| 182 * \param params· |
| 183 */ |
| 184 static void SlPscchReceptionCallback (Ptr<NistPhyRxStatsCalculator> phyRxStats
, |
| 185 std::string path, NistPhyReceptionStatParameters
params); |
| 186 private: |
| 187 |
| 188 /** |
| 189 * When writing DL RX PHY statistics first time to file, |
| 190 * columns description is added. Then next lines are |
| 191 * appended to file. This value is true if output |
| 192 * files have not been opened yet |
| 193 */ |
| 194 bool m_dlRxFirstWrite; |
| 195 |
| 196 /** |
| 197 * When writing UL RX PHY statistics first time to file, |
| 198 * columns description is added. Then next lines are |
| 199 * appended to file. This value is true if output |
| 200 * files have not been opened yet |
| 201 */ |
| 202 bool m_ulRxFirstWrite; |
| 203 |
| 204 /** |
| 205 * When writing SL RX PHY statistics first time to file, |
| 206 * columns description is added. Then next lines are |
| 207 * appended to file. This value is true if output |
| 208 * files have not been opened yet |
| 209 */ |
| 210 bool m_slRxFirstWrite; |
| 211 ·· |
| 212 /** |
| 213 * When writing SL RX PSCCH statistics first time to file, |
| 214 * columns description is added. Then next lines are |
| 215 * appended to file. This value is true if output |
| 216 * files have not been opened yet |
| 217 */ |
| 218 bool m_slPscchRxFirstWrite; |
| 219 |
| 220 }; |
| 221 |
| 222 } // namespace ns3 |
| 223 |
| 224 #endif /* NIST_PHY_RX_STATS_CALCULATOR_H_ */ |
OLD | NEW |