20 #include <ns3/isotropic-antenna-model.h>
22 #include <ns3/double.h>
23 #include <ns3/uinteger.h>
24 #include <ns3/boolean.h>
25 #include <ns3/pointer.h>
38 size_t N = cv.size ();
49 for (std::size_t i = 0; i < N - 1; ++i)
53 os << cv[N - 1] <<
"]";
58 : m_isBfVectorValid {false}
75 .SetGroupName (
"Antenna")
76 .AddAttribute (
"AntennaElement",
77 "A pointer to the antenna element used by the phased array",
80 MakePointerChecker<AntennaModel> ())
111 for (uint64_t i = 0; i < vector.size (); i++)
116 return std::sqrt (
norm);
129 for (uint64_t i = 0; i < beamformingVector.size (); i++)
131 beamformingVector[i] = std::conj (beamformingVector[i]) /
norm;
134 return beamformingVector;
150 steeringVector[i] = std::polar<double> (1.0, phase);
152 return steeringVector;
Class holding the azimuth and inclination angles of spherical coordinates.
double GetInclination(void) const
Getter for inclination angle.
double GetAzimuth(void) const
Getter for azimuth angle.
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
Ptr< const AntennaModel > GetAntennaElement(void) const
Returns a pointer to the AntennaModel instance used to model the elements of the array.
ComplexVector GetSteeringVector(Angles a) const
Returns the steering vector that points toward the specified position.
PhasedArrayModel(void)
Constructor.
virtual ~PhasedArrayModel(void)
Destructor.
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.
ComplexVector GetBeamformingVector(void) const
Returns the beamforming vector that is currently being used.
Ptr< AntennaModel > m_antennaElement
the model of the antenna element in use
void SetAntennaElement(Ptr< AntennaModel > antennaElement)
Sets the antenna model to be used.
virtual uint64_t GetNumberOfElements(void) const =0
Returns the number of antenna elements.
bool m_isBfVectorValid
ensures the validity of the beamforming vector
static double ComputeNorm(const ComplexVector &vector)
Utility method to compute the euclidean norm of a ComplexVector.
static TypeId GetTypeId(void)
Get the type ID.
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
std::vector< std::complex< double > > ComplexVector
type definition for complex vectors
Hold objects of type Ptr<T>.
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.
#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)