20#include <ns3/boolean.h>
21#include <ns3/double.h>
23#include <ns3/uinteger.h>
45 TypeId(
"ns3::UniformPlanarArray")
47 .AddConstructor<UniformPlanarArray>()
48 .SetGroupName(
"Antenna")
50 "AntennaHorizontalSpacing",
51 "Horizontal spacing between antenna elements, in multiples of wave length",
55 MakeDoubleChecker<double>(0.0))
56 .AddAttribute(
"AntennaVerticalSpacing",
57 "Vertical spacing between antenna elements, in multiples of wave length",
61 MakeDoubleChecker<double>(0.0))
62 .AddAttribute(
"NumColumns",
63 "Horizontal size of the array",
67 MakeUintegerChecker<uint32_t>(1))
68 .AddAttribute(
"NumRows",
69 "Vertical size of the array",
73 MakeUintegerChecker<uint32_t>(1))
74 .AddAttribute(
"BearingAngle",
75 "The bearing angle in radians",
78 MakeDoubleChecker<double>(-M_PI, M_PI))
79 .AddAttribute(
"DowntiltAngle",
80 "The downtilt angle in radians",
83 MakeDoubleChecker<double>(-M_PI, M_PI))
84 .AddAttribute(
"PolSlantAngle",
85 "The polarization slant angle in radians",
88 MakeDoubleChecker<double>(-M_PI, M_PI));
188std::pair<double, double>
203 Angles aPrime(phiPrime, thetaPrime);
211 double fieldThetaPrime = pow(10, aPrimeDb / 20) *
m_cosPolSlant;
212 double fieldPhiPrime = pow(10, aPrimeDb / 20) *
m_sinPolSlant;
216 double psi = std::arg(std::complex<double>(
m_cosBeta * sinIncl -
m_sinBeta * cosIncl * cosAzim,
222 double fieldTheta = cos(psi) * fieldThetaPrime - sin(psi) * fieldPhiPrime;
223 double fieldPhi = sin(psi) * fieldThetaPrime + cos(psi) * fieldPhiPrime;
226 << fieldTheta * fieldTheta + fieldPhi * fieldPhi);
228 return std::make_pair(fieldPhi, fieldTheta);
Class holding the azimuth and inclination angles of spherical coordinates.
double GetInclination() const
Getter for inclination angle.
double GetAzimuth() const
Getter for azimuth angle.
virtual double GetGainDb(Angles a)=0
this method is expected to be re-implemented by each antenna model
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.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
#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