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 
31 namespace ns3 {
32 
33 class NetDevice;
34 class ChannelConditionModel;
35 class ChannelCondition;
36 
52 {
53 public:
58 
63 
64  void DoDispose () override;
65 
70  static TypeId GetTypeId ();
71 
77 
83 
90 
91 
98  void SetChannelModelAttribute (const std::string &name, const AttributeValue &value);
99 
106  void GetChannelModelAttribute (const std::string &name, AttributeValue &value) const;
107 
130  Ptr<const MobilityModel> b) const override;
131 
132 private:
136  struct LongTerm : public SimpleRefCount<LongTerm>
137  {
142  };
143 
148  double GetFrequency () const;
149 
161  ThreeGppAntennaArrayModel::ComplexVector GetLongTerm (uint32_t aId, uint32_t bId,
175 
188  const Vector &sSpeed, const Vector &uSpeed) const;
189 
190  std::unordered_map <uint32_t, Ptr<const ThreeGppAntennaArrayModel> > m_deviceAntennaMap;
191  mutable std::unordered_map < uint32_t, Ptr<const LongTerm> > m_longTermMap;
193 };
194 } // namespace ns3
195 
196 #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
std::vector< std::complex< double > > ComplexVector
type definition for complex vectors
ThreeGppAntennaArrayModel::ComplexVector CalcLongTerm(Ptr< const MatrixBasedChannelModel::ChannelMatrix > channelMatrix, const ThreeGppAntennaArrayModel::ComplexVector &sW, const ThreeGppAntennaArrayModel::ComplexVector &uW) const
Computes the long term component.
Hold a value for an Attribute.
Definition: attribute.h:68
ThreeGppAntennaArrayModel::ComplexVector GetLongTerm(uint32_t aId, uint32_t bId, Ptr< const MatrixBasedChannelModel::ChannelMatrix > channelMatrix, const ThreeGppAntennaArrayModel::ComplexVector &aW, const ThreeGppAntennaArrayModel::ComplexVector &bW) const
Looks for the long term component in m_longTermMap.
ThreeGppAntennaArrayModel::ComplexVector m_sW
the beamforming vector for the node s used to compute the long term
ThreeGppAntennaArrayModel::ComplexVector m_uW
the beamforming vector for the node u used to compute the long term
channel
Definition: third.py:92
std::unordered_map< uint32_t, Ptr< const ThreeGppAntennaArrayModel > > m_deviceAntennaMap
map containig the <node, antenna> associations
Ptr< MatrixBasedChannelModel > GetChannelModel() const
Get the channel model object.
Ptr< SpectrumValue > CalcBeamformingGain(Ptr< SpectrumValue > txPsd, ThreeGppAntennaArrayModel::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.
void AddDevice(Ptr< NetDevice > n, Ptr< const ThreeGppAntennaArrayModel > a)
Add a device-antenna pair.
double GetFrequency() const
Get the operating frequency.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ThreeGppAntennaArrayModel::ComplexVector m_longTerm
vector containing the long term component for each cluster
Data structure that stores the long term component for a tx-rx pair.
Ptr< const MatrixBasedChannelModel::ChannelMatrix > m_channel
pointer to the channel matrix used to compute the long term
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
A template-based reference counting class.
a unique identifier for an interface.
Definition: type-id.h:58
void SetChannelModelAttribute(const std::string &name, const AttributeValue &value)
Sets the value of an attribute belonging to the associated MatrixBasedChannelModel instance...