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 
54  static TypeId GetTypeId (void);
55 
56 
57  typedef std::vector<std::complex<double> > ComplexVector;
58 
67  virtual std::pair<double, double> GetElementFieldPattern (Angles a) const = 0;
68 
69 
76  virtual Vector GetElementLocation (uint64_t index) const = 0;
77 
78 
83  virtual uint64_t GetNumberOfElements (void) const = 0;
84 
85 
90  void SetBeamformingVector (const ComplexVector &beamformingVector);
91 
92 
98 
99 
106 
107 
114 
115 
120  void SetAntennaElement (Ptr<AntennaModel> antennaElement);
121 
122 
128 
133  uint32_t GetId () const;
134 
135 protected:
141  static double ComputeNorm (const ComplexVector &vector);
142 
146  static uint32_t m_idCounter;
147  uint32_t m_id {0};
148 };
149 
157 std::ostream& operator<< (std::ostream& os, const PhasedArrayModel::ComplexVector& cv);
158 
159 } /* namespace ns3 */
160 
161 #endif /* PHASED_ARRAY_MODEL_H */
Class holding the azimuth and inclination angles of spherical coordinates.
Definition: angles.h:119
A base class which provides memory management and object aggregation.
Definition: object.h:88
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
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.
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 ...
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
a unique identifier for an interface.
Definition: type-id.h:59
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:139