5#include "ns3/antenna-module.h"
6#include "ns3/applications-module.h"
7#include "ns3/config-store-module.h"
8#include "ns3/core-module.h"
9#include "ns3/internet-module.h"
10#include "ns3/mobility-module.h"
11#include "ns3/nr-module.h"
12#include "ns3/point-to-point-helper.h"
13#include "ns3/sqlite-output.h"
14#include "ns3/stats-module.h"
16const uint32_t DB_ATTEMPT_LIMIT = 20;
89NS_LOG_COMPONENT_DEFINE(
"CttcRealisticBeamforming");
94class CttcRealisticBeamforming
97 enum BeamformingMethod
134 void Configure(
double deltaX,
136 BeamformingMethod beamforming,
137 RealisticBfManager::TriggerEvent realTriggerEvent,
138 uint32_t idealPeriodicity,
141 std::string gnbAntenna,
142 std::string ueAntenna,
143 std::string scenario,
145 std::string resultsDirPath,
148 std::string tableName,
149 std::string condition);
156 void RunSimulation();
161 ~CttcRealisticBeamforming();
172 void PrepareOutputFiles();
177 void PrintResultsToFiles();
182 void CreateDlTrafficApplications(ApplicationContainer& serverAppDl,
183 ApplicationContainer& clientAppDl,
184 NodeContainer& ueNode,
185 Ptr<Node> remoteHost,
186 NetDeviceContainer ueNetDev,
187 Ipv4InterfaceContainer& ueIpIface);
213 void PrepareDatabase();
218 void PrintResultsToDatabase();
223 void DeleteFromDatabaseIfAlreadyExist();
227 std::ofstream m_outSinrFile;
230 sqlite3* m_db{
nullptr};
231 std::string m_tableName{
"results"};
232 std::string m_dbName{
"realistic_beamforming.db"};
235 MinMaxAvgTotalCalculator<double> m_sinrStats;
240 BeamformingMethod m_beamforming{IDEAL};
241 uint32_t m_rngRun{1};
242 RealisticBfManager::TriggerEvent m_realTriggerEvent{RealisticBfManager::SRS_COUNT};
243 uint32_t m_idealPeriodicity{0};
244 uint16_t m_numerology{0};
245 std::string m_gnbAntennaModel{
"Iso"};
246 std::string m_ueAntennaModel{
"Iso"};
247 std::string m_scenario{
"UMa"};
248 std::string m_condition{
"Default"};
249 std::string m_resultsDirPath{
""};
250 std::string m_tag{
""};
251 double m_gNbHeight{25};
252 double m_gNbTxPower{35};
253 double m_ueTxPower{23};
256 Time m_simTime = MilliSeconds(150);
257 Time m_udpAppStartTimeDl = MilliSeconds(100);
258 Time m_udpAppStopTimeDl = MilliSeconds(150);
259 uint32_t m_packetSize = 1000;
260 DataRate m_udpRate = DataRate(
"1kbps");
261 double m_centralFrequency = 28e9;
262 double m_bandwidth = 100e6;
263 double m_ueHeight = 1.5;
265 const uint8_t m_numCcPerBand = 1;
282 std::ostringstream oss;
283 oss << directoryName <<
"/" << filePrefix << tag;
288CttcRealisticBeamforming::BuildTag()
290 NS_LOG_FUNCTION(
this);
292 std::ostringstream oss;
293 std::string algorithm = (m_beamforming == CttcRealisticBeamforming::IDEAL) ?
"I" :
"R";
294 double distance2D = sqrt(m_deltaX * m_deltaX + m_deltaY * m_deltaY);
296 oss <<
"-" << algorithm <<
"-d" << distance2D <<
"-mu" << m_numerology <<
"-gnb"
297 << m_gnbAntennaModel <<
"-ue" << m_ueAntennaModel <<
"-uePow" << m_ueTxPower <<
"-scenario"
304CttcRealisticBeamforming::PrepareOutputFiles()
306 NS_LOG_FUNCTION(
this);
315 m_outSinrFile.open(fileSinr.c_str(), std::ios_base::app);
316 m_outSinrFile.setf(std::ios_base::fixed);
317 NS_ABORT_MSG_IF(!m_outSinrFile.is_open(),
"Can't open file " << fileSinr);
321CttcRealisticBeamforming::PrepareDatabase()
323 NS_LOG_FUNCTION(
this);
325 int rc = sqlite3_open((m_resultsDirPath +
"/" + m_dbName).c_str(), &m_db);
326 NS_ABORT_MSG_UNLESS(rc == SQLITE_OK,
"Failed to open DB");
328 std::string cmd =
"CREATE TABLE IF NOT EXISTS " + m_tableName +
330 "SINR DOUBLE NOT NULL, "
331 "SINR_DB DOUBLE NOT NULL, "
332 "Distance DOUBLE NOT NULL,"
333 "DeltaX DOUBLE NOT NULL,"
334 "DeltaY DOUBLE NOT NULL,"
335 "BeamformingType TEXT NOT NULL,"
336 "RngRun INTEGER NOT NULL,"
337 "Numerology INTEGER NOT NULL,"
338 "GnbAntenna TEXT NOT NULL,"
339 "UeAntenna TEXT NOT NULL,"
340 "UePower INTEGER NOT NULL,"
341 "Scenario TEXT NOT NULL);";
346 uint32_t attemptCount = 0;
349 rc = sqlite3_prepare_v2(m_db, cmd.c_str(),
static_cast<int>(cmd.size()), &stmt,
nullptr);
351 ++attemptCount == DB_ATTEMPT_LIMIT,
352 "Waiting too much for sqlite3 database to be ready. "
353 "Check if you have the database/table open with another program. "
354 "If yes, close it before running again cttc-realistic-beamforming program.\n\n");
355 }
while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
358 rc == SQLITE_OK || rc == SQLITE_DONE,
359 "Could not prepare correctly the statement for creating the table. Db error:"
360 << sqlite3_errmsg(m_db) <<
"full command is: \n"
367 rc = sqlite3_step(stmt);
369 ++attemptCount == DB_ATTEMPT_LIMIT,
370 "Waiting too much for sqlite3 database to be ready. "
371 "Check if you have the database/table open with another program. "
372 "If yes, close it before running again cttc-realistic-beamforming program.\n\n");
373 }
while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
376 rc == SQLITE_OK || rc == SQLITE_DONE,
377 "Could not correctly execute the statement for creating the table. Db error:"
378 << sqlite3_errmsg(m_db));
384 rc = sqlite3_finalize(stmt);
386 ++attemptCount == DB_ATTEMPT_LIMIT,
387 "Waiting too much for sqlite3 database to be ready. "
388 "Check if you have the database/table open with another program. "
389 "If yes, close it before running again cttc-realistic-beamforming program.\n\n");
390 }
while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
393 rc == SQLITE_OK || rc == SQLITE_DONE,
394 "Could not correctly execute the statement for creating the table. Db error:"
395 << sqlite3_errmsg(m_db));
399CttcRealisticBeamforming::PrintResultsToDatabase()
401 NS_LOG_FUNCTION(
this);
403 DeleteFromDatabaseIfAlreadyExist();
407 "INSERT INTO " + m_tableName +
" VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
408 std::string beamformingType = (m_beamforming == IDEAL) ?
"Ideal" :
"Real";
410 double distance2D = sqrt(m_deltaX * m_deltaX + m_deltaY * m_deltaY);
413 uint32_t attemptCount = 0;
416 rc = sqlite3_prepare_v2(m_db, cmd.c_str(),
static_cast<int>(cmd.size()), &stmt,
nullptr);
418 ++attemptCount == DB_ATTEMPT_LIMIT,
419 "Waiting too much for sqlite3 database to be ready. "
420 "Check if you have the database/table open with another program. "
421 "If yes, close it before running again cttc-realistic-beamforming program.\n\n");
422 }
while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
424 NS_ABORT_MSG_UNLESS(rc == SQLITE_OK || rc == SQLITE_DONE,
425 "Could not prepare correctly the insert into the table statement. "
427 << sqlite3_errmsg(m_db) <<
". The full command is: \n"
431 NS_ABORT_UNLESS(sqlite3_bind_double(stmt, 1, m_sinrStats.getMean()) == SQLITE_OK);
432 NS_ABORT_UNLESS(sqlite3_bind_double(stmt, 2, 10.0 * log10(m_sinrStats.getMean())) == SQLITE_OK);
433 NS_ABORT_UNLESS(sqlite3_bind_double(stmt, 3, distance2D) == SQLITE_OK);
434 NS_ABORT_UNLESS(sqlite3_bind_double(stmt, 4, m_deltaX) == SQLITE_OK);
435 NS_ABORT_UNLESS(sqlite3_bind_double(stmt, 5, m_deltaY) == SQLITE_OK);
436 NS_ABORT_UNLESS(sqlite3_bind_text(stmt, 6, beamformingType.c_str(), -1, SQLITE_STATIC) ==
438 NS_ABORT_UNLESS(sqlite3_bind_int(stmt, 7, m_rngRun) == SQLITE_OK);
439 NS_ABORT_UNLESS(sqlite3_bind_int(stmt, 8, m_numerology) == SQLITE_OK);
440 NS_ABORT_UNLESS(sqlite3_bind_text(stmt, 9, m_gnbAntennaModel.c_str(), -1, SQLITE_STATIC) ==
442 NS_ABORT_UNLESS(sqlite3_bind_text(stmt, 10, m_ueAntennaModel.c_str(), -1, SQLITE_STATIC) ==
444 NS_ABORT_UNLESS(sqlite3_bind_int(stmt, 11, m_ueTxPower) == SQLITE_OK);
445 NS_ABORT_UNLESS(sqlite3_bind_text(stmt, 12, m_scenario.c_str(), -1, SQLITE_STATIC) ==
452 rc = sqlite3_step(stmt);
454 ++attemptCount == DB_ATTEMPT_LIMIT,
455 "Waiting too much for sqlite3 database to be ready. "
456 "Check if you have the database/table open with another program. "
457 "If yes, close it before running again cttc-realistic-beamforming program.\n\n");
458 }
while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
461 rc == SQLITE_OK || rc == SQLITE_DONE,
462 "Could not correctly execute the statement. Db error:" << sqlite3_errmsg(m_db));
466 rc = sqlite3_finalize(stmt);
468 ++attemptCount == DB_ATTEMPT_LIMIT,
469 "Waiting too much for sqlite3 database to be ready. "
470 "Check if you have the database/table open with another program. "
471 "If yes, close it before running again cttc-realistic-beamforming program.\n\n");
472 }
while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
474 rc == SQLITE_OK || rc == SQLITE_DONE,
475 "Could not correctly execute the statement. Db error:" << sqlite3_errmsg(m_db));
479CttcRealisticBeamforming::DeleteFromDatabaseIfAlreadyExist()
482 std::string cmd =
"DELETE FROM \"" + m_tableName +
486 "BeamformingType = ? AND "
488 "Numerology == ? AND "
489 "GnbAntenna = ? AND "
496 uint32_t attemptCount = 0;
499 rc = sqlite3_prepare_v2(m_db, cmd.c_str(),
static_cast<int>(cmd.size()), &stmt,
nullptr);
501 ++attemptCount == DB_ATTEMPT_LIMIT,
502 "Waiting too much for sqlite3 database to be ready. "
503 "Check if you have the database/table open with another program. "
504 "If yes, close it before running again cttc-realistic-beamforming program.\n\n");
505 }
while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
507 NS_ABORT_MSG_UNLESS(rc == SQLITE_OK || rc == SQLITE_DONE,
508 "Could not prepare correctly the delete statement. "
510 << sqlite3_errmsg(m_db) <<
". The full command is: \n"
513 std::string beamformingType = (m_beamforming == IDEAL) ?
"Ideal" :
"Real";
515 NS_ABORT_UNLESS(sqlite3_bind_double(stmt, 1, m_deltaX) == SQLITE_OK);
516 NS_ABORT_UNLESS(sqlite3_bind_double(stmt, 2, m_deltaY) == SQLITE_OK);
517 NS_ABORT_UNLESS(sqlite3_bind_text(stmt, 3, beamformingType.c_str(), -1, SQLITE_STATIC) ==
519 NS_ABORT_UNLESS(sqlite3_bind_int(stmt, 4, m_rngRun) == SQLITE_OK);
520 NS_ABORT_UNLESS(sqlite3_bind_int(stmt, 5, m_numerology) == SQLITE_OK);
521 NS_ABORT_UNLESS(sqlite3_bind_text(stmt, 6, m_gnbAntennaModel.c_str(), -1, SQLITE_STATIC) ==
523 NS_ABORT_UNLESS(sqlite3_bind_text(stmt, 7, m_ueAntennaModel.c_str(), -1, SQLITE_STATIC) ==
525 NS_ABORT_UNLESS(sqlite3_bind_int(stmt, 8, m_ueTxPower) == SQLITE_OK);
526 NS_ABORT_UNLESS(sqlite3_bind_text(stmt, 9, m_scenario.c_str(), -1, SQLITE_STATIC) == SQLITE_OK);
532 rc = sqlite3_step(stmt);
534 ++attemptCount == DB_ATTEMPT_LIMIT,
535 "Waiting too much for sqlite3 database to be ready. "
536 "Check if you have the database/table open with another program. "
537 "If yes, close it before running again cttc-realistic-beamforming program.\n\n");
538 }
while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
541 rc == SQLITE_OK || rc == SQLITE_DONE,
542 "Could not correctly execute the statement. Db error:" << sqlite3_errmsg(m_db));
546 rc = sqlite3_finalize(stmt);
548 ++attemptCount == DB_ATTEMPT_LIMIT,
549 "Waiting too much for sqlite3 database to be ready. "
550 "Check if you have the database/table open with another program. "
551 "If yes, close it before running again cttc-realistic-beamforming program.\n\n");
552 }
while (rc == SQLITE_BUSY || rc == SQLITE_LOCKED);
554 rc == SQLITE_OK || rc == SQLITE_DONE,
555 "Could not correctly execute the statement. Db error:" << sqlite3_errmsg(m_db));
559CttcRealisticBeamforming::CreateDlTrafficApplications(ApplicationContainer& serverAppDl,
560 ApplicationContainer& clientAppDl,
561 NodeContainer& ueNode,
562 Ptr<Node> remoteHost,
563 NetDeviceContainer ueNetDev,
564 Ipv4InterfaceContainer& ueIpIface)
566 NS_LOG_FUNCTION(
this);
567 uint16_t dlPort = 1234;
570 Time::FromDouble((m_packetSize * 8) /
static_cast<double>(m_udpRate.GetBitRate()), Time::S);
571 UdpServerHelper dlPacketSinkHelper(dlPort);
572 serverAppDl.Add(dlPacketSinkHelper.Install(ueNode));
574 for (uint32_t i = 0; i < ueNetDev.GetN(); i++)
576 UdpClientHelper dlClient(ueIpIface.GetAddress(i), dlPort);
577 dlClient.SetAttribute(
"MaxPackets", UintegerValue(0xFFFFFFFF));
578 dlClient.SetAttribute(
"PacketSize", UintegerValue(m_packetSize));
579 dlClient.SetAttribute(
581 TimeValue(udpInterval));
583 clientAppDl.Add(dlClient.Install(remoteHost));
587 serverAppDl.Start(m_udpAppStartTimeDl);
588 clientAppDl.Start(m_udpAppStartTimeDl);
589 serverAppDl.Stop(m_udpAppStopTimeDl);
590 clientAppDl.Stop(m_udpAppStopTimeDl);
601 simSetup->UeReception(params);
607 m_sinrStats.Update(params.m_sinr);
610CttcRealisticBeamforming::~CttcRealisticBeamforming()
613 m_outSinrFile.close();
616 int rc = SQLITE_FAIL;
617 rc = sqlite3_close_v2(m_db);
618 NS_ABORT_MSG_UNLESS(rc == SQLITE_OK,
"Failed to close DB");
622CttcRealisticBeamforming::PrintResultsToFiles()
624 NS_LOG_FUNCTION(
this);
625 m_outSinrFile << m_sinrStats.getMean() << std::endl;
629CttcRealisticBeamforming::Configure(
double deltaX,
631 BeamformingMethod beamforming,
632 RealisticBfManager::TriggerEvent realTriggerEvent,
633 uint32_t idealPeriodicity,
636 std::string gNbAntennaModel,
637 std::string ueAntennaModel,
638 std::string scenario,
640 std::string resultsDirPath,
643 std::string tableName,
644 std::string condition)
647 NS_LOG_FUNCTION(
this);
650 m_beamforming = beamforming;
652 m_realTriggerEvent = realTriggerEvent;
653 m_idealPeriodicity = idealPeriodicity;
654 m_numerology = numerology;
655 m_gnbAntennaModel = gNbAntennaModel;
656 m_ueAntennaModel = ueAntennaModel;
657 m_scenario = scenario;
658 m_ueTxPower = uePower;
659 m_resultsDirPath = resultsDirPath;
661 m_condition = condition;
662 if (scenario ==
"UMa")
668 else if (scenario ==
"RMa")
673 else if (scenario ==
"UMi")
678 else if (scenario ==
"InH-OfficeOpen")
685 NS_ABORT_MSG(
"Not supported scenario:" << scenario);
690CttcRealisticBeamforming::RunSimulation()
692 NS_LOG_FUNCTION(
this);
695 SeedManager::SetRun(m_rngRun);
698 NodeContainer gNbNode;
699 NodeContainer ueNode;
704 Ptr<ListPositionAllocator> positions = CreateObject<ListPositionAllocator>();
705 positions->Add(Vector(m_gNbX, m_gNbY, m_gNbHeight));
707 Vector(m_gNbX + m_deltaX, m_gNbY + m_deltaY, m_ueHeight));
708 MobilityHelper mobility;
709 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
710 mobility.SetPositionAllocator(positions);
711 mobility.Install(gNbNode);
712 mobility.Install(ueNode);
715 Ptr<NrHelper> nrHelper = CreateObject<NrHelper>();
716 Ptr<NrPointToPointEpcHelper> nrEpcHelper = CreateObject<NrPointToPointEpcHelper>();
719 Ptr<BeamformingHelperBase> beamformingHelper;
720 if (m_beamforming == CttcRealisticBeamforming::IDEAL)
722 beamformingHelper = CreateObject<IdealBeamformingHelper>();
723 beamformingHelper->SetAttribute(
"BeamformingPeriodicity",
724 TimeValue(MilliSeconds(m_idealPeriodicity)));
727 else if (m_beamforming == CttcRealisticBeamforming::REALISTIC)
729 beamformingHelper = CreateObject<RealisticBeamformingHelper>();
734 nrHelper->SetGnbBeamManagerAttribute(
"TriggerEvent", EnumValue(m_realTriggerEvent));
738 NS_ABORT_MSG(
"Unknown beamforming type.");
740 nrHelper->SetBeamformingHelper(beamformingHelper);
741 nrHelper->SetEpcHelper(nrEpcHelper);
743 Config::SetDefault(
"ns3::NrUePhy::EnableUplinkPowerControl", BooleanValue(
false));
761 Ptr<NrChannelHelper> channelHelper = CreateObject<NrChannelHelper>();
762 channelHelper->ConfigureFactories(m_scenario, m_condition);
764 channelHelper->AssignChannelsToBands({band});
768 nrHelper->SetGnbAntennaAttribute(
"NumRows", UintegerValue(4));
769 nrHelper->SetGnbAntennaAttribute(
"NumColumns", UintegerValue(8));
771 if (m_gnbAntennaModel ==
"Iso")
773 nrHelper->SetGnbAntennaAttribute(
"AntennaElement",
774 PointerValue(CreateObject<IsotropicAntennaModel>()));
778 nrHelper->SetGnbAntennaAttribute(
"AntennaElement",
779 PointerValue(CreateObject<ThreeGppAntennaModel>()));
783 nrHelper->SetUeAntennaAttribute(
"NumRows", UintegerValue(2));
784 nrHelper->SetUeAntennaAttribute(
"NumColumns", UintegerValue(4));
786 if (m_ueAntennaModel ==
"Iso")
788 nrHelper->SetUeAntennaAttribute(
"AntennaElement",
789 PointerValue(CreateObject<IsotropicAntennaModel>()));
793 nrHelper->SetUeAntennaAttribute(
"AntennaElement",
794 PointerValue(CreateObject<ThreeGppAntennaModel>()));
797 nrHelper->SetSchedulerAttribute(
"SrsSymbols", UintegerValue(1));
800 NetDeviceContainer gNbDev = nrHelper->InstallGnbDevice(gNbNode, allBwps);
801 NetDeviceContainer ueNetDev = nrHelper->InstallUeDevice(ueNode, allBwps);
803 int64_t randomStream = m_rngRun;
804 randomStream += nrHelper->AssignStreams(gNbDev, randomStream);
805 randomStream += nrHelper->AssignStreams(ueNetDev, randomStream);
807 for (uint32_t i = 0; i < gNbDev.GetN(); i++)
809 nrHelper->GetGnbPhy(gNbDev.Get(i), 0)
810 ->SetAttribute(
"Numerology", UintegerValue(m_numerology));
811 nrHelper->GetGnbPhy(gNbDev.Get(i), 0)->SetAttribute(
"TxPower", DoubleValue(m_gNbTxPower));
813 for (uint32_t j = 0; j < ueNetDev.GetN(); j++)
815 nrHelper->GetUePhy(ueNetDev.Get(j), 0)->SetAttribute(
"TxPower", DoubleValue(m_ueTxPower));
819 auto [remoteHost, remoteHostIpv4Address] =
820 nrEpcHelper->SetupRemoteHost(
"100Gb/s", 2500, Seconds(0.000));
821 InternetStackHelper internet;
822 internet.Install(ueNode);
823 Ipv4InterfaceContainer ueIpIface;
824 ueIpIface = nrEpcHelper->AssignUeIpv4Address(NetDeviceContainer(ueNetDev));
827 nrHelper->AttachToGnb(ueNetDev.Get(0), gNbDev.Get(0));
830 ApplicationContainer clientAppDl;
831 ApplicationContainer serverAppDl;
832 CreateDlTrafficApplications(clientAppDl, serverAppDl, ueNode, remoteHost, ueNetDev, ueIpIface);
835 for (uint32_t i = 0; i < ueNetDev.GetN(); i++)
837 Ptr<NrSpectrumPhy> ue1SpectrumPhy =
838 DynamicCast<NrUeNetDevice>(ueNetDev.Get(i))->GetPhy(0)->GetSpectrumPhy();
839 ue1SpectrumPhy->TraceConnectWithoutContext(
"RxPacketTraceUe",
840 MakeBoundCallback(&UeReceptionTrace,
this));
841 Ptr<NrInterference> ue1SpectrumPhyInterference = ue1SpectrumPhy->GetNrInterference();
842 NS_ABORT_IF(!ue1SpectrumPhyInterference);
845 Simulator::Stop(m_simTime);
847 Simulator::Destroy();
851main(
int argc,
char* argv[])
854 double deltaX = 10.0;
855 double deltaY = 10.0;
856 std::string algType =
"Real";
857 std::string realTriggerEvent =
860 uint32_t idealPeriodicity = 10;
863 uint16_t numerology = 2;
864 std::string gnbAntenna =
"Iso";
865 std::string ueAntenna =
"Iso";
866 double ueTxPower = 1;
867 std::string scenario =
"UMa";
868 std::string condition =
"Default";
870 std::string resultsDir =
".";
871 std::string simTag =
"";
872 std::string dbName =
"realistic-beamforming.db";
873 std::string tableName =
"results";
875 CttcRealisticBeamforming::BeamformingMethod beamformingType;
876 RealisticBfManager::TriggerEvent triggerEventEnum = RealisticBfManager::SRS_COUNT;
877 CommandLine cmd(__FILE__);
879 cmd.AddValue(
"deltaX",
880 "Determines X coordinate of UE wrt. to gNB X coordinate [meters].",
882 cmd.AddValue(
"deltaY",
883 "Determines Y coordinate of UE wrt. to gNB Y coordinate [meters].",
885 cmd.AddValue(
"algType",
"Algorithm type to be used. Can be: 'Ideal' or 'Real'.", algType);
888 "In the case of the realistic beafmorming (algType=\"Real\") it defines when the "
890 "vectors will be updated: upon each SRS reception but with a certain delay, or after "
891 "certain number of SRSs."
892 "For the first option the parameter should be configured with 'DelayedUpdate' and for the "
893 "second option the value to be configured is 'SrsCount'",
897 "In the case of the ideal beamforminng (algType=\"Ideal\") it defines how often the "
898 "beamforming vectors will be updated in milli seconds [ms].",
900 cmd.AddValue(
"rngRun",
"Rng run random number.", rngRun);
901 cmd.AddValue(
"numerology",
"Numerology to be used.", numerology);
902 cmd.AddValue(
"gnbAntenna",
"Configure antenna elements at gNb: Iso or 3gpp", gnbAntenna);
903 cmd.AddValue(
"ueAntenna",
"Configure antenna elements at UE: Iso or 3gpp", ueAntenna);
904 cmd.AddValue(
"scenario",
"Deployment scenario: UMa, UMi, InH-OfficeOpen", scenario);
905 cmd.AddValue(
"condition",
"The channel condition: Default, NLOS or LOS", condition);
906 cmd.AddValue(
"uePower",
"Tx power to be used by the UE [dBm].", ueTxPower);
908 cmd.AddValue(
"resultsDir",
"Directory where to store the simulation results.", resultsDir);
909 cmd.AddValue(
"simTag",
910 "Tag to be appended to output filenames to distinguish simulation campaigns.",
912 cmd.AddValue(
"dbName",
"Database name.", dbName);
913 cmd.AddValue(
"tableName",
"Table name.", tableName);
914 cmd.Parse(argc, argv);
916 if (algType ==
"Ideal")
918 beamformingType = CttcRealisticBeamforming::IDEAL;
920 else if (algType ==
"Real")
922 beamformingType = CttcRealisticBeamforming::REALISTIC;
924 if (realTriggerEvent ==
"SrsCount")
926 triggerEventEnum = RealisticBfManager::SRS_COUNT;
928 else if (realTriggerEvent ==
"DelayedUpdate")
930 triggerEventEnum = RealisticBfManager::DELAYED_UPDATE;
935 "Not supported trigger event for the realistic type of beamforming:" << algType);
940 NS_ABORT_MSG(
"Not supported value for algType:" << algType);
943 CttcRealisticBeamforming simpleBeamformingScenario;
944 simpleBeamformingScenario.Configure(deltaX,
960 simpleBeamformingScenario.PrepareDatabase();
961 simpleBeamformingScenario.PrepareOutputFiles();
962 simpleBeamformingScenario.RunSimulation();
963 simpleBeamformingScenario.PrintResultsToDatabase();
964 simpleBeamformingScenario.PrintResultsToFiles();
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.
static TypeId GetTypeId()
GetTypeId.
std::string BuildFileNameString(std::string directoryName, std::string filePrefix, std::string tag)
std::string BuildTag(bool gNbAntennaModel, bool ueAntennaModel, std::string scenario, double speed)
void UeReceptionTrace(Nr3gppIndoorCalibration *scenario, RxPacketTraceParams params)
std::vector< std::reference_wrapper< BandwidthPartInfoPtr > > BandwidthPartInfoPtrVector
vector of unique_ptr of BandwidthPartInfo
Minimum configuration requirements for a OperationBand.
Operation band information structure.
The RxPacketTraceParams struct.