5G-LENA nr-v3.0-33-g7aea1e4
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
realistic-beamforming-helper.h
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
3// Copyright (c) 2020 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4//
5// SPDX-License-Identifier: GPL-2.0-only
6
7#include "beamforming-helper-base.h"
8
9#include <ns3/beamforming-vector.h>
10#include <ns3/node.h>
11#include <ns3/object-factory.h>
12#include <ns3/realistic-beamforming-algorithm.h>
13
14#ifndef SRC_NR_HELPER_REALISTIC_BEAMFORMING_HELPER_H_
15#define SRC_NR_HELPER_REALISTIC_BEAMFORMING_HELPER_H_
16
17namespace ns3
18{
19
20class NrGnbNetDevice;
21class NrUeNetDevice;
22class NrGnbPhy;
23class NrUePhy;
24class NrSpectrumPhy;
25
54static constexpr uint32_t
55Cantor(uint32_t x1, uint32_t x2)
56{
57 return (((x1 + x2) * (x1 + x2 + 1)) / 2) + x2;
58}
59
61{
62 public:
67 static TypeId GetTypeId();
73 void AddBeamformingTask(const Ptr<NrGnbNetDevice>& gNbDev,
74 const Ptr<NrUeNetDevice>& ueDev) override;
75
81 void SaveSrsSinrReport(uint16_t cellId, uint16_t rnti, double srsSinr);
89 void TriggerBeamformingAlgorithm(uint16_t cellId, uint16_t rnti, double srsSinr);
90
95 void SetBeamformingMethod(const TypeId& beamformingMethod) override;
96
97 private:
98 BeamformingVectorPair GetBeamformingVectors(
99 const Ptr<NrSpectrumPhy>& gnbSpectrumPhy,
100 const Ptr<NrSpectrumPhy>& ueSpectrumPhy) const override;
101
102 typedef std::map<SpectrumPhyPair, Ptr<RealisticBeamformingAlgorithm>>
103 SpectrumPhyPairToAlgorithm;
104
105 SpectrumPhyPairToAlgorithm m_spectrumPhyPairToAlgorithm;
106};
107
108}; // namespace ns3
109
110#endif /* SRC_NR_HELPER_REALISTIC_BEAMFORMING_HELPER_H_ */
The BeamformingHelperBase class that is being used as the general interface for beamforming helper cl...
void AddBeamformingTask(const Ptr< NrGnbNetDevice > &gNbDev, const Ptr< NrUeNetDevice > &ueDev) override
Adds the beamforming task to the list of tasks \gnbDev gNbDev pointer to gNB device \ueDev ueDev poin...
void SetBeamformingMethod(const TypeId &beamformingMethod) override
SetBeamformingMethod.
void TriggerBeamformingAlgorithm(uint16_t cellId, uint16_t rnti, double srsSinr)
When the condition for triggering a beamforming update is fulfilled this function will be triggered.
static TypeId GetTypeId()
Get the Type ID.
void SaveSrsSinrReport(uint16_t cellId, uint16_t rnti, double srsSinr)
Function that forwards the SRS SINR to the correct RealisticBeamformingAlgorithm.
static constexpr uint32_t Cantor(uint32_t x1, uint32_t x2)
The RealisticBeamformingHelper class that helps user create beamforming tasks and configure when thes...