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",
63 .AddAttribute(
"BearingAngle",
64 "The bearing angle in radians",
68 .AddAttribute(
"DowntiltAngle",
69 "The downtilt angle in radians",
73 .AddAttribute(
"PolSlantAngle",
74 "The polarization slant angle in radians",
79 .AddAttribute(
"NumVerticalPorts",
80 "Vertical number of ports",
85 .AddAttribute(
"NumHorizontalPorts",
86 "Horizontal number of ports",
91 .AddAttribute(
"IsDualPolarized",
92 "If true, dual polarized antenna",
196std::pair<double, double>
206 double cosIncl = cos(inclination);
207 double sinIncl = sin(inclination);
208 double cosAzim = cos(azimuth -
m_alpha);
209 double sinAzim = sin(azimuth -
m_alpha);
214 Angles aPrime(phiPrime, thetaPrime);
222 double fieldThetaPrime =
224 double fieldPhiPrime =
229 double psi = std::arg(std::complex<double>(
m_cosBeta * sinIncl -
m_sinBeta * cosIncl * cosAzim,
235 double fieldTheta = cos(psi) * fieldThetaPrime - sin(psi) * fieldPhiPrime;
236 double fieldPhi = sin(psi) * fieldThetaPrime + cos(psi) * fieldPhiPrime;
239 << fieldTheta * fieldTheta + fieldPhi * fieldPhi);
241 return std::make_pair(fieldPhi, fieldTheta);
248 uint64_t tmpIndex = index;
291 "The number of vertical ports must divide number of rows");
300 "The number of horizontal ports must divide number of columns");
350 auto firstPolPortIdx = portIndex;
351 auto polarizationOffset = 0;
353 if (firstPolPortIdx >= arraySize)
355 firstPolPortIdx = portIndex - arraySize;
363 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.
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
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...
#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.
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeChecker > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
double RadiansToDegrees(double radians)
converts radians to degrees