141 const std::string& scenario,
142 const std::string& confType,
143 const std::string& radioNetwork,
144 std::string errorModel,
145 const std::string& operationMode,
146 const std::string& direction,
148 const std::string& pattern,
149 const NodeContainer& gnbSector1Container,
150 const NodeContainer& gnbSector2Container,
151 const NodeContainer& gnbSector3Container,
152 const NodeContainer& ueSector1Container,
153 const NodeContainer& ueSector2Container,
154 const NodeContainer& ueSector3Container,
155 const Ptr<NrPointToPointEpcHelper>& baseEpcHelper,
156 Ptr<NrHelper>& nrHelper,
157 NetDeviceContainer& gnbSector1NetDev,
158 NetDeviceContainer& gnbSector2NetDev,
159 NetDeviceContainer& gnbSector3NetDev,
160 NetDeviceContainer& ueSector1NetDev,
161 NetDeviceContainer& ueSector2NetDev,
162 NetDeviceContainer& ueSector3NetDev,
165 std::string powerAllocation,
171 const std::string& scheduler,
172 uint32_t bandwidthMHz,
174 uint32_t freqScenario,
177 double downtiltAngle,
178 const uint32_t gnbNumRows,
179 const uint32_t gnbNumColumns,
180 const uint32_t ueNumRows,
181 const uint32_t ueNumColumns,
182 bool gnbEnable3gppElement,
183 bool ueEnable3gppElement,
184 const double gnbHSpacing,
185 const double gnbVSpacing,
186 const double ueHSpacing,
187 const double ueVSpacing,
188 const double gnbNoiseFigure,
189 const double ueNoiseFigure,
191 bool enableShadowing,
193 double o2iLowLossThreshold,
194 bool linkO2iConditionToAntennaHeight,
195 bool crossPolarizedGnb,
196 bool crossPolarizedUe,
197 double polSlantAngleGnb1,
198 double polSlantAngleGnb2,
199 double polSlantAngleUe1,
200 double polSlantAngleUe2,
201 std::string bfMethod,
202 uint16_t beamConfSector,
203 double beamConfElevation,
210 uint8_t numScPerRb = 1;
211 double rbOverhead = 0.1;
212 uint32_t harqProcesses = 20;
213 uint32_t n1Delay = 2;
214 uint32_t n2Delay = 2;
215 uint8_t dlCtrlSymbols = 1;
217 if (radioNetwork ==
"LTE")
225 if (errorModel.empty())
227 errorModel =
"ns3::LenaErrorModel";
229 else if (errorModel !=
"ns3::NrLteMiErrorModel" && errorModel !=
"ns3::LenaErrorModel")
231 NS_ABORT_MSG(
"The selected error model is not recommended for LTE");
234 else if (radioNetwork ==
"NR")
238 if (errorModel.empty())
240 errorModel =
"ns3::NrEesmIrT1";
242 else if (errorModel ==
"ns3::NrLteMiErrorModel")
244 NS_ABORT_MSG(
"The selected error model is not recommended for NR");
249 NS_ABORT_MSG(
"Unrecognized radio network technology");
260 nrHelper = CreateObject<NrHelper>();
262 Ptr<BeamformingHelperBase> beamformingHelper;
268 if (enableFading && bfMethod !=
"FixedBeam")
270 if (radioNetwork ==
"NR" && enableRealBF)
272 beamformingHelper = CreateObject<RealisticBeamformingHelper>();
276 beamformingHelper = CreateObject<IdealBeamformingHelper>();
278 nrHelper->SetBeamformingHelper(beamformingHelper);
281 Ptr<NrPointToPointEpcHelper> nrEpcHelper = DynamicCast<NrPointToPointEpcHelper>(baseEpcHelper);
282 nrHelper->SetEpcHelper(nrEpcHelper);
284 double txPowerBs = 0.0;
286 NS_ABORT_MSG_UNLESS(scenario ==
"UMa" || scenario ==
"RMa" || scenario ==
"UMi",
287 "Unsupported scenario " << scenario <<
". Supported values: UMa, RMa, UMi");
288 txPowerBs = gnbTxPower;
289 std::cout <<
"Scenario: " << scenario <<
"gnbTxPower: " << txPowerBs << std::endl;
291 std::cout <<
"o2iThreshold: " << o2iThreshold << std::endl;
292 std::cout <<
"o2iLowLossThreshold: " << o2iLowLossThreshold << std::endl;
295 nrHelper->SetGnbPhyAttribute(
"NoiseFigure", DoubleValue(gnbNoiseFigure));
297 nrHelper->SetUePhyAttribute(
"NoiseFigure", DoubleValue(ueNoiseFigure));
298 nrHelper->SetUePhyAttribute(
"EnableUplinkPowerControl", BooleanValue(enableUlPc));
300 if (radioNetwork ==
"LTE" && confType ==
"calibrationConf" && enableUlPc)
302 Config::SetDefault(
"ns3::NrUePowerControl::ClosedLoop", BooleanValue(
false));
303 Config::SetDefault(
"ns3::NrUePowerControl::PoNominalPucch", IntegerValue(-106));
304 Config::SetDefault(
"ns3::NrUePowerControl::PoNominalPusch", IntegerValue(-106));
305 Config::SetDefault(
"ns3::NrUePowerControl::Alpha",
309 Config::SetDefault(
"ns3::NrMacSchedulerSrsDefault::StartingPeriodicity", UintegerValue(16));
310 nrHelper->SetSchedulerAttribute(
"SrsSymbols", UintegerValue(1));
312 NrSpectrumValueHelper::PowerAllocationType powerAllocationEnum;
313 if (powerAllocation ==
"UniformPowerAllocBw")
315 powerAllocationEnum = NrSpectrumValueHelper::UNIFORM_POWER_ALLOCATION_BW;
317 else if (powerAllocation ==
"UniformPowerAllocUsed")
319 powerAllocationEnum = NrSpectrumValueHelper::UNIFORM_POWER_ALLOCATION_USED;
323 NS_ABORT_MSG(
"Unsupported power allocation type "
325 <<
". Supported values: "
326 "UniformPowerAllocBw and UniformPowerAllocUsed.");
329 nrHelper->SetUePhyAttribute(
"PowerAllocationType", EnumValue(powerAllocationEnum));
331 nrHelper->SetGnbPhyAttribute(
"PowerAllocationType",
332 EnumValue(NrSpectrumValueHelper::UNIFORM_POWER_ALLOCATION_BW));
335 nrHelper->SetUlErrorModel(errorModel);
336 nrHelper->SetDlErrorModel(errorModel);
346 nrHelper->SetGnbDlAmcAttribute(
"NumRefScPerRb", UintegerValue(numScPerRb));
347 nrHelper->SetGnbUlAmcAttribute(
"NumRefScPerRb", UintegerValue(1));
349 nrHelper->SetGnbPhyAttribute(
"RbOverhead", DoubleValue(rbOverhead));
350 nrHelper->SetGnbPhyAttribute(
"N2Delay", UintegerValue(n2Delay));
351 nrHelper->SetGnbPhyAttribute(
"N1Delay", UintegerValue(n1Delay));
353 nrHelper->SetUeMacAttribute(
"NumHarqProcess", UintegerValue(harqProcesses));
354 nrHelper->SetGnbMacAttribute(
"NumHarqProcess", UintegerValue(harqProcesses));
406 const double band0Start = startingFreq;
407 double bandwidthBwp = bandwidthMHz * 1e6;
416 uint8_t numBwp = operationMode ==
"FDD" ? 2 : 1;
418 if (freqScenario == 0)
420 double bandwidthCc = numBwp * bandwidthBwp;
421 uint8_t numCcPerBand = 1;
422 double bandwidthBand = numCcPerBand * bandwidthCc;
423 double bandCenter = band0Start + bandwidthBand / 2.0;
425 NS_LOG_LOGIC(
"NON_OVERLAPPING, " << operationMode <<
": " << bandwidthBand <<
":"
426 << bandwidthCc <<
":" << bandwidthBwp <<
", "
427 << (
int)numCcPerBand <<
", " << (
int)numBwp);
429 NS_LOG_LOGIC(
"bandConf0: " << bandCenter <<
" " << bandwidthBand);
432 bandCenter += bandwidthBand;
434 NS_LOG_LOGIC(
"bandConf1: " << bandCenter <<
" " << bandwidthBand);
437 bandCenter += bandwidthBand;
439 NS_LOG_LOGIC(
"bandConf2: " << bandCenter <<
" " << bandwidthBand);
451 bandCenter = band0Start + bandwidthBwp / 2.0;
453 NS_LOG_LOGIC(
"band0[0][0]: " << bandCenter <<
" " << bandwidthBwp);
454 ConfigureBwpTo(band0.
m_cc[0]->m_bwp[0], bandCenter, bandwidthBwp);
455 bandCenter += bandwidthBwp;
457 if (operationMode ==
"FDD")
459 NS_LOG_LOGIC(
"band0[0][1]: " << bandCenter <<
" " << bandwidthBwp);
460 ConfigureBwpTo(band0.
m_cc[0]->m_bwp[1], bandCenter, bandwidthBwp);
461 bandCenter += bandwidthBwp;
462 Config::SetDefault(
"ns3::NrUeNetDevice::PrimaryUlIndex", UintegerValue(1));
465 NS_LOG_LOGIC(
"band1[0][0]: " << bandCenter <<
" " << bandwidthBwp);
466 ConfigureBwpTo(band1.
m_cc[0]->m_bwp[0], bandCenter, bandwidthBwp);
467 bandCenter += bandwidthBwp;
469 if (operationMode ==
"FDD")
471 NS_LOG_LOGIC(
"band1[0][1]: " << bandCenter <<
" " << bandwidthBwp);
472 ConfigureBwpTo(band1.
m_cc[0]->m_bwp[1], bandCenter, bandwidthBwp);
473 bandCenter += bandwidthBwp;
476 NS_LOG_LOGIC(
"band2[0][0]: " << bandCenter <<
" " << bandwidthBwp);
477 ConfigureBwpTo(band2.
m_cc[0]->m_bwp[0], bandCenter, bandwidthBwp);
478 bandCenter += bandwidthBwp;
480 if (operationMode ==
"FDD")
482 NS_LOG_LOGIC(
"band2[0][1]: " << bandCenter <<
" " << bandwidthBwp);
483 ConfigureBwpTo(band2.
m_cc[0]->m_bwp[1], bandCenter, bandwidthBwp);
486 std::cout <<
"BWP Configuration for NON_OVERLAPPING case, mode " << operationMode <<
"\n"
487 << band0 << band1 << band2;
490 else if (freqScenario == 1)
492 double bandwidthCc = numBwp * bandwidthBwp;
493 uint8_t numCcPerBand = 1;
494 double bandwidthBand = numCcPerBand * bandwidthCc;
495 double bandCenter = band0Start + bandwidthBand / 2.0;
497 NS_LOG_LOGIC(
"OVERLAPPING, " << operationMode <<
": " << bandwidthBand <<
":" << bandwidthCc
498 <<
":" << bandwidthBwp <<
", " << (
int)numCcPerBand <<
", "
501 NS_LOG_LOGIC(
"bandConf0: " << bandCenter <<
" " << bandwidthBand);
504 bandCenter += bandwidthBand;
510 bandCenter = band0Start + bandwidthBwp / 2.0;
512 NS_LOG_LOGIC(
"band0[0][0]: " << bandCenter <<
" " << bandwidthBwp);
513 ConfigureBwpTo(band0.
m_cc[0]->m_bwp[0], bandCenter, bandwidthBwp);
514 bandCenter += bandwidthBwp;
516 if (operationMode ==
"FDD")
518 NS_LOG_LOGIC(
"band0[0][1]: " << bandCenter <<
" " << bandwidthBwp);
519 ConfigureBwpTo(band0.
m_cc[0]->m_bwp[1], bandCenter, bandwidthBwp);
522 std::cout <<
"BWP Configuration for OVERLAPPING case, mode " << operationMode <<
"\n"
528 std::cerr <<
"unknown combination of freqScenario = " << freqScenario
529 <<
" and operationMode = " << operationMode << std::endl;
533 Ptr<NrChannelHelper> channelHelper = CreateObject<NrChannelHelper>();
535 channelHelper->ConfigureFactories(scenario,
"Default");
537 channelHelper->SetChannelConditionModelAttribute(
"UpdatePeriod", TimeValue(MilliSeconds(100)));
538 channelHelper->SetChannelConditionModelAttribute(
"LinkO2iConditionToAntennaHeight",
539 BooleanValue(linkO2iConditionToAntennaHeight));
540 channelHelper->SetChannelConditionModelAttribute(
"O2iThreshold", DoubleValue(o2iThreshold));
541 channelHelper->SetChannelConditionModelAttribute(
"O2iLowLossThreshold",
542 DoubleValue(o2iLowLossThreshold));
543 channelHelper->SetPathlossAttribute(
"ShadowingEnabled", BooleanValue(enableShadowing));
544 Config::SetDefault(
"ns3::ThreeGppChannelModel::UpdatePeriod", TimeValue(MilliSeconds(100)));
547 ObjectFactory distanceBasedChannelFactory;
548 distanceBasedChannelFactory.SetTypeId(
549 DistanceBasedThreeGppSpectrumPropagationLossModel::GetTypeId());
550 distanceBasedChannelFactory.Set(
"MaxDistance", DoubleValue(2 * isd));
551 for (
size_t i = 0; i < band0.
GetBwps().size(); i++)
553 auto distanceBased3gpp =
554 distanceBasedChannelFactory.Create<DistanceBasedThreeGppSpectrumPropagationLossModel>();
555 distanceBased3gpp->SetChannelModelAttribute(
557 DoubleValue(band0.
GetBwpAt(0, i)->m_centralFrequency));
558 distanceBased3gpp->SetChannelModelAttribute(
"Scenario", StringValue(scenario));
564 PointerValue channelConditionModel0;
565 specChannelBand0->GetPropagationLossModel()->GetAttribute(
"ChannelConditionModel",
566 channelConditionModel0);
567 distanceBased3gpp->SetChannelModelAttribute(
568 "ChannelConditionModel",
569 PointerValue(channelConditionModel0.Get<ChannelConditionModel>()));
570 specChannelBand0->AddPhasedArraySpectrumPropagationLossModel(distanceBased3gpp);
572 band0.
GetBwpAt(0, i)->SetChannel(specChannelBand0);
574 for (
size_t i = 0; i < band1.
GetBwps().size(); i++)
576 auto distanceBased3gpp =
577 distanceBasedChannelFactory.Create<DistanceBasedThreeGppSpectrumPropagationLossModel>();
578 distanceBased3gpp->SetChannelModelAttribute(
580 DoubleValue(band1.
GetBwpAt(0, i)->m_centralFrequency));
581 distanceBased3gpp->SetChannelModelAttribute(
"Scenario", StringValue(scenario));
587 PointerValue channelConditionModel1;
588 specChannelBand1->GetPropagationLossModel()->GetAttribute(
"ChannelConditionModel",
589 channelConditionModel1);
590 distanceBased3gpp->SetChannelModelAttribute(
591 "ChannelConditionModel",
592 PointerValue(channelConditionModel1.Get<ChannelConditionModel>()));
593 specChannelBand1->AddPhasedArraySpectrumPropagationLossModel(distanceBased3gpp);
595 band1.
GetBwpAt(0, i)->SetChannel(specChannelBand1);
597 for (
size_t i = 0; i < band2.
GetBwps().size(); i++)
599 auto distanceBased3gpp =
600 distanceBasedChannelFactory.Create<DistanceBasedThreeGppSpectrumPropagationLossModel>();
601 distanceBased3gpp->SetAttribute(
"MaxDistance", DoubleValue(2 * isd));
602 distanceBased3gpp->SetChannelModelAttribute(
"Scenario", StringValue(scenario));
603 distanceBased3gpp->SetChannelModelAttribute(
605 DoubleValue(band2.
GetBwpAt(0, i)->m_centralFrequency));
611 PointerValue channelConditionModel2;
612 specChannelBand2->GetPropagationLossModel()->GetAttribute(
"ChannelConditionModel",
613 channelConditionModel2);
614 distanceBased3gpp->SetChannelModelAttribute(
615 "ChannelConditionModel",
616 PointerValue(channelConditionModel2.Get<ChannelConditionModel>()));
617 specChannelBand2->AddPhasedArraySpectrumPropagationLossModel(distanceBased3gpp);
619 band2.
GetBwpAt(0, i)->SetChannel(specChannelBand2);
624 if (freqScenario == 0)
637 RealisticBfManager::TriggerEvent realTriggerEvent{RealisticBfManager::SRS_COUNT};
641 if (enableFading && bfMethod !=
"FixedBeam")
643 if (radioNetwork ==
"NR")
649 nrHelper->SetGnbBeamManagerAttribute(
"TriggerEvent", EnumValue(realTriggerEvent));
650 nrHelper->SetGnbBeamManagerAttribute(
"UpdateDelay", TimeValue(MicroSeconds(0)));
654 if (bfMethod ==
"Omni")
656 beamformingHelper->SetBeamformingMethod(
659 else if (bfMethod ==
"CellScan")
662 beamformingHelper->SetAttribute(
"BeamformingPeriodicity",
663 TimeValue(MilliSeconds(10)));
665 else if (bfMethod ==
"CellScanAzimuth")
667 beamformingHelper->SetBeamformingMethod(
672 NS_ABORT_MSG(
"We shouldn't be here. bfMethod is: " << bfMethod);
676 else if (radioNetwork ==
"LTE")
678 if (bfMethod ==
"Omni")
680 beamformingHelper->SetBeamformingMethod(
683 else if (bfMethod ==
"CellScan")
686 beamformingHelper->SetAttribute(
"BeamformingPeriodicity",
687 TimeValue(MilliSeconds(10)));
691 NS_ABORT_MSG(
"We shouldn't be here. bfMethod is: " << bfMethod);
698 if (radioNetwork ==
"NR")
700 if (scheduler ==
"PF")
702 nrHelper->SetSchedulerTypeId(TypeId::LookupByName(
"ns3::NrMacSchedulerTdmaPF"));
704 else if (scheduler ==
"RR")
706 nrHelper->SetSchedulerTypeId(TypeId::LookupByName(
"ns3::NrMacSchedulerTdmaRR"));
711 if (scheduler ==
"PF")
713 nrHelper->SetSchedulerTypeId(TypeId::LookupByName(
"ns3::NrMacSchedulerOfdmaPF"));
715 else if (scheduler ==
"RR")
717 nrHelper->SetSchedulerTypeId(TypeId::LookupByName(
"ns3::NrMacSchedulerOfdmaRR"));
720 nrHelper->SetSchedulerAttribute(
"EnableHarqReTx", BooleanValue(
false));
723 nrHelper->SetSchedulerAttribute(
"SrsSymbols", UintegerValue(1));
724 nrHelper->SetSchedulerAttribute(
"EnableSrsInUlSlots", BooleanValue(
false));
725 nrHelper->SetSchedulerAttribute(
"EnableSrsInFSlots", BooleanValue(
false));
728 nrHelper->SetSchedulerAttribute(
"DlCtrlSymbols", UintegerValue(dlCtrlSymbols));
731 nrEpcHelper->SetAttribute(
"S1uLinkDelay", TimeValue(MilliSeconds(0)));
734 nrHelper->SetUeAntennaAttribute(
"NumRows", UintegerValue(ueNumRows));
735 nrHelper->SetUeAntennaAttribute(
"NumColumns", UintegerValue(ueNumColumns));
737 if (ueEnable3gppElement)
739 nrHelper->SetUeAntennaAttribute(
"AntennaElement",
740 PointerValue(CreateObject<ThreeGppAntennaModel>()));
744 nrHelper->SetUeAntennaAttribute(
"AntennaElement",
745 PointerValue(CreateObject<IsotropicAntennaModel>()));
748 nrHelper->SetUeAntennaAttribute(
"AntennaHorizontalSpacing", DoubleValue(ueHSpacing));
749 nrHelper->SetUeAntennaAttribute(
"AntennaVerticalSpacing", DoubleValue(ueVSpacing));
752 nrHelper->SetGnbAntennaAttribute(
"NumRows", UintegerValue(gnbNumRows));
753 nrHelper->SetGnbAntennaAttribute(
"NumColumns", UintegerValue(gnbNumColumns));
755 nrHelper->SetGnbAntennaAttribute(
"AntennaHorizontalSpacing", DoubleValue(gnbHSpacing));
756 nrHelper->SetGnbAntennaAttribute(
"AntennaVerticalSpacing", DoubleValue(gnbVSpacing));
758 nrHelper->SetGnbAntennaAttribute(
"DowntiltAngle", DoubleValue(downtiltAngle * M_PI / 180.0));
760 if (gnbEnable3gppElement)
762 nrHelper->SetGnbAntennaAttribute(
"AntennaElement",
763 PointerValue(CreateObject<ThreeGppAntennaModel>()));
767 nrHelper->SetGnbAntennaAttribute(
"AntennaElement",
768 PointerValue(CreateObject<IsotropicAntennaModel>()));
771 double gnbFirstSubArray = (polSlantAngleGnb1 * M_PI) / 180.0;
772 double gnbSecondSubArray = (polSlantAngleGnb2 * M_PI) / 180.0;
773 double ueFirstSubArray = (polSlantAngleUe1 * M_PI) / 180.0;
774 double ueSecondSubArray = (polSlantAngleUe2 * M_PI) / 180.0;
777 nrHelper->SetUePhyAttribute(
"TxPower", DoubleValue(ueTxPower));
783 if (radioNetwork ==
"LTE")
785 switch (bandwidthMHz)
790 nrHelper->SetGnbMacAttribute(
"NumRbPerRbg", UintegerValue(4));
793 nrHelper->SetGnbMacAttribute(
"NumRbPerRbg", UintegerValue(3));
796 nrHelper->SetGnbMacAttribute(
"NumRbPerRbg", UintegerValue(2));
800 "Currently, only supported bandwidths are 5, 10, 15, 20 and 40MHz, you chose "
806 nrHelper->SetGnbMacAttribute(
"NumRbPerRbg", UintegerValue(1));
810 uint32_t bwpIdForLowLat = 0;
811 if (operationMode ==
"FDD" && direction ==
"UL")
817 nrHelper->SetGnbBwpManagerAlgorithmAttribute(
"NGBR_LOW_LAT_EMBB",
818 UintegerValue(bwpIdForLowLat));
821 nrHelper->SetUeBwpManagerAlgorithmAttribute(
"NGBR_LOW_LAT_EMBB", UintegerValue(bwpIdForLowLat));
825 gnbSector1NetDev = nrHelper->InstallGnbDevice(gnbSector1Container, sector1Bwps);
826 NetDeviceContainer gnbNetDevs(gnbSector1NetDev);
827 gnbSector2NetDev = nrHelper->InstallGnbDevice(gnbSector2Container, sector2Bwps);
828 gnbNetDevs.Add(gnbSector2NetDev);
829 gnbSector3NetDev = nrHelper->InstallGnbDevice(gnbSector3Container, sector3Bwps);
830 gnbNetDevs.Add(gnbSector3NetDev);
831 ueSector1NetDev = nrHelper->InstallUeDevice(ueSector1Container, sector1Bwps);
832 NetDeviceContainer ueNetDevs(ueSector1NetDev);
833 ueSector2NetDev = nrHelper->InstallUeDevice(ueSector2Container, sector2Bwps);
834 ueNetDevs.Add(ueSector2NetDev);
835 ueSector3NetDev = nrHelper->InstallUeDevice(ueSector3Container, sector3Bwps);
836 ueNetDevs.Add(ueSector3NetDev);
838 int64_t randomStream = 1;
839 randomStream += nrHelper->AssignStreams(gnbSector1NetDev, randomStream);
840 randomStream += nrHelper->AssignStreams(gnbSector2NetDev, randomStream);
841 randomStream += nrHelper->AssignStreams(gnbSector3NetDev, randomStream);
842 randomStream += nrHelper->AssignStreams(ueSector1NetDev, randomStream);
843 randomStream += nrHelper->AssignStreams(ueSector2NetDev, randomStream);
844 randomStream += nrHelper->AssignStreams(ueSector3NetDev, randomStream);
847 std::vector<double> sectorOrientationRad{
849 sector0AngleRad + 2.0 * M_PI / 3.0,
850 sector0AngleRad - 2.0 * M_PI / 3.0
853 for (uint32_t cellId = 0; cellId < gnbNetDevs.GetN(); ++cellId)
855 Ptr<NetDevice> gnb = gnbNetDevs.Get(cellId);
856 uint32_t numBwps = nrHelper->GetNumberBwp(gnb);
859 NS_ABORT_MSG(
"Incorrect number of BWPs per CC");
862 uint32_t sector = cellId % (gnbSector3NetDev.GetN() == 0 ? 1 : 3);
863 double orientation = sectorOrientationRad[sector];
866 ConfigurePhy(nrHelper,
880 ConfigurePhy(nrHelper,
892 nrHelper->GetBwpManagerGnb(gnb)->SetOutputLink(1, 0);
896 Ptr<UniformRandomVariable> m_uniformUeBearingAngle;
897 m_uniformUeBearingAngle = CreateObject<UniformRandomVariable>();
900 for (
auto nd = ueNetDevs.Begin(); nd != ueNetDevs.End(); ++nd)
902 auto uePhyFirst = nrHelper->GetUePhy(*nd, 0);
903 auto uePhySecond{uePhyFirst};
905 ObjectVectorValue ueSpectrumPhysFirstBwp;
906 Ptr<NrSpectrumPhy> nrSpectrumPhy = uePhyFirst->GetSpectrumPhy();
907 nrSpectrumPhy->GetAntenna()->GetObject<UniformPlanarArray>()->SetAttribute(
909 DoubleValue(ueFirstSubArray));
914 double ueBearingAngleValue = m_uniformUeBearingAngle->GetValue(-180, 180);
915 ueBearingAngleValue = (ueBearingAngleValue * M_PI) / 180.0;
916 nrSpectrumPhy->GetAntenna()->GetObject<UniformPlanarArray>()->SetAttribute(
918 DoubleValue(ueBearingAngleValue));
920 if (ueSpectrumPhysFirstBwp.GetN() == 2)
922 nrSpectrumPhy = ueSpectrumPhysFirstBwp.Get(1)->GetObject<
NrSpectrumPhy>();
923 nrSpectrumPhy->
GetAntenna()->GetObject<UniformPlanarArray>()->SetAttribute(
925 DoubleValue(ueSecondSubArray));
928 if (operationMode ==
"FDD")
930 nrHelper->GetBwpManagerUe(*nd)->SetOutputLink(0, 1);
931 uePhySecond = nrHelper->GetUePhy(*nd, 1);
932 uePhySecond->SetUplinkPowerControl(uePhyFirst->GetUplinkPowerControl());
934 ObjectVectorValue ueSpectrumPhysSecondBwp;
935 nrSpectrumPhy = uePhySecond->GetSpectrumPhy();
936 nrSpectrumPhy->GetAntenna()->GetObject<UniformPlanarArray>()->SetAttribute(
938 DoubleValue(ueFirstSubArray));
940 uePhyFirst->TraceConnectWithoutContext(
"DlDataSinr",
941 MakeBoundCallback(&ReportSinrNr, sinrStats));
942 uePhySecond->TraceConnectWithoutContext(
"ReportPowerSpectralDensity",
943 MakeBoundCallback(&ReportPowerNr, ueTxPowerStats));
946 for (
auto nd = gnbNetDevs.Begin(); nd != gnbNetDevs.End(); ++nd)
949 if (operationMode ==
"FDD" && direction ==
"UL")
953 auto gnbPhy = nrHelper->GetGnbPhy(*nd, bwpId);
954 gnbPhy->TraceConnectWithoutContext(
"SlotDataStats",
955 MakeBoundCallback(&ReportSlotStatsNr, slotStats));
956 gnbPhy->TraceConnectWithoutContext(
"RBDataStats",
957 MakeBoundCallback(&ReportRbStatsNr, rbStats));
958 gnbPhy->GetSpectrumPhy()->TraceConnectWithoutContext(
960 MakeBoundCallback(&ReportGnbRxDataNr, gnbRxPowerStats));