11#include "ns3/boolean.h"
12#include "ns3/double.h"
14#include "ns3/pointer.h"
15#include "ns3/uinteger.h"
28 : m_isBfVectorValid{false}
43 TypeId(
"ns3::PhasedArrayModel")
45 .SetGroupName(
"Antenna")
46 .AddAttribute(
"AntennaElement",
47 "A pointer to the antenna element used by the phased array",
69 "The beamforming vector should be Set before it's Get, and should refer to the "
70 "current array configuration");
79 "The beamforming vector should be Set before it's Get, and should refer to the "
80 "current array configuration");
101 beamformingVector[i] = std::conj(beamformingVector[i]) / normRes;
104 return beamformingVector;
114 double phase = -2 * M_PI *
118 steeringVector[i] = std::polar<double>(1.0, phase);
120 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.
A base class which provides memory management and object aggregation.
const PhasedArrayModel::ComplexVector & GetBeamformingVectorRef() const
Returns the const reference of the beamforming vector that is currently being used.
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 ...
virtual uint16_t GetNumPorts() const =0
Get the number of ports.
uint32_t GetId() const
Returns the ID of this antenna array instance.
PhasedArrayModel()
Constructor.
static SymmetricAdjacencyMatrix< bool > m_outOfDateAntennaPairChannel
matrix indicating whether a channel matrix between a pair of antennas needs to be updated after a cha...
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.
bool IsChannelOutOfDate(Ptr< const PhasedArrayModel > antennaB) const
Returns whether the channel needs to be updated due to antenna setting changes.
ComplexVector GetBeamformingVector() const
Returns the beamforming vector that is currently being used.
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...
~PhasedArrayModel() override
Destructor.
uint32_t m_id
the ID of this antenna array instance
void SetBeamformingVector(const ComplexVector &beamformingVector)
Sets the beamforming vector to be used.
ComplexVector m_beamformingVector
the beamforming vector in use
virtual size_t GetNumElems() const =0
Returns the number of antenna elements.
static TypeId GetTypeId()
Get the type ID.
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
T GetValue(size_t row, size_t column)
Retrieve the value of matrix (row, column) node.
void SetValueAdjacent(size_t row, T value)
Set the value of adjacent nodes of a given node (all columns of a given row, and its reflection)
void AddRow()
Add new row to the adjacency matrix.
void SetValue(size_t row, size_t column, T value)
Set the value of matrix (row, column) node.
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)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
#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 ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#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.