A Discrete-Event Network Simulator
API
trace-fading-loss-model.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Giuseppe Piro <g.piro@poliba.it>
18  * Marco Miozzo <mmiozzo@cttc.es>
19  */
20 
21 #ifndef TRACE_FADING_LOSS_MODEL_H
22 #define TRACE_FADING_LOSS_MODEL_H
23 
25 
26 #include "ns3/random-variable-stream.h"
27 #include <ns3/nstime.h>
28 #include <ns3/object.h>
29 
30 #include <map>
31 
32 namespace ns3
33 {
34 
35 class MobilityModel;
36 
43 {
44  public:
46  ~TraceFadingLossModel() override;
47 
52  static TypeId GetTypeId();
53 
54  void DoInitialize() override;
55 
59  typedef std::pair<Ptr<const MobilityModel>, Ptr<const MobilityModel>> ChannelRealizationId_t;
60 
61  protected:
62  int64_t DoAssignStreams(int64_t stream) override;
63 
64  private:
74  Ptr<const MobilityModel> b) const override;
75 
82  double GetValue(int subChannel, double speed);
83 
88  void SetTraceFileName(std::string fileName);
93  void SetTraceLength(Time t);
94 
96  void LoadTrace();
97 
98  mutable std::map<ChannelRealizationId_t, int> m_windowOffsetsMap;
99 
100  mutable std::map<ChannelRealizationId_t, Ptr<UniformRandomVariable>>
102 
106  typedef std::vector<double> FadingTraceSample;
110  typedef std::vector<FadingTraceSample> FadingTrace;
111 
112  std::string m_traceFile;
113 
115 
117  uint32_t m_samplesNum;
119  uint32_t m_rbNum;
121  uint32_t m_timeGranularity;
122  mutable uint64_t m_currentStream;
123  mutable uint64_t m_lastStream;
124  uint64_t m_streamSetSize;
125  mutable bool m_streamsAssigned;
126 };
127 
128 } // namespace ns3
129 
130 #endif /* TRACE_FADING_LOSS_MODEL_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
spectrum-aware propagation loss model
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
fading loss model based on precalculated fading traces
uint64_t m_streamSetSize
stream set size
Ptr< SpectrumValue > DoCalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > params, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
std::string m_traceFile
the trace file name
Time m_lastWindowUpdate
time of last window update
void SetTraceLength(Time t)
Set the trace time.
double GetValue(int subChannel, double speed)
Get the value for a particular sub channel and a given speed.
uint32_t m_samplesNum
number of samples
std::pair< Ptr< const MobilityModel >, Ptr< const MobilityModel > > ChannelRealizationId_t
The couple of mobility node that form a fading channel realization.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
std::vector< double > FadingTraceSample
Vector with fading samples in time domain (for a fixed RB)
uint32_t m_timeGranularity
time granularity
std::vector< FadingTraceSample > FadingTrace
Vector collecting the time fading traces in the frequency domain (per RB)
void SetTraceFileName(std::string fileName)
Set the trace file name.
bool m_streamsAssigned
is streams assigned?
static TypeId GetTypeId()
Get the type ID.
std::map< ChannelRealizationId_t, int > m_windowOffsetsMap
windows offsets map
std::map< ChannelRealizationId_t, Ptr< UniformRandomVariable > > m_startVariableMap
start variable map
uint64_t m_currentStream
the current stream
void LoadTrace()
Load trace function.
FadingTrace m_fadingTrace
fading trace
uint64_t m_lastStream
the last stream
void DoInitialize() override
Initialize() implementation.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.