A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
jakes-propagation-loss-model.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012 Telum (www.telum.ru)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Kirill Andreev <andreev@telum.ru>
7 */
8
10
11#include "ns3/double.h"
12#include "ns3/log.h"
13
14namespace ns3
15{
16
18
19NS_OBJECT_ENSURE_REGISTERED(JakesPropagationLossModel);
20
27
31
34{
35 static TypeId tid = TypeId("ns3::JakesPropagationLossModel")
37 .SetGroupName("Propagation")
38 .AddConstructor<JakesPropagationLossModel>();
39 return tid;
40}
41
42void
48
49double
52 Ptr<MobilityModel> b) const
53{
54 Ptr<JakesProcess> pathData = m_propagationCache.GetPathData(
55 a,
56 b,
57 0 /**Spectrum model uid is not used in PropagationLossModel*/);
58 if (!pathData)
59 {
60 pathData = CreateObject<JakesProcess>();
61 pathData->SetPropagationLossModel(this);
62 m_propagationCache.AddPathData(
63 pathData,
64 a,
65 b,
66 0 /**Spectrum model uid is not used in PropagationLossModel*/);
67 }
68 return txPowerDbm + pathData->GetChannelGainDb();
69}
70
76
77int64_t
79{
80 m_uniformVariable->SetStream(stream);
81 return 1;
82}
83
84} // namespace ns3
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
a Jakes narrowband propagation model.
Ptr< UniformRandomVariable > GetUniformRandomVariable() const
Get the underlying RNG stream.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
static TypeId GetTypeId()
Get the type ID.
PropagationCache< JakesProcess > m_propagationCache
Propagation cache.
Ptr< UniformRandomVariable > m_uniformVariable
random stream
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
void DoDispose() override
Destructor implementation.
Models the propagation loss through a transmission medium.
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
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
#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.