5G-LENA nr-v3.3-159-ga6832aa7
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
nr-channel-helper.h
1// Copyright (c) 2024 LASSE / Universidade Federal do Pará (UFPA)
2// Copyright (c) 2024 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3//
4// SPDX-License-Identifier: GPL-2.0-only
5// Author: João Albuquerque <joao.barbosa.albuquerque@itec.ufpa.br>
6
7#ifndef NR_CHANNEL_HELPER_H
8#define NR_CHANNEL_HELPER_H
9
10#include "cc-bwp-helper.h"
11
12#include "ns3/object-factory.h"
13#include "ns3/object.h"
14#include "ns3/spectrum-channel.h"
15
16namespace ns3
17{
18
46class NrChannelHelper : public Object
47{
48 public:
52 enum InitFlags : uint8_t
53 {
55 INIT_FADING = 0x02,
56 };
57
61 NrChannelHelper() = default;
62
68 static TypeId GetTypeId();
69
78 void ConfigureFactories(std::string Scenario = "RMa",
79 std::string Condition = "Default",
80 std::string ChannelModel = "ThreeGpp");
81
87 void ConfigureSpectrumFactory(TypeId specTypeId);
88
94 void ConfigurePropagationFactory(TypeId pathLossTypeId);
95
108 Ptr<SpectrumChannel> CreateChannel(uint8_t flags = INIT_PROPAGATION | INIT_FADING);
109
117 const AttributeValue& v);
118
125 void SetChannelConditionModelAttribute(const std::string& n, const AttributeValue& v);
126
132 void SetPathlossAttribute(const std::string& n, const AttributeValue& v);
133
146 const std::vector<std::reference_wrapper<OperationBandInfo>>& bandInfos,
147 uint8_t flags = INIT_PROPAGATION | INIT_FADING);
148
149 private:
153 enum class Scenario
154 {
155 RMa,
156 UMa,
157 InH_OfficeOpen,
158 InH_OfficeMixed,
159 V2V_Highway,
160 V2V_Urban,
161 UMi,
162 InH,
163 InF,
164 NTN_DenseUrban,
165 NTN_Urban,
166 NTN_Suburban,
167 NTN_Rural,
168 Custom
169 } m_scenario{Scenario::RMa};
170
174 enum class ChannelModel
175 {
176 ThreeGpp,
177 TwoRay,
178 NYU,
179 } m_channelModel{ChannelModel::ThreeGpp};
180
185 enum class Condition
186 {
187 LOS,
188 NLOS,
189 Buildings,
190 Default,
191
192 } m_condition{Condition::Default};
193
198 std::string GetScenario() const;
199
205 std::tuple<TypeId, TypeId, TypeId> GetBandTypeIdInfo() const;
206
210 std::set<std::tuple<ChannelModel, Scenario>> m_supportedCombinations = {
211 // NYU-RMA
212 {ChannelModel::NYU, Scenario::RMa},
213 // NYU-UMA
214 {ChannelModel::NYU, Scenario::UMa},
215 // NYU-UMi
216 {ChannelModel::NYU, Scenario::UMi},
217 // NYU-InH
218 {ChannelModel::NYU, Scenario::InH},
219 // NYU-InF
220 {ChannelModel::NYU, Scenario::InF},
221 // 3GPP-RMa
222 {ChannelModel::ThreeGpp, Scenario::RMa},
223 // 3GPP-UMi
224 {ChannelModel::ThreeGpp, Scenario::UMi},
225 // 3GPP-UMa
226 {ChannelModel::ThreeGpp, Scenario::UMa},
227 // 3GPP-UMi
228 {ChannelModel::ThreeGpp, Scenario::UMi},
229 // 3GPP-UMa
230 {ChannelModel::ThreeGpp, Scenario::UMa},
231 // 3GPP-InH - OfficeMixed
232 {ChannelModel::ThreeGpp, Scenario::InH_OfficeMixed},
233 // 3GPP-InH - OfficeOpen
234 {ChannelModel::ThreeGpp, Scenario::InH_OfficeOpen},
235 // 3GPP-V2V - Highway
236 {ChannelModel::ThreeGpp, Scenario::V2V_Highway},
237 // 3GPP-V2V - Urban
238 {ChannelModel::ThreeGpp, Scenario::V2V_Urban},
239 // 3GPP-NTN - DenseUrban
240 {ChannelModel::ThreeGpp, Scenario::NTN_DenseUrban},
241 // 3GPP-NTN - Urban
242 {ChannelModel::ThreeGpp, Scenario::NTN_Urban},
243 // 3GPP-NTN - Suburban
244 {ChannelModel::ThreeGpp, Scenario::NTN_Suburban},
245 // 3GPP-NTN - Rural
246 {ChannelModel::ThreeGpp, Scenario::NTN_Rural}};
247
252 TypeId GetConditionTypeId() const;
253
258 TypeId GetChannelModelTypeId() const;
259
268 std::pair<TypeId, TypeId> GetPropagationTypeId() const;
269
274 void AddNrCsiRsFilter(Ptr<SpectrumChannel> channel);
275
276 ObjectFactory m_pathLossModel;
277 ObjectFactory m_spectrumModel;
278 ObjectFactory m_channelConditionModel;
279};
280} // namespace ns3
281#endif /* NR_CHANNEL_HELPER_H */
This class is a helper class to create a channel with a specific scenario, channel model and channel ...
Ptr< SpectrumChannel > CreateChannel(uint8_t flags=INIT_PROPAGATION|INIT_FADING)
This function creates a spectrum channel with the given flags.
void SetPathlossAttribute(const std::string &n, const AttributeValue &v)
Set an attribute for the PathLossModel, before the spectrum channel has been created.
void ConfigurePropagationFactory(TypeId pathLossTypeId)
This function configures the propagation loss object factory. It is used to set the object factory ma...
void ConfigureSpectrumFactory(TypeId specTypeId)
This function configures the spectrum object factory with the user selected spectrum loss model....
void SetChannelConditionModelAttribute(const std::string &n, const AttributeValue &v)
Set an attribute for the ChannelConditionModel, before the spectrum channel has been created.
static TypeId GetTypeId()
Get the TypeId of the NrChannelHelper.
void SetPhasedArraySpectrumPropagationLossModelAttribute(const std::string &n, const AttributeValue &v)
Set an attribute for the PhasedArraySpectrumPropagationLossModel, before the spectrum channel has bee...
void ConfigureFactories(std::string Scenario="RMa", std::string Condition="Default", std::string ChannelModel="ThreeGpp")
This function configures the object factories with the user-selected scenario, channel,...
NrChannelHelper()=default
Default constructor.
void AssignChannelsToBands(const std::vector< std::reference_wrapper< OperationBandInfo > > &bandInfos, uint8_t flags=INIT_PROPAGATION|INIT_FADING)
This helper function assists in creating multiple instances of spectrum channels with the same scenar...
InitFlags
Flags for channel assignments.
@ INIT_PROPAGATION
Initialize the propagation loss model.
@ INIT_FADING
Initialize the fading model.