A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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
24#include "ns3/random-variable-stream.h"
25#include <ns3/nstime.h>
26#include <ns3/object.h>
27#include <ns3/spectrum-propagation-loss-model.h>
28
29#include <map>
30
31namespace ns3
32{
33
34class MobilityModel;
35
42{
43 public:
45 ~TraceFadingLossModel() override;
46
51 static TypeId GetTypeId();
52
53 void DoInitialize() override;
54
58 typedef std::pair<Ptr<const MobilityModel>, Ptr<const MobilityModel>> ChannelRealizationId_t;
59
68 int64_t AssignStreams(int64_t stream);
69
70 private:
80 Ptr<const MobilityModel> b) const override;
81
88 double GetValue(int subChannel, double speed);
89
94 void SetTraceFileName(std::string fileName);
99 void SetTraceLength(Time t);
100
102 void LoadTrace();
103
104 mutable std::map<ChannelRealizationId_t, int> m_windowOffsetsMap;
105
106 mutable std::map<ChannelRealizationId_t, Ptr<UniformRandomVariable>>
108
112 typedef std::vector<double> FadingTraceSample;
116 typedef std::vector<FadingTraceSample> FadingTrace;
117
118 std::string m_traceFile;
119
121
128 mutable uint64_t m_currentStream;
129 mutable uint64_t m_lastStream;
131 mutable bool m_streamsAssigned;
132};
133
134} // namespace ns3
135
136#endif /* TRACE_FADING_LOSS_MODEL_H */
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
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.
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.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.