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 */
void SetAntennaElement(Ptr< AntennaModel > antennaElement)
Sets the antenna model to be used.
static TypeId GetTypeId(void)
bool m_isBfVectorValid
ensures the validity of the beamforming vector
ComplexVector m_beamformingVector
the beamforming vector in use
virtual uint64_t GetNumberOfElements(void) const =0
Returns the number of antenna elements.
Class holding the azimuth and inclination angles of spherical coordinates.
Definition: angles.h:118
Ptr< AntennaModel > m_antennaElement
the model of the antenna element in use
ComplexVector GetBeamformingVector(void) const
Returns the beamforming vector that is currently being used.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137
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 ~PhasedArrayModel(void)
Destructor.
void SetBeamformingVector(const ComplexVector &beamformingVector)
Sets the beamforming vector to be used.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Class implementing the phased array model virtual base class.
PhasedArrayModel(void)
Constructor.
std::vector< std::complex< double > > ComplexVector
type definition for complex vectors
Ptr< const AntennaModel > GetAntennaElement(void) const
Returns a pointer to the AntennaModel instance used to model the elements of the array.
A base class which provides memory management and object aggregation.
Definition: object.h:87
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 ...
a unique identifier for an interface.
Definition: type-id.h:58
static double ComputeNorm(const ComplexVector &vector)
Utility method to compute the euclidean norm of a ComplexVector.