A Discrete-Event Network Simulator
API
phased-array-model.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 University of Padova, Dep. of Information Engineering, SIGNET lab.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#ifndef PHASED_ARRAY_MODEL_H
19#define PHASED_ARRAY_MODEL_H
20
21#include <ns3/angles.h>
22#include <ns3/antenna-model.h>
23#include <ns3/object.h>
24
25#include <complex>
26
27namespace ns3
28{
29
36{
37 public:
42
46 ~PhasedArrayModel() override;
47
52 static TypeId GetTypeId();
53
54 typedef std::vector<std::complex<double>>
56
65 virtual std::pair<double, double> GetElementFieldPattern(Angles a) const = 0;
66
73 virtual Vector GetElementLocation(uint64_t index) const = 0;
74
79 virtual uint64_t GetNumberOfElements() const = 0;
80
85 void SetBeamformingVector(const ComplexVector& beamformingVector);
86
92
99
106
111 void SetAntennaElement(Ptr<AntennaModel> antennaElement);
112
118
123 uint32_t GetId() const;
124
125 protected:
131 static double ComputeNorm(const ComplexVector& vector);
132
136 static uint32_t
139};
140
148std::ostream& operator<<(std::ostream& os, const PhasedArrayModel::ComplexVector& cv);
149
150} /* namespace ns3 */
151
152#endif /* PHASED_ARRAY_MODEL_H */
Class holding the azimuth and inclination angles of spherical coordinates.
Definition: angles.h:118
A base class which provides memory management and object aggregation.
Definition: object.h:89
Class implementing the phased array model virtual base class.
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.
virtual std::pair< double, double > GetElementFieldPattern(Angles a) const =0
Returns the horizontal and vertical components of the antenna element field pattern at the specified ...
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.
~PhasedArrayModel() override
Destructor.
uint32_t m_id
the ID of this antenna array instance
virtual uint64_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
std::vector< std::complex< double > > ComplexVector
type definition for complex vectors
static TypeId GetTypeId()
Get the type ID.
a unique identifier for an interface.
Definition: type-id.h:60
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:129