9#include "ns3/boolean.h"
10#include "ns3/double.h"
12#include "ns3/uinteger.h"
34 TypeId(
"ns3::UniformPlanarArray")
36 .AddConstructor<UniformPlanarArray>()
37 .SetGroupName(
"Antenna")
39 "AntennaHorizontalSpacing",
40 "Horizontal spacing between antenna elements, in multiples of wave length",
45 .AddAttribute(
"AntennaVerticalSpacing",
46 "Vertical spacing between antenna elements, in multiples of wave length",
51 .AddAttribute(
"NumColumns",
52 "Horizontal size of the array",
57 .AddAttribute(
"NumRows",
58 "Vertical size of the array",
65 "The bearing angle in radians",
71 "The downtilt angle in radians",
75 .AddAttribute(
"PolSlantAngle",
76 "The polarization slant angle in radians",
81 .AddAttribute(
"NumVerticalPorts",
82 "Vertical number of ports",
87 .AddAttribute(
"NumHorizontalPorts",
88 "Horizontal number of ports",
93 .AddAttribute(
"IsDualPolarized",
94 "If true, dual polarized antenna",
214std::pair<double, double>
224 double cosIncl = cos(inclination);
225 double sinIncl = sin(inclination);
226 double cosAzim = cos(azimuth -
m_alpha);
227 double sinAzim = sin(azimuth -
m_alpha);
232 Angles aPrime(phiPrime, thetaPrime);
240 double fieldThetaPrime =
242 double fieldPhiPrime =
247 double psi = std::arg(std::complex<double>(
m_cosBeta * sinIncl -
m_sinBeta * cosIncl * cosAzim,
253 double fieldTheta = cos(psi) * fieldThetaPrime - sin(psi) * fieldPhiPrime;
254 double fieldPhi = sin(psi) * fieldThetaPrime + cos(psi) * fieldPhiPrime;
257 << fieldTheta * fieldTheta + fieldPhi * fieldPhi);
259 return std::make_pair(fieldPhi, fieldTheta);
266 uint64_t tmpIndex = index;
309 "The number of vertical ports must divide number of rows");
322 "The number of horizontal ports must divide number of columns");
376 auto firstPolPortIdx = portIndex;
377 auto polarizationOffset = 0;
379 if (firstPolPortIdx >= arraySize)
381 firstPolPortIdx = portIndex - arraySize;
389 return (vElemIdx *
GetNumColumns() + hElemIdx + polarizationOffset);
Class holding the azimuth and inclination angles of spherical coordinates.
double GetInclination() const
Getter for inclination angle.
double GetAzimuth() const
Getter for azimuth angle.
AttributeValue implementation for Boolean.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Class implementing the phased array model virtual base class.
Ptr< AntennaModel > m_antennaElement
the model of the antenna element in use
bool m_isBfVectorValid
ensures the validity of the beamforming vector
void InvalidateChannels() const
After changing the antenna settings, InvalidateChannels() should be called to mark up-to-date channel...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double RadiansToDegrees(double radians)
converts radians to degrees