42#include "ns3/antenna-module.h"
43#include "ns3/config-store.h"
44#include "ns3/core-module.h"
45#include "ns3/internet-module.h"
47#include "ns3/mobility-module.h"
48#include "ns3/network-module.h"
49#include "ns3/nr-helper.h"
50#include "ns3/nr-module.h"
55main(
int argc,
char* argv[])
58 uint32_t numRowsGnb = 1;
59 uint32_t numColumnsGnb = 1;
65 double xMin = -1000.0;
68 double yMin = -1000.0;
71 std::string simTag =
"";
73 CommandLine cmd(__FILE__);
74 cmd.AddValue(
"simTag",
"The simTag to be used for REM files creation", simTag);
75 cmd.AddValue(
"numRowsGnb",
"Number of rows for the gNB antenna", numRowsGnb);
76 cmd.AddValue(
"numColumnsGnb",
"Number of columns for the gNB antenna", numColumnsGnb);
77 cmd.AddValue(
"sector",
"sector to be configured for", sector);
78 cmd.AddValue(
"theta",
"thea angle to be configured", theta);
79 cmd.AddValue(
"xMin",
"The min x coordinate of the rem map", xMin);
80 cmd.AddValue(
"xMax",
"The max x coordinate of the rem map", xMax);
81 cmd.AddValue(
"xRes",
"The resolution on the x axis of the rem map", xRes);
82 cmd.AddValue(
"yMin",
"The min y coordinate of the rem map", yMin);
83 cmd.AddValue(
"yMax",
"The max y coordinate of the rem map", yMax);
84 cmd.AddValue(
"yRes",
"The resolution on the y axis of the rem map", yRes);
86 cmd.Parse(argc, argv);
89 NodeContainer gnbNodes;
90 NodeContainer ueNodes;
95 MobilityHelper mobility;
96 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
97 mobility.Install(gnbNodes);
98 gnbNodes.Get(0)->GetObject<MobilityModel>()->SetPosition(Vector(0, 0, 10));
99 mobility.Install(ueNodes);
100 ueNodes.Get(0)->GetObject<MobilityModel>()->SetPosition(Vector(10, 10, 1.5));
103 Ptr<NrPointToPointEpcHelper> nrEpcHelper = CreateObject<NrPointToPointEpcHelper>();
104 Ptr<IdealBeamformingHelper> idealBeamformingHelper = CreateObject<IdealBeamformingHelper>();
105 idealBeamformingHelper->SetAttribute(
"BeamformingMethod",
107 Ptr<NrHelper> nrHelper = CreateObject<NrHelper>();
109 nrHelper->SetBeamformingHelper(idealBeamformingHelper);
110 nrHelper->SetEpcHelper(nrEpcHelper);
121 const uint8_t numCcPerBand = 1;
125 Ptr<NrChannelHelper> channelHelper = CreateObject<NrChannelHelper>();
127 channelHelper->ConfigureFactories();
129 channelHelper->SetChannelConditionModelAttribute(
"UpdatePeriod", TimeValue(MilliSeconds(0)));
130 channelHelper->SetPathlossAttribute(
"ShadowingEnabled", BooleanValue(
false));
131 channelHelper->AssignChannelsToBands({band});
135 nrHelper->SetUeAntennaAttribute(
"NumRows", UintegerValue(1));
136 nrHelper->SetUeAntennaAttribute(
"NumColumns", UintegerValue(1));
137 nrHelper->SetUeAntennaAttribute(
"AntennaElement",
138 PointerValue(CreateObject<IsotropicAntennaModel>()));
141 nrHelper->SetGnbPhyAttribute(
"TxPower", DoubleValue(10));
142 nrHelper->SetGnbPhyAttribute(
"Numerology", UintegerValue(0));
143 nrHelper->SetGnbAntennaAttribute(
"NumRows", UintegerValue(numRowsGnb));
144 nrHelper->SetGnbAntennaAttribute(
"NumColumns", UintegerValue(numColumnsGnb));
145 nrHelper->SetGnbAntennaAttribute(
"AntennaElement",
146 PointerValue(CreateObject<ThreeGppAntennaModel>()));
149 NetDeviceContainer gnbNetDev = nrHelper->InstallGnbDevice(gnbNodes, singleBwp);
150 NetDeviceContainer ueNetDev = nrHelper->InstallUeDevice(ueNodes, singleBwp);
152 int64_t randomStream = 1;
153 randomStream += nrHelper->AssignStreams(gnbNetDev, randomStream);
154 randomStream += nrHelper->AssignStreams(ueNetDev, randomStream);
157 InternetStackHelper internet;
158 internet.Install(ueNodes);
159 nrEpcHelper->AssignUeIpv4Address(NetDeviceContainer(ueNetDev));
162 nrHelper->AttachToGnb(ueNetDev.Get(0), gnbNetDev.Get(0));
165 Ptr<NrRadioEnvironmentMapHelper> remHelper = CreateObject<NrRadioEnvironmentMapHelper>();
166 remHelper->SetMinX(xMin);
167 remHelper->SetMaxX(xMax);
168 remHelper->SetResX(xRes);
169 remHelper->SetMinY(yMin);
170 remHelper->SetMaxY(yMax);
171 remHelper->SetResY(yRes);
172 remHelper->SetSimTag(simTag);
173 remHelper->SetRemMode(NrRadioEnvironmentMapHelper::BEAM_SHAPE);
176 DynamicCast<NrGnbNetDevice>(gnbNetDev.Get(0))
180 ->SetSector(sector, theta);
181 DynamicCast<NrUeNetDevice>(ueNetDev.Get(0))
185 ->ChangeToQuasiOmniBeamformingVector();
186 remHelper->CreateRem(gnbNetDev, ueNetDev.Get(0), 0);
188 Simulator::Stop(Seconds(simTime));
190 Simulator::Destroy();
Manages the correct creation of operation bands, component carriers and bandwidth parts.
OperationBandInfo CreateOperationBandContiguousCc(const SimpleOperationBandConf &conf)
Create an operation band with the CC specified.
static BandwidthPartInfoPtrVector GetAllBwps(const std::vector< std::reference_wrapper< OperationBandInfo > > &operationBands)
Get all the BWP pointers from the specified vector of operation bands.
std::vector< std::reference_wrapper< BandwidthPartInfoPtr > > BandwidthPartInfoPtrVector
vector of unique_ptr of BandwidthPartInfo
Minimum configuration requirements for a OperationBand.
Operation band information structure.