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
kun-2600-mhz-propagation-loss-model.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Marco Miozzo <marco.miozzo@cttc.es>,
7
* Nicola Baldo <nbaldo@cttc.es>
8
*
9
*/
10
#include "
kun-2600-mhz-propagation-loss-model.h
"
11
12
#include "ns3/double.h"
13
#include "ns3/enum.h"
14
#include "ns3/log.h"
15
#include "ns3/mobility-model.h"
16
17
#include <cmath>
18
19
namespace
ns3
20
{
21
22
NS_LOG_COMPONENT_DEFINE
(
"Kun2600MhzPropagationLossModel"
);
23
24
NS_OBJECT_ENSURE_REGISTERED
(Kun2600MhzPropagationLossModel);
25
26
TypeId
27
Kun2600MhzPropagationLossModel::GetTypeId
()
28
{
29
static
TypeId
tid =
TypeId
(
"ns3::Kun2600MhzPropagationLossModel"
)
30
.
SetParent
<
PropagationLossModel
>()
31
.SetGroupName(
"Propagation"
)
32
.AddConstructor<
Kun2600MhzPropagationLossModel
>();
33
34
return
tid;
35
}
36
37
Kun2600MhzPropagationLossModel::Kun2600MhzPropagationLossModel
()
38
:
PropagationLossModel
()
39
{
40
}
41
42
Kun2600MhzPropagationLossModel::~Kun2600MhzPropagationLossModel
()
43
{
44
}
45
46
double
47
Kun2600MhzPropagationLossModel::GetLoss
(
Ptr<MobilityModel>
a,
Ptr<MobilityModel>
b)
const
48
{
49
double
dist = a->GetDistanceFrom(b);
50
double
loss = 36 + 26 * std::log10(dist);
51
return
loss;
52
}
53
54
double
55
Kun2600MhzPropagationLossModel::DoCalcRxPower
(
double
txPowerDbm,
56
Ptr<MobilityModel>
a,
57
Ptr<MobilityModel>
b)
const
58
{
59
return
(txPowerDbm -
GetLoss
(a, b));
60
}
61
62
int64_t
63
Kun2600MhzPropagationLossModel::DoAssignStreams
(int64_t stream)
64
{
65
return
0;
66
}
67
68
}
// namespace ns3
ns3::Kun2600MhzPropagationLossModel
Empirical propagation model for the 2.6 GHz frequency.
Definition
kun-2600-mhz-propagation-loss-model.h:30
ns3::Kun2600MhzPropagationLossModel::GetLoss
double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Definition
kun-2600-mhz-propagation-loss-model.cc:47
ns3::Kun2600MhzPropagationLossModel::DoAssignStreams
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
Definition
kun-2600-mhz-propagation-loss-model.cc:63
ns3::Kun2600MhzPropagationLossModel::~Kun2600MhzPropagationLossModel
~Kun2600MhzPropagationLossModel() override
Definition
kun-2600-mhz-propagation-loss-model.cc:42
ns3::Kun2600MhzPropagationLossModel::Kun2600MhzPropagationLossModel
Kun2600MhzPropagationLossModel()
Definition
kun-2600-mhz-propagation-loss-model.cc:37
ns3::Kun2600MhzPropagationLossModel::DoCalcRxPower
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
Definition
kun-2600-mhz-propagation-loss-model.cc:55
ns3::Kun2600MhzPropagationLossModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
kun-2600-mhz-propagation-loss-model.cc:27
ns3::PropagationLossModel
Models the propagation loss through a transmission medium.
Definition
propagation-loss-model.h:45
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_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition
object-base.h:35
kun-2600-mhz-propagation-loss-model.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
propagation
model
kun-2600-mhz-propagation-loss-model.cc
Generated on Fri Nov 8 2024 13:59:05 for ns-3 by
1.11.0