5G-LENA nr-v3.0-32-g83aee33
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches
beam-manager.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#ifndef SRC_NR_MODEL_BEAM_MANAGER_H_
8#define SRC_NR_MODEL_BEAM_MANAGER_H_
9
10#include "beamforming-vector.h"
11
12#include "ns3/event-id.h"
13#include <ns3/net-device.h>
14#include <ns3/nstime.h>
15
16#include <map>
17
18namespace ns3
19{
20
21class NrUeNetDevice;
22class NrGnbNetDevice;
23class BeamformingHelperBase;
24
34class BeamManager : public Object
35{
37
38 public:
43
47 ~BeamManager() override;
48
53 static TypeId GetTypeId();
54
55 /*
56 * \brief configures a predefined beam to use for directional transmissions
57 */
58 void SetPredefinedBeam(PhasedArrayModel::ComplexVector predefinedBeam);
59
65 void SetPredefinedBeam(uint16_t sector, double elevation);
66
72 void Configure(const Ptr<UniformPlanarArray>& antennaArray);
73
79 PhasedArrayModel::ComplexVector GetVector(const BeamformingVector& v) const;
80
86 BeamId GetBeamId(const BeamformingVector& v) const;
87
92 Ptr<const UniformPlanarArray> GetAntenna() const;
93
94 typedef std::map<const Ptr<const NetDevice>, BeamformingVector>
97
105 virtual void SaveBeamformingVector(const BeamformingVector& bfv,
106 const Ptr<const NetDevice>& device);
111 virtual void ChangeBeamformingVector(const Ptr<const NetDevice>& device);
112
117
123 virtual PhasedArrayModel::ComplexVector GetCurrentBeamformingVector();
124
130 virtual PhasedArrayModel::ComplexVector GetBeamformingVector(
131 const Ptr<NetDevice>& device) const;
132
138 virtual BeamId GetBeamId(const Ptr<NetDevice>& device) const;
139
145 void SetSector(uint16_t sector, double elevation) const;
146
152 void SetSectorAz(double azimuth, double zenith) const;
153
154 private:
155 Ptr<UniformPlanarArray>
156 m_antennaArray;
157 uint32_t m_numRows{0};
159 uint32_t m_numColumns{0};
161 uint32_t m_numPortElems{0};
162 bool m_isPolDual{false};
163 BeamformingVector m_omniTxRxW;
165 BeamformingStorage m_beamformingVectorMap;
166 BeamformingVector m_predefinedDirTxRxW;
168};
169
170} /* namespace ns3 */
171
172#endif /* SRC_NR_MODEL_BEAM_MANAGER_H_ */
Representation of a beam id.
Definition beam-id.h:28
Antenna array management.
static TypeId GetTypeId()
GetTypeId.
BeamManager()
BeamManager constructor.
std::map< const Ptr< const NetDevice >, BeamformingVector > BeamformingStorage
void SetSectorAz(double azimuth, double zenith) const
Set the Sector.
PhasedArrayModel::ComplexVector GetVector(const BeamformingVector &v) const
Get weight vector from a BeamformingVector.
virtual PhasedArrayModel::ComplexVector GetBeamformingVector(const Ptr< NetDevice > &device) const
Function that returns the beamforming vector weights that is used to communicated with a specified de...
virtual PhasedArrayModel::ComplexVector GetCurrentBeamformingVector()
Function that returns the beamforming vector that is currently being used by the antenna.
BeamId GetBeamId(const BeamformingVector &v) const
Extract the beam id from the beamforming vector specified.
virtual void ChangeToQuasiOmniBeamformingVector()
Change current beamforming vector to quasi-omni beamforming vector.
void Configure(const Ptr< UniformPlanarArray > &antennaArray)
Configures quasi-omni beamforming vector.
void SetSector(uint16_t sector, double elevation) const
Set the Sector.
Ptr< const UniformPlanarArray > GetAntenna() const
Get a pointer to the current antenna.
~BeamManager() override
~BeamManager
virtual void ChangeBeamformingVector(const Ptr< const NetDevice > &device)
Change the beamforming vector for tx/rx to/from specified device.
virtual void SaveBeamformingVector(const BeamformingVector &bfv, const Ptr< const NetDevice > &device)
Function that saves the beamforming weights of the antenna for transmission or reception to/from a sp...
The BeamformingHelperBase class that is being used as the general interface for beamforming helper cl...
std::pair< PhasedArrayModel::ComplexVector, BeamId > BeamformingVector
Physical representation of a beam.