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
wifi-tx-current-model.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2014 Universita' degli Studi di Napoli "Federico II"
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Stefano Avallone <stefano.avallone@unina.it>
7
*/
8
9
#include "
wifi-tx-current-model.h
"
10
11
#include "
wifi-utils.h
"
12
13
#include "ns3/double.h"
14
#include "ns3/log.h"
15
16
namespace
ns3
17
{
18
19
NS_LOG_COMPONENT_DEFINE
(
"WifiTxCurrentModel"
);
20
21
NS_OBJECT_ENSURE_REGISTERED
(WifiTxCurrentModel);
22
23
TypeId
24
WifiTxCurrentModel::GetTypeId
()
25
{
26
static
TypeId
tid =
TypeId
(
"ns3::WifiTxCurrentModel"
).
SetParent
<
Object
>().SetGroupName(
"Wifi"
);
27
return
tid;
28
}
29
30
WifiTxCurrentModel::WifiTxCurrentModel
()
31
{
32
}
33
34
WifiTxCurrentModel::~WifiTxCurrentModel
()
35
{
36
}
37
38
NS_OBJECT_ENSURE_REGISTERED
(
LinearWifiTxCurrentModel
);
39
40
TypeId
41
LinearWifiTxCurrentModel::GetTypeId
()
42
{
43
static
TypeId
tid =
44
TypeId
(
"ns3::LinearWifiTxCurrentModel"
)
45
.
SetParent
<
WifiTxCurrentModel
>()
46
.SetGroupName(
"Wifi"
)
47
.AddConstructor<
LinearWifiTxCurrentModel
>()
48
.AddAttribute(
"Eta"
,
49
"The efficiency of the power amplifier."
,
50
DoubleValue
(0.10),
51
MakeDoubleAccessor
(&
LinearWifiTxCurrentModel::m_eta
),
52
MakeDoubleChecker<double>
())
53
.AddAttribute(
"Voltage"
,
54
"The supply voltage (in Volts)."
,
55
DoubleValue
(3.0),
56
MakeDoubleAccessor
(&
LinearWifiTxCurrentModel::m_voltage
),
57
MakeDoubleChecker<volt_u>
())
58
.AddAttribute(
"IdleCurrent"
,
59
"The current in the IDLE state (in Ampere)."
,
60
DoubleValue
(0.273333),
61
MakeDoubleAccessor
(&
LinearWifiTxCurrentModel::m_idleCurrent
),
62
MakeDoubleChecker<ampere_u>
());
63
return
tid;
64
}
65
66
LinearWifiTxCurrentModel::LinearWifiTxCurrentModel
()
67
{
68
NS_LOG_FUNCTION
(
this
);
69
}
70
71
LinearWifiTxCurrentModel::~LinearWifiTxCurrentModel
()
72
{
73
NS_LOG_FUNCTION
(
this
);
74
}
75
76
ampere_u
77
LinearWifiTxCurrentModel::CalcTxCurrent
(
dBm_u
txPower)
const
78
{
79
NS_LOG_FUNCTION
(
this
<< txPower);
80
return
DbmToW
(txPower) / (
m_voltage
*
m_eta
) +
m_idleCurrent
;
81
}
82
83
}
// namespace ns3
double
ns3::DoubleValue
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition
double.h:31
ns3::LinearWifiTxCurrentModel
a linear model of the Wifi transmit current
Definition
wifi-tx-current-model.h:76
ns3::LinearWifiTxCurrentModel::LinearWifiTxCurrentModel
LinearWifiTxCurrentModel()
Definition
wifi-tx-current-model.cc:66
ns3::LinearWifiTxCurrentModel::m_eta
double m_eta
ETA.
Definition
wifi-tx-current-model.h:90
ns3::LinearWifiTxCurrentModel::m_idleCurrent
ampere_u m_idleCurrent
idle current
Definition
wifi-tx-current-model.h:92
ns3::LinearWifiTxCurrentModel::m_voltage
volt_u m_voltage
voltage
Definition
wifi-tx-current-model.h:91
ns3::LinearWifiTxCurrentModel::~LinearWifiTxCurrentModel
~LinearWifiTxCurrentModel() override
Definition
wifi-tx-current-model.cc:71
ns3::LinearWifiTxCurrentModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
wifi-tx-current-model.cc:41
ns3::LinearWifiTxCurrentModel::CalcTxCurrent
ampere_u CalcTxCurrent(dBm_u txPower) const override
Definition
wifi-tx-current-model.cc:77
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
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
ns3::WifiTxCurrentModel
Model the transmit current as a function of the transmit power and mode.
Definition
wifi-tx-current-model.h:26
ns3::WifiTxCurrentModel::~WifiTxCurrentModel
~WifiTxCurrentModel() override
Definition
wifi-tx-current-model.cc:34
ns3::WifiTxCurrentModel::WifiTxCurrentModel
WifiTxCurrentModel()
Definition
wifi-tx-current-model.cc:30
ns3::WifiTxCurrentModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
wifi-tx-current-model.cc:24
ns3::MakeDoubleChecker
Ptr< const AttributeChecker > MakeDoubleChecker()
Definition
double.h:82
ns3::MakeDoubleAccessor
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition
double.h:32
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.
ns3::ampere_u
double ampere_u
ampere weak type
Definition
wifi-units.h:33
ns3::DbmToW
Watt_u DbmToW(dBm_u val)
Convert from dBm to Watts.
Definition
wifi-utils.cc:31
wifi-tx-current-model.h
wifi-utils.h
src
wifi
model
wifi-tx-current-model.cc
Generated on Fri Nov 1 2024 09:20:50 for ns-3 by
1.11.0