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
phased-array-spectrum-propagation-loss-model.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2021 CTTC
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
*/
7
8
#include "
phased-array-spectrum-propagation-loss-model.h
"
9
10
#include "
spectrum-signal-parameters.h
"
11
12
#include <ns3/log.h>
13
#include <ns3/phased-array-model.h>
14
15
namespace
ns3
16
{
17
18
NS_LOG_COMPONENT_DEFINE
(
"PhasedArraySpectrumPropagationLossModel"
);
19
20
NS_OBJECT_ENSURE_REGISTERED
(PhasedArraySpectrumPropagationLossModel);
21
22
PhasedArraySpectrumPropagationLossModel::PhasedArraySpectrumPropagationLossModel
()
23
: m_next(nullptr)
24
{
25
}
26
27
PhasedArraySpectrumPropagationLossModel::~PhasedArraySpectrumPropagationLossModel
()
28
{
29
}
30
31
void
32
PhasedArraySpectrumPropagationLossModel::DoDispose
()
33
{
34
m_next
=
nullptr
;
35
}
36
37
TypeId
38
PhasedArraySpectrumPropagationLossModel::GetTypeId
()
39
{
40
static
TypeId
tid =
TypeId
(
"ns3::PhasedArraySpectrumPropagationLossModel"
)
41
.
SetParent
<
Object
>()
42
.SetGroupName(
"Spectrum"
);
43
return
tid;
44
}
45
46
void
47
PhasedArraySpectrumPropagationLossModel::SetNext
(
Ptr<PhasedArraySpectrumPropagationLossModel>
next)
48
{
49
m_next
= next;
50
}
51
52
Ptr<PhasedArraySpectrumPropagationLossModel>
53
PhasedArraySpectrumPropagationLossModel::GetNext
()
const
54
{
55
return
m_next
;
56
}
57
58
Ptr<SpectrumSignalParameters>
59
PhasedArraySpectrumPropagationLossModel::CalcRxPowerSpectralDensity
(
60
Ptr<const SpectrumSignalParameters>
params,
61
Ptr<const MobilityModel>
a,
62
Ptr<const MobilityModel>
b,
63
Ptr<const PhasedArrayModel>
aPhasedArrayModel,
64
Ptr<const PhasedArrayModel>
bPhasedArrayModel)
const
65
{
66
// Here we assume that all the models in the chain of models are of type
67
// PhasedArraySpectrumPropagationLossModel that provides the implementation of
68
// this function, i.e. has phased array model of TX and RX as parameters
69
auto
rxParams =
70
DoCalcRxPowerSpectralDensity
(params, a, b, aPhasedArrayModel, bPhasedArrayModel);
71
72
if
(
m_next
)
73
{
74
rxParams =
75
m_next
->CalcRxPowerSpectralDensity(params, a, b, aPhasedArrayModel, bPhasedArrayModel);
76
}
77
return
rxParams;
78
}
79
80
int64_t
81
PhasedArraySpectrumPropagationLossModel::AssignStreams
(int64_t stream)
82
{
83
NS_LOG_FUNCTION
(
this
<< stream);
84
auto
currentStream = stream;
85
currentStream +=
DoAssignStreams
(stream);
86
if
(
m_next
)
87
{
88
currentStream +=
m_next
->AssignStreams(currentStream);
89
}
90
return
(currentStream - stream);
91
}
92
93
}
// namespace ns3
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::PhasedArraySpectrumPropagationLossModel::SetNext
void SetNext(Ptr< PhasedArraySpectrumPropagationLossModel > next)
Used to chain various instances of PhasedArraySpectrumPropagationLossModel.
Definition
phased-array-spectrum-propagation-loss-model.cc:47
ns3::PhasedArraySpectrumPropagationLossModel::DoDispose
void DoDispose() override
Destructor implementation.
Definition
phased-array-spectrum-propagation-loss-model.cc:32
ns3::PhasedArraySpectrumPropagationLossModel::DoCalcRxPowerSpectralDensity
virtual Ptr< SpectrumSignalParameters > DoCalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > params, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b, Ptr< const PhasedArrayModel > aPhasedArrayModel, Ptr< const PhasedArrayModel > bPhasedArrayModel) const =0
ns3::PhasedArraySpectrumPropagationLossModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
phased-array-spectrum-propagation-loss-model.cc:38
ns3::PhasedArraySpectrumPropagationLossModel::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::PhasedArraySpectrumPropagationLossModel::AssignStreams
int64_t AssignStreams(int64_t stream)
If this loss model uses objects of type RandomVariableStream, set the stream numbers to the integers ...
Definition
phased-array-spectrum-propagation-loss-model.cc:81
ns3::PhasedArraySpectrumPropagationLossModel::GetNext
Ptr< PhasedArraySpectrumPropagationLossModel > GetNext() const
Return the pointer to the next PhasedArraySpectrumPropagationLossModel, if any.
Definition
phased-array-spectrum-propagation-loss-model.cc:53
ns3::PhasedArraySpectrumPropagationLossModel::PhasedArraySpectrumPropagationLossModel
PhasedArraySpectrumPropagationLossModel()
Definition
phased-array-spectrum-propagation-loss-model.cc:22
ns3::PhasedArraySpectrumPropagationLossModel::CalcRxPowerSpectralDensity
Ptr< SpectrumSignalParameters > CalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > txPsd, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b, Ptr< const PhasedArrayModel > aPhasedArrayModel, Ptr< const PhasedArrayModel > bPhasedArrayModel) const
This method is to be called to calculate.
Definition
phased-array-spectrum-propagation-loss-model.cc:59
ns3::PhasedArraySpectrumPropagationLossModel::~PhasedArraySpectrumPropagationLossModel
~PhasedArraySpectrumPropagationLossModel() override
Definition
phased-array-spectrum-propagation-loss-model.cc:27
ns3::PhasedArraySpectrumPropagationLossModel::m_next
Ptr< PhasedArraySpectrumPropagationLossModel > m_next
PhasedArraySpectrumPropagationLossModel chained to this one.
Definition
phased-array-spectrum-propagation-loss-model.h:128
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
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_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition
log-macros-enabled.h:229
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.
phased-array-spectrum-propagation-loss-model.h
spectrum-signal-parameters.h
src
spectrum
model
phased-array-spectrum-propagation-loss-model.cc
Generated on Fri Nov 8 2024 13:59:06 for ns-3 by
1.11.0