A Discrete-Event Network Simulator
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
9
11
12#include <ns3/log.h>
13#include <ns3/phased-array-model.h>
14
15namespace ns3
16{
17
18NS_LOG_COMPONENT_DEFINE("PhasedArraySpectrumPropagationLossModel");
19
20NS_OBJECT_ENSURE_REGISTERED(PhasedArraySpectrumPropagationLossModel);
21
26
30
31void
36
39{
40 static TypeId tid = TypeId("ns3::PhasedArraySpectrumPropagationLossModel")
42 .SetGroupName("Spectrum");
43 return tid;
44}
45
46void
51
57
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
80int64_t
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
A base class which provides memory management and object aggregation.
Definition object.h:78
void SetNext(Ptr< PhasedArraySpectrumPropagationLossModel > next)
Used to chain various instances of PhasedArraySpectrumPropagationLossModel.
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
virtual int64_t DoAssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
int64_t AssignStreams(int64_t stream)
If this loss model uses objects of type RandomVariableStream, set the stream numbers to the integers ...
Ptr< PhasedArraySpectrumPropagationLossModel > GetNext() const
Return the pointer to the next PhasedArraySpectrumPropagationLossModel, if any.
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.
Ptr< PhasedArraySpectrumPropagationLossModel > m_next
PhasedArraySpectrumPropagationLossModel chained to this one.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.