20#include <ns3/boolean.h>
21#include <ns3/double.h>
22#include <ns3/isotropic-antenna-model.h>
24#include <ns3/pointer.h>
25#include <ns3/uinteger.h>
50 for (std::size_t i = 0; i < N - 1; ++i)
54 os << cv[N - 1] <<
"]";
59 : m_isBfVectorValid{false}
72 TypeId(
"ns3::PhasedArrayModel")
74 .SetGroupName(
"Antenna")
75 .AddAttribute(
"AntennaElement",
76 "A pointer to the antenna element used by the phased array",
79 MakePointerChecker<AntennaModel>());
98 "The beamforming vector should be Set before it's Get, and should refer to the "
99 "current array configuration");
109 double normRes =
norm(beamformingVector);
113 beamformingVector[i] = std::conj(beamformingVector[i]) / normRes;
116 return beamformingVector;
126 double phase = -2 * M_PI *
130 steeringVector[i] = std::polar<double>(1.0, phase);
132 return steeringVector;
Class holding the azimuth and inclination angles of spherical coordinates.
double GetInclination() const
Getter for inclination angle.
double GetAzimuth() const
Getter for azimuth angle.
MatrixArray class inherits ValArray class and provides additional interfaces to ValArray which enable...
A base class which provides memory management and object aggregation.
static uint32_t m_idCounter
the ID counter that is used to determine the unique antenna array ID
ComplexVector GetSteeringVector(Angles a) const
Returns the steering vector that points toward the specified position.
virtual Vector GetElementLocation(uint64_t index) const =0
Returns the location of the antenna element with the specified index, normalized with respect to the ...
uint32_t GetId() const
Returns the ID of this antenna array instance.
PhasedArrayModel()
Constructor.
Ptr< AntennaModel > m_antennaElement
the model of the antenna element in use
Ptr< const AntennaModel > GetAntennaElement() const
Returns a pointer to the AntennaModel instance used to model the elements of the array.
void SetAntennaElement(Ptr< AntennaModel > antennaElement)
Sets the antenna model to be used.
ComplexVector GetBeamformingVector() const
Returns the beamforming vector that is currently being used.
bool m_isBfVectorValid
ensures the validity of the beamforming vector
~PhasedArrayModel() override
Destructor.
uint32_t m_id
the ID of this antenna array instance
virtual size_t GetNumberOfElements() const =0
Returns the number of antenna elements.
void SetBeamformingVector(const ComplexVector &beamformingVector)
Sets the beamforming vector to be used.
ComplexVector m_beamformingVector
the beamforming vector in use
static TypeId GetTypeId()
Get the type ID.
Hold objects of type Ptr<T>.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#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 AttributeAccessor > MakePointerAccessor(T1 a1)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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.
const double norm
Normalization to obtain randoms on [0,1).
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)