5#include "ideal-beamforming-helper.h"
7#include <ns3/ideal-beamforming-algorithm.h>
9#include <ns3/nr-gnb-net-device.h>
10#include <ns3/nr-gnb-phy.h>
11#include <ns3/nr-spectrum-phy.h>
12#include <ns3/nr-ue-net-device.h>
13#include <ns3/nr-ue-phy.h>
14#include <ns3/object-factory.h>
15#include <ns3/vector.h>
20NS_LOG_COMPONENT_DEFINE(
"IdealBeamformingHelper");
21NS_OBJECT_ENSURE_REGISTERED(IdealBeamformingHelper);
25 NS_LOG_FUNCTION(
this);
30 NS_LOG_FUNCTION(
this);
35IdealBeamformingHelper::DoInitialize()
40 BeamformingHelperBase::DoInitialize();
47 TypeId(
"ns3::IdealBeamformingHelper")
49 .AddConstructor<IdealBeamformingHelper>()
50 .AddAttribute(
"BeamformingMethod",
51 "Type of the ideal beamforming method in the case that it is enabled, by "
52 "default is \"cell scan\" method.",
56 .AddAttribute(
"BeamformingPeriodicity",
57 "Interval between consecutive beamforming method executions. If set to 0 "
58 "it will not be updated.",
59 TimeValue(MilliSeconds(100)),
68 const Ptr<NrUeNetDevice>& ueDev)
70 NS_LOG_FUNCTION(
this);
77 for (std::size_t ccId = 0; ccId < gnbDev->GetCcMapSize(); ccId++)
79 Ptr<NrSpectrumPhy> gnbSpectrumPhy = gnbDev->GetPhy(ccId)->GetSpectrumPhy();
80 Ptr<NrSpectrumPhy> ueSpectrumPhy = ueDev->GetPhy(ccId)->GetSpectrumPhy();
83 RunTask(gnbSpectrumPhy, ueSpectrumPhy);
90 NS_LOG_FUNCTION(
this);
91 NS_LOG_INFO(
"Running the beamforming method. There are :" <<
m_spectrumPhyPair.size()
96 RunTask(task.first, task.second);
102 const Ptr<NrSpectrumPhy>& ueSpectrumPhy)
const
104 NS_LOG_FUNCTION(
this);
111 NS_LOG_FUNCTION(
this);
119 NS_LOG_FUNCTION(
this);
120 NS_LOG_INFO(
"Beamforming timer expired; programming a beamforming");
132 NS_LOG_FUNCTION(
this);
133 NS_ABORT_MSG_IF(v == MilliSeconds(0),
"Periodicity must be greater than 0 ms.");
140 NS_LOG_FUNCTION(
this);