A Discrete-Event Network Simulator
API
three-gpp-spectrum-propagation-loss-model.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2015, NYU WIRELESS, Tandon School of Engineering,
4  * New York University
5  * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering,
6  * University of Padova
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation;
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */
21 
22 #ifndef THREE_GPP_SPECTRUM_PROPAGATION_LOSS_H
23 #define THREE_GPP_SPECTRUM_PROPAGATION_LOSS_H
24 
25 #include "ns3/spectrum-propagation-loss-model.h"
26 #include <complex.h>
27 #include <map>
28 #include <unordered_map>
29 #include "ns3/matrix-based-channel-model.h"
30 #include "ns3/random-variable-stream.h"
31 
32 namespace ns3 {
33 
34 class NetDevice;
35 class ChannelConditionModel;
36 class ChannelCondition;
37 
53 {
54 public:
59 
64 
65  void DoDispose () override;
66 
71  static TypeId GetTypeId ();
72 
78 
84 
91 
92 
99  void SetChannelModelAttribute (const std::string &name, const AttributeValue &value);
100 
107  void GetChannelModelAttribute (const std::string &name, AttributeValue &value) const;
108 
131  Ptr<const MobilityModel> b) const override;
132 
133 private:
137  struct LongTerm : public SimpleRefCount<LongTerm>
138  {
143  };
144 
149  double GetFrequency () const;
150 
162  PhasedArrayModel::ComplexVector GetLongTerm (uint32_t aId, uint32_t bId,
165  const PhasedArrayModel::ComplexVector &bW) const;
175  const PhasedArrayModel::ComplexVector &uW) const;
176 
189  const Vector &sSpeed, const Vector &uSpeed) const;
190 
191  std::unordered_map <uint32_t, Ptr<const PhasedArrayModel> > m_deviceAntennaMap;
192  mutable std::unordered_map < uint32_t, Ptr<const LongTerm> > m_longTermMap;
194 
195  // Variable used to compute the additional Doppler contribution for the delayed
196  // (reflected) paths, as described in 3GPP TR 37.885 v15.3.0, Sec. 6.2.3.
197  double m_vScatt;
199 };
200 } // namespace ns3
201 
202 #endif /* THREE_GPP_SPECTRUM_PROPAGATION_LOSS_H */
void SetChannelModel(Ptr< MatrixBasedChannelModel > channel)
Set the channel model object.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
std::unordered_map< uint32_t, Ptr< const LongTerm > > m_longTermMap
map containing the long term components
Hold a value for an Attribute.
Definition: attribute.h:68
PhasedArrayModel::ComplexVector m_longTerm
vector containing the long term component for each cluster
std::unordered_map< uint32_t, Ptr< const PhasedArrayModel > > m_deviceAntennaMap
map containig the <node, antenna> associations
channel
Definition: third.py:92
PhasedArrayModel::ComplexVector GetLongTerm(uint32_t aId, uint32_t bId, Ptr< const MatrixBasedChannelModel::ChannelMatrix > channelMatrix, const PhasedArrayModel::ComplexVector &aW, const PhasedArrayModel::ComplexVector &bW) const
Looks for the long term component in m_longTermMap.
PhasedArrayModel::ComplexVector m_sW
the beamforming vector for the node s used to compute the long term
Ptr< MatrixBasedChannelModel > GetChannelModel() const
Get the channel model object.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< SpectrumValue > CalcBeamformingGain(Ptr< SpectrumValue > txPsd, PhasedArrayModel::ComplexVector longTerm, Ptr< const MatrixBasedChannelModel::ChannelMatrix > params, const Vector &sSpeed, const Vector &uSpeed) const
Computes the beamforming gain and applies it to the tx PSD.
double m_vScatt
value used to compute the additional Doppler contribution for the delayed paths
Data structure that stores the long term component for a tx-rx pair.
PhasedArrayModel::ComplexVector m_uW
the beamforming vector for the node u used to compute the long term
std::vector< std::complex< double > > ComplexVector
type definition for complex vectors
Ptr< const MatrixBasedChannelModel::ChannelMatrix > m_channel
pointer to the channel matrix used to compute the long term
Ptr< UniformRandomVariable > m_uniformRv
uniform random variable, used to compute the additional Doppler contribution
Ptr< MatrixBasedChannelModel > m_channelModel
the model to generate the channel matrix
void GetChannelModelAttribute(const std::string &name, AttributeValue &value) const
Returns the value of an attribute belonging to the associated MatrixBasedChannelModel instance...
Ptr< SpectrumValue > DoCalcRxPowerSpectralDensity(Ptr< const SpectrumValue > txPsd, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Computes the received PSD.
spectrum-aware propagation loss model
PhasedArrayModel::ComplexVector CalcLongTerm(Ptr< const MatrixBasedChannelModel::ChannelMatrix > channelMatrix, const PhasedArrayModel::ComplexVector &sW, const PhasedArrayModel::ComplexVector &uW) const
Computes the long term component.
A template-based reference counting class.
a unique identifier for an interface.
Definition: type-id.h:58
void AddDevice(Ptr< NetDevice > n, Ptr< const PhasedArrayModel > a)
Add a device-antenna pair.
void SetChannelModelAttribute(const std::string &name, const AttributeValue &value)
Sets the value of an attribute belonging to the associated MatrixBasedChannelModel instance...