A Discrete-Event Network Simulator
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
10
12
13#include <ns3/log.h>
14
15namespace ns3
16{
17
18NS_LOG_COMPONENT_DEFINE("SpectrumPropagationLossModel");
19
20NS_OBJECT_ENSURE_REGISTERED(SpectrumPropagationLossModel);
21
26
30
31void
36
39{
40 static TypeId tid =
41 TypeId("ns3::SpectrumPropagationLossModel").SetParent<Object>().SetGroupName("Spectrum");
42 return tid;
43}
44
45void
50
56
61{
63 if (m_next)
64 {
65 rxPsd = m_next->CalcRxPowerSpectralDensity(params, a, b);
66 }
67 return rxPsd;
68}
69
70int64_t
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
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
Ptr< SpectrumValue > CalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > params, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
This method is to be called to calculate.
virtual Ptr< SpectrumValue > DoCalcRxPowerSpectralDensity(Ptr< const SpectrumSignalParameters > params, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const =0
void SetNext(Ptr< SpectrumPropagationLossModel > next)
Used to chain various instances of SpectrumPropagationLossModel.
Ptr< SpectrumPropagationLossModel > m_next
SpectrumPropagationLossModel chained to this one.
int64_t AssignStreams(int64_t stream)
If this loss model uses objects of type RandomVariableStream, set the stream numbers to the integers ...
Ptr< SpectrumPropagationLossModel > GetNext() const
Return the pointer to the next SpectrumPropagationLossModel, if any.
virtual int64_t DoAssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
void DoDispose() override
Destructor implementation.
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_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.