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
spectrum-propagation-loss-model.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2010 CTTC
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Nicola Baldo <nbaldo@cttc.es>
7
*/
8
9
#include "
spectrum-propagation-loss-model.h
"
10
11
#include "
spectrum-signal-parameters.h
"
12
13
#include <ns3/log.h>
14
15
namespace
ns3
16
{
17
18
NS_LOG_COMPONENT_DEFINE
(
"SpectrumPropagationLossModel"
);
19
20
NS_OBJECT_ENSURE_REGISTERED
(SpectrumPropagationLossModel);
21
22
SpectrumPropagationLossModel::SpectrumPropagationLossModel
()
23
: m_next(nullptr)
24
{
25
}
26
27
SpectrumPropagationLossModel::~SpectrumPropagationLossModel
()
28
{
29
}
30
31
void
32
SpectrumPropagationLossModel::DoDispose
()
33
{
34
m_next
=
nullptr
;
35
}
36
37
TypeId
38
SpectrumPropagationLossModel::GetTypeId
()
39
{
40
static
TypeId
tid =
41
TypeId
(
"ns3::SpectrumPropagationLossModel"
).
SetParent
<
Object
>().SetGroupName(
"Spectrum"
);
42
return
tid;
43
}
44
45
void
46
SpectrumPropagationLossModel::SetNext
(
Ptr<SpectrumPropagationLossModel>
next)
47
{
48
m_next
= next;
49
}
50
51
Ptr<SpectrumPropagationLossModel>
52
SpectrumPropagationLossModel::GetNext
()
const
53
{
54
return
m_next
;
55
}
56
57
Ptr<SpectrumValue>
58
SpectrumPropagationLossModel::CalcRxPowerSpectralDensity
(
Ptr<const SpectrumSignalParameters>
params,
59
Ptr<const MobilityModel>
a,
60
Ptr<const MobilityModel>
b)
const
61
{
62
Ptr<SpectrumValue>
rxPsd =
DoCalcRxPowerSpectralDensity
(params, a, b);
63
if
(
m_next
)
64
{
65
rxPsd =
m_next
->CalcRxPowerSpectralDensity(params, a, b);
66
}
67
return
rxPsd;
68
}
69
70
int64_t
71
SpectrumPropagationLossModel::AssignStreams
(int64_t stream)
72
{
73
auto
currentStream = stream;
74
currentStream +=
DoAssignStreams
(stream);
75
if
(
m_next
)
76
{
77
currentStream +=
m_next
->AssignStreams(currentStream);
78
}
79
return
(currentStream - stream);
80
}
81
82
}
// namespace ns3
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::SpectrumPropagationLossModel::SpectrumPropagationLossModel
SpectrumPropagationLossModel()
Definition
spectrum-propagation-loss-model.cc:22
ns3::SpectrumPropagationLossModel::CalcRxPowerSpectralDensity
Ptr< SpectrumValue > CalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > params, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
This method is to be called to calculate.
Definition
spectrum-propagation-loss-model.cc:58
ns3::SpectrumPropagationLossModel::DoCalcRxPowerSpectralDensity
virtual Ptr< SpectrumValue > DoCalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > params, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const =0
ns3::SpectrumPropagationLossModel::~SpectrumPropagationLossModel
~SpectrumPropagationLossModel() override
Definition
spectrum-propagation-loss-model.cc:27
ns3::SpectrumPropagationLossModel::SetNext
void SetNext(Ptr< SpectrumPropagationLossModel > next)
Used to chain various instances of SpectrumPropagationLossModel.
Definition
spectrum-propagation-loss-model.cc:46
ns3::SpectrumPropagationLossModel::m_next
Ptr< SpectrumPropagationLossModel > m_next
SpectrumPropagationLossModel chained to this one.
Definition
spectrum-propagation-loss-model.h:112
ns3::SpectrumPropagationLossModel::AssignStreams
int64_t AssignStreams(int64_t stream)
If this loss model uses objects of type RandomVariableStream, set the stream numbers to the integers ...
Definition
spectrum-propagation-loss-model.cc:71
ns3::SpectrumPropagationLossModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
spectrum-propagation-loss-model.cc:38
ns3::SpectrumPropagationLossModel::GetNext
Ptr< SpectrumPropagationLossModel > GetNext() const
Return the pointer to the next SpectrumPropagationLossModel, if any.
Definition
spectrum-propagation-loss-model.cc:52
ns3::SpectrumPropagationLossModel::DoAssignStreams
virtual int64_t DoAssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
ns3::SpectrumPropagationLossModel::DoDispose
void DoDispose() override
Destructor implementation.
Definition
spectrum-propagation-loss-model.cc:32
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition
object-base.h:35
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
spectrum-propagation-loss-model.h
spectrum-signal-parameters.h
src
spectrum
model
spectrum-propagation-loss-model.cc
Generated on Fri Nov 8 2024 13:59:06 for ns-3 by
1.11.0