A Discrete-Event Network Simulator
API
phased-array-model.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3 * Copyright (c) 2020 University of Padova, Dep. of Information Engineering, SIGNET lab.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18 
19 #ifndef PHASED_ARRAY_MODEL_H
20 #define PHASED_ARRAY_MODEL_H
21 
22 #include <ns3/object.h>
23 #include <ns3/angles.h>
24 #include <complex>
25 #include <ns3/antenna-model.h>
26 
27 namespace ns3 {
28 
29 
35 class PhasedArrayModel : public Object
36 {
37 public:
41  PhasedArrayModel (void);
42 
43 
47  virtual ~PhasedArrayModel (void);
48 
49 
50  // inherited from Object
51  static TypeId GetTypeId (void);
52 
53 
54  typedef std::vector<std::complex<double> > ComplexVector;
55 
64  virtual std::pair<double, double> GetElementFieldPattern (Angles a) const = 0;
65 
66 
73  virtual Vector GetElementLocation (uint64_t index) const = 0;
74 
75 
80  virtual uint64_t GetNumberOfElements (void) const = 0;
81 
82 
87  void SetBeamformingVector (const ComplexVector &beamformingVector);
88 
89 
95 
96 
103 
104 
111 
112 
117  void SetAntennaElement (Ptr<AntennaModel> antennaElement);
118 
119 
125 
126 protected:
132  static double ComputeNorm (const ComplexVector &vector);
133 
137 
138 };
139 
140 
141 std::ostream& operator<< (std::ostream& os, const PhasedArrayModel::ComplexVector& cv);
142 
143 } /* namespace ns3 */
144 
145 #endif /* PHASED_ARRAY_MODEL_H */
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::PhasedArrayModel::GetElementFieldPattern
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 ...
ns3::PhasedArrayModel::GetSteeringVector
ComplexVector GetSteeringVector(Angles a) const
Returns the steering vector that points toward the specified position.
Definition: phased-array-model.cc:136
ns3::PhasedArrayModel::m_antennaElement
Ptr< AntennaModel > m_antennaElement
the model of the antenna element in use
Definition: phased-array-model.h:135
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::PhasedArrayModel::~PhasedArrayModel
virtual ~PhasedArrayModel(void)
Destructor.
Definition: phased-array-model.cc:60
ns3::PhasedArrayModel::SetBeamformingVector
void SetBeamformingVector(const ComplexVector &beamformingVector)
Sets the beamforming vector to be used.
Definition: phased-array-model.cc:83
ns3::PhasedArrayModel::PhasedArrayModel
PhasedArrayModel(void)
Constructor.
Definition: phased-array-model.cc:55
ns3::PhasedArrayModel::SetAntennaElement
void SetAntennaElement(Ptr< AntennaModel > antennaElement)
Sets the antenna model to be used.
Definition: phased-array-model.cc:153
ns3::PhasedArrayModel::GetBeamformingVector
ComplexVector GetBeamformingVector(void) const
Returns the beamforming vector that is currently being used.
Definition: phased-array-model.cc:94
ns3::PhasedArrayModel::ComputeNorm
static double ComputeNorm(const ComplexVector &vector)
Utility method to compute the euclidean norm of a ComplexVector.
Definition: phased-array-model.cc:103
ns3::Ptr< AntennaModel >
ns3::Object
A base class which provides memory management and object aggregation.
Definition: object.h:88
ns3::PhasedArrayModel::m_isBfVectorValid
bool m_isBfVectorValid
ensures the validity of the beamforming vector
Definition: phased-array-model.h:136
ns3::Angles
Class holding the azimuth and inclination angles of spherical coordinates.
Definition: angles.h:119
ns3::PhasedArrayModel::GetAntennaElement
Ptr< const AntennaModel > GetAntennaElement(void) const
Returns a pointer to the AntennaModel instance used to model the elements of the array.
Definition: phased-array-model.cc:161
ns3::PhasedArrayModel::GetElementLocation
virtual Vector GetElementLocation(uint64_t index) const =0
Returns the location of the antenna element with the specified index, normalized with respect to the ...
ns3::PhasedArrayModel::GetTypeId
static TypeId GetTypeId(void)
Definition: phased-array-model.cc:67
ns3::PhasedArrayModel::GetNumberOfElements
virtual uint64_t GetNumberOfElements(void) const =0
Returns the number of antenna elements.
ns3::PhasedArrayModel::ComplexVector
std::vector< std::complex< double > > ComplexVector
type definition for complex vectors
Definition: phased-array-model.h:54
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137
ns3::PhasedArrayModel::m_beamformingVector
ComplexVector m_beamformingVector
the beamforming vector in use
Definition: phased-array-model.h:134
ns3::PhasedArrayModel
Class implementing the phased array model virtual base class.
Definition: phased-array-model.h:36