5G-LENA nr-v3.3-161-gad18933f
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-error-model.h
1// Copyright (c) 2018 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
2//
3// SPDX-License-Identifier: GPL-2.0-only
4
5#ifndef NRERRORMODEL_H
6#define NRERRORMODEL_H
7
8#include "nr-mimo-chunk-processor.h"
9
10#include "ns3/object.h"
11#include "ns3/spectrum-value.h"
12
13#include <vector>
14
15namespace ns3
16{
17
23struct NrErrorModelOutput : public SimpleRefCount<NrErrorModelOutput>
24{
29
34 NrErrorModelOutput(double tbler)
35 : m_tbler(tbler)
36 {
37 }
38
43 {
44 }
45
46 double m_tbler{0.0};
47};
48
71class NrErrorModel : public Object
72{
73 public:
78 static TypeId GetTypeId();
79
84
88 ~NrErrorModel() override;
89
96 enum Mode
97 {
99 UL
100 };
101
109 typedef std::vector<Ptr<NrErrorModelOutput>> NrErrorModelHistory;
110
130 virtual Ptr<NrErrorModelOutput> GetTbDecodificationStats(
131 const SpectrumValue& sinr,
132 const std::vector<int>& map,
133 uint32_t size,
134 uint8_t mcs,
135 const NrErrorModelHistory& history) = 0;
136
142 virtual double GetSpectralEfficiencyForCqi(uint8_t cqi) = 0;
143
149 virtual double GetSpectralEfficiencyForMcs(uint8_t mcs) const = 0;
150
160 virtual uint32_t GetPayloadSize(uint32_t usefulSc,
161 uint8_t mcs,
162 uint8_t rank,
163 uint32_t rbNum,
164 Mode mode) const = 0;
165
173 virtual uint32_t GetMaxCbSize(uint32_t tbSize, uint8_t mcs) const = 0;
174
180 virtual uint8_t GetMaxMcs() const = 0;
181
191 virtual Ptr<NrErrorModelOutput> GetTbDecodificationStatsMimo(
192 const std::vector<MimoSinrChunk>& mimoChunks,
193 const std::vector<int>& map,
194 uint32_t size,
195 uint8_t mcs,
196 uint8_t rank,
197 const NrErrorModelHistory& history);
198
202 virtual NrSinrMatrix ComputeAvgSinrMimo(const std::vector<MimoSinrChunk>& sinrChunks);
203
214 std::vector<int> CreateVectorizedRbMap(std::vector<int> map, uint8_t rank);
215};
216
217} // namespace ns3
218#endif // NRERRORMODEL_H
Interface for calculating the error probability for a transport block.
virtual uint32_t GetMaxCbSize(uint32_t tbSize, uint8_t mcs) const =0
Get the maximum codeblock size.
virtual Ptr< NrErrorModelOutput > GetTbDecodificationStatsMimo(const std::vector< MimoSinrChunk > &mimoChunks, const std::vector< int > &map, uint32_t size, uint8_t mcs, uint8_t rank, const NrErrorModelHistory &history)
Get an output for the decoding error probability of a given transport block. This method is not purel...
std::vector< Ptr< NrErrorModelOutput > > NrErrorModelHistory
Vector of previous output.
virtual double GetSpectralEfficiencyForMcs(uint8_t mcs) const =0
Get the SpectralEfficiency for a given MCS.
std::vector< int > CreateVectorizedRbMap(std::vector< int > map, uint8_t rank)
Create an equivalent RB index map for vectorized SINR values Matches layer-to-codeword mapping in TR ...
NrErrorModel()
NrErrorModel default constructor.
static TypeId GetTypeId()
GetTypeId.
virtual Ptr< NrErrorModelOutput > GetTbDecodificationStats(const SpectrumValue &sinr, const std::vector< int > &map, uint32_t size, uint8_t mcs, const NrErrorModelHistory &history)=0
Get an output for the decodification error probability of a given transport block.
virtual NrSinrMatrix ComputeAvgSinrMimo(const std::vector< MimoSinrChunk > &sinrChunks)
Compute an average SINR matrix.
Mode
Indicate the mode (UL or DL)
virtual double GetSpectralEfficiencyForCqi(uint8_t cqi)=0
Get the SpectralEfficiency for a given CQI.
virtual uint32_t GetPayloadSize(uint32_t usefulSc, uint8_t mcs, uint8_t rank, uint32_t rbNum, Mode mode) const =0
Get the payload size (in bytes) for a given mcs and resource block number.
~NrErrorModel() override
deconstructor
virtual uint8_t GetMaxMcs() const =0
Get the maximum MCS.
NrSinrMatrix stores the MIMO SINR matrix, with dimension rank x nRbs.
Store the output of an NRErrorModel.
NrErrorModelOutput()=delete
NrErrorModelOutput default constructor (deleted)
virtual ~NrErrorModelOutput()
~NrErrorModelOutput
double m_tbler
Transport Block Error Rate.
NrErrorModelOutput(double tbler)
Official NrErrorModelOutput constructor.