A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Giuseppe Piro <g.piro@poliba.it>
7
* Marco Miozzo <mmiozzo@cttc.es>
8
*/
9
10
#ifndef TRACE_FADING_LOSS_MODEL_H
11
#define TRACE_FADING_LOSS_MODEL_H
12
13
#include "
spectrum-propagation-loss-model.h
"
14
15
#include "ns3/random-variable-stream.h"
16
#include <ns3/nstime.h>
17
#include <ns3/object.h>
18
19
#include <map>
20
21
namespace
ns3
22
{
23
24
class
MobilityModel;
25
26
/**
27
* \ingroup spectrum
28
*
29
* \brief fading loss model based on precalculated fading traces
30
*/
31
class
TraceFadingLossModel
:
public
SpectrumPropagationLossModel
32
{
33
public
:
34
TraceFadingLossModel
();
35
~TraceFadingLossModel
()
override
;
36
37
/**
38
* \brief Get the type ID.
39
* \return the object TypeId
40
*/
41
static
TypeId
GetTypeId
();
42
43
void
DoInitialize
()
override
;
44
45
/**
46
* \brief The couple of mobility node that form a fading channel realization
47
*/
48
typedef
std::pair<Ptr<const MobilityModel>,
Ptr<const MobilityModel>
>
ChannelRealizationId_t
;
49
50
protected
:
51
int64_t
DoAssignStreams
(int64_t stream)
override
;
52
53
private
:
54
/**
55
* @param params the spectrum signal parameters.
56
* \param a sender mobility
57
* \param b receiver mobility
58
* \return set of values vs frequency representing the received
59
* power in the same units used for the txPsd parameter.
60
*/
61
Ptr<SpectrumValue>
DoCalcRxPowerSpectralDensity
(
Ptr<const SpectrumSignalParameters>
params,
62
Ptr<const MobilityModel>
a,
63
Ptr<const MobilityModel>
b)
const override
;
64
65
/**
66
* \brief Get the value for a particular sub channel and a given speed
67
* \param subChannel the sub channel for which a value is requested
68
* \param speed the relative speed of the two devices
69
* \return the loss for a particular sub channel
70
*/
71
double
GetValue
(
int
subChannel,
double
speed);
72
73
/**
74
* \brief Set the trace file name
75
* \param fileName the trace file
76
*/
77
void
SetTraceFileName
(std::string fileName);
78
/**
79
* \brief Set the trace time
80
* \param t the trace time
81
*/
82
void
SetTraceLength
(
Time
t);
83
84
/// Load trace function
85
void
LoadTrace
();
86
87
mutable
std::map<ChannelRealizationId_t, int>
m_windowOffsetsMap
;
///< windows offsets map
88
89
mutable
std::map<ChannelRealizationId_t, Ptr<UniformRandomVariable>>
90
m_startVariableMap
;
///< start variable map
91
92
/**
93
* Vector with fading samples in time domain (for a fixed RB)
94
*/
95
typedef
std::vector<double>
FadingTraceSample
;
96
/**
97
* Vector collecting the time fading traces in the frequency domain (per RB)
98
*/
99
typedef
std::vector<FadingTraceSample>
FadingTrace
;
100
101
std::string
m_traceFile
;
///< the trace file name
102
103
FadingTrace
m_fadingTrace
;
///< fading trace
104
105
Time
m_traceLength
;
///< the trace time
106
uint32_t
m_samplesNum
;
///< number of samples
107
Time
m_windowSize
;
///< window size
108
uint32_t
m_rbNum
;
///< RB number
109
mutable
Time
m_lastWindowUpdate
;
///< time of last window update
110
uint32_t
m_timeGranularity
;
///< time granularity
111
mutable
uint64_t
m_currentStream
;
///< the current stream
112
mutable
uint64_t
m_lastStream
;
///< the last stream
113
uint64_t
m_streamSetSize
;
///< stream set size
114
mutable
bool
m_streamsAssigned
;
///< is streams assigned?
115
};
116
117
}
// namespace ns3
118
119
#endif
/* TRACE_FADING_LOSS_MODEL_H */
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::SpectrumPropagationLossModel
spectrum-aware propagation loss model
Definition
spectrum-propagation-loss-model.h:33
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
ns3::TraceFadingLossModel
fading loss model based on precalculated fading traces
Definition
trace-fading-loss-model.h:32
ns3::TraceFadingLossModel::m_rbNum
uint32_t m_rbNum
RB number.
Definition
trace-fading-loss-model.h:108
ns3::TraceFadingLossModel::m_streamSetSize
uint64_t m_streamSetSize
stream set size
Definition
trace-fading-loss-model.h:113
ns3::TraceFadingLossModel::DoCalcRxPowerSpectralDensity
Ptr< SpectrumValue > DoCalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > params, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Definition
trace-fading-loss-model.cc:139
ns3::TraceFadingLossModel::m_traceLength
Time m_traceLength
the trace time
Definition
trace-fading-loss-model.h:105
ns3::TraceFadingLossModel::m_traceFile
std::string m_traceFile
the trace file name
Definition
trace-fading-loss-model.h:101
ns3::TraceFadingLossModel::m_lastWindowUpdate
Time m_lastWindowUpdate
time of last window update
Definition
trace-fading-loss-model.h:109
ns3::TraceFadingLossModel::SetTraceLength
void SetTraceLength(Time t)
Set the trace time.
Definition
trace-fading-loss-model.cc:97
ns3::TraceFadingLossModel::GetValue
double GetValue(int subChannel, double speed)
Get the value for a particular sub channel and a given speed.
ns3::TraceFadingLossModel::m_samplesNum
uint32_t m_samplesNum
number of samples
Definition
trace-fading-loss-model.h:106
ns3::TraceFadingLossModel::ChannelRealizationId_t
std::pair< Ptr< const MobilityModel >, Ptr< const MobilityModel > > ChannelRealizationId_t
The couple of mobility node that form a fading channel realization.
Definition
trace-fading-loss-model.h:48
ns3::TraceFadingLossModel::~TraceFadingLossModel
~TraceFadingLossModel() override
Definition
trace-fading-loss-model.cc:38
ns3::TraceFadingLossModel::DoAssignStreams
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
Definition
trace-fading-loss-model.cc:230
ns3::TraceFadingLossModel::FadingTraceSample
std::vector< double > FadingTraceSample
Vector with fading samples in time domain (for a fixed RB)
Definition
trace-fading-loss-model.h:95
ns3::TraceFadingLossModel::m_timeGranularity
uint32_t m_timeGranularity
time granularity
Definition
trace-fading-loss-model.h:110
ns3::TraceFadingLossModel::FadingTrace
std::vector< FadingTraceSample > FadingTrace
Vector collecting the time fading traces in the frequency domain (per RB)
Definition
trace-fading-loss-model.h:99
ns3::TraceFadingLossModel::TraceFadingLossModel
TraceFadingLossModel()
Definition
trace-fading-loss-model.cc:31
ns3::TraceFadingLossModel::SetTraceFileName
void SetTraceFileName(std::string fileName)
Set the trace file name.
Definition
trace-fading-loss-model.cc:89
ns3::TraceFadingLossModel::m_streamsAssigned
bool m_streamsAssigned
is streams assigned?
Definition
trace-fading-loss-model.h:114
ns3::TraceFadingLossModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
trace-fading-loss-model.cc:46
ns3::TraceFadingLossModel::m_windowOffsetsMap
std::map< ChannelRealizationId_t, int > m_windowOffsetsMap
windows offsets map
Definition
trace-fading-loss-model.h:87
ns3::TraceFadingLossModel::m_startVariableMap
std::map< ChannelRealizationId_t, Ptr< UniformRandomVariable > > m_startVariableMap
start variable map
Definition
trace-fading-loss-model.h:90
ns3::TraceFadingLossModel::m_currentStream
uint64_t m_currentStream
the current stream
Definition
trace-fading-loss-model.h:111
ns3::TraceFadingLossModel::LoadTrace
void LoadTrace()
Load trace function.
Definition
trace-fading-loss-model.cc:109
ns3::TraceFadingLossModel::m_fadingTrace
FadingTrace m_fadingTrace
fading trace
Definition
trace-fading-loss-model.h:103
ns3::TraceFadingLossModel::m_windowSize
Time m_windowSize
window size
Definition
trace-fading-loss-model.h:107
ns3::TraceFadingLossModel::m_lastStream
uint64_t m_lastStream
the last stream
Definition
trace-fading-loss-model.h:112
ns3::TraceFadingLossModel::DoInitialize
void DoInitialize() override
Initialize() implementation.
Definition
trace-fading-loss-model.cc:103
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
spectrum-propagation-loss-model.h
src
spectrum
model
trace-fading-loss-model.h
Generated on Fri Nov 8 2024 13:59:06 for ns-3 by
1.11.0