A Discrete-Event Network Simulator
QKDNetSim v2.0 (NS-3 v3.41) @ (+)
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
Enumerator
a
b
c
d
e
f
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
c
e
i
l
o
r
s
t
v
Macros
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
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
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Stefano Avallone <stefano.avallone@unina.it>
18
*/
19
20
#include "
wifi-tx-current-model.h
"
21
22
#include "
wifi-utils.h
"
23
24
#include "ns3/double.h"
25
#include "ns3/log.h"
26
27
namespace
ns3
28
{
29
30
NS_LOG_COMPONENT_DEFINE
(
"WifiTxCurrentModel"
);
31
32
NS_OBJECT_ENSURE_REGISTERED
(WifiTxCurrentModel);
33
34
TypeId
35
WifiTxCurrentModel::GetTypeId
()
36
{
37
static
TypeId
tid =
TypeId
(
"ns3::WifiTxCurrentModel"
).
SetParent
<
Object
>().SetGroupName(
"Wifi"
);
38
return
tid;
39
}
40
41
WifiTxCurrentModel::WifiTxCurrentModel
()
42
{
43
}
44
45
WifiTxCurrentModel::~WifiTxCurrentModel
()
46
{
47
}
48
49
NS_OBJECT_ENSURE_REGISTERED
(
LinearWifiTxCurrentModel
);
50
51
TypeId
52
LinearWifiTxCurrentModel::GetTypeId
()
53
{
54
static
TypeId
tid =
55
TypeId
(
"ns3::LinearWifiTxCurrentModel"
)
56
.
SetParent
<
WifiTxCurrentModel
>()
57
.SetGroupName(
"Wifi"
)
58
.AddConstructor<
LinearWifiTxCurrentModel
>()
59
.AddAttribute(
"Eta"
,
60
"The efficiency of the power amplifier."
,
61
DoubleValue
(0.10),
62
MakeDoubleAccessor
(&
LinearWifiTxCurrentModel::m_eta
),
63
MakeDoubleChecker<double>())
64
.AddAttribute(
"Voltage"
,
65
"The supply voltage (in Volts)."
,
66
DoubleValue
(3.0),
67
MakeDoubleAccessor
(&
LinearWifiTxCurrentModel::m_voltage
),
68
MakeDoubleChecker<double>())
69
.AddAttribute(
"IdleCurrent"
,
70
"The current in the IDLE state (in Ampere)."
,
71
DoubleValue
(0.273333),
72
MakeDoubleAccessor
(&
LinearWifiTxCurrentModel::m_idleCurrent
),
73
MakeDoubleChecker<double>());
74
return
tid;
75
}
76
77
LinearWifiTxCurrentModel::LinearWifiTxCurrentModel
()
78
{
79
NS_LOG_FUNCTION
(
this
);
80
}
81
82
LinearWifiTxCurrentModel::~LinearWifiTxCurrentModel
()
83
{
84
NS_LOG_FUNCTION
(
this
);
85
}
86
87
double
88
LinearWifiTxCurrentModel::CalcTxCurrent
(
double
txPowerDbm)
const
89
{
90
NS_LOG_FUNCTION
(
this
<< txPowerDbm);
91
return
DbmToW
(txPowerDbm) / (
m_voltage
*
m_eta
) +
m_idleCurrent
;
92
}
93
94
}
// namespace ns3
ns3::DoubleValue
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition:
double.h:42
ns3::LinearWifiTxCurrentModel
a linear model of the Wifi transmit current
Definition:
wifi-tx-current-model.h:85
ns3::LinearWifiTxCurrentModel::LinearWifiTxCurrentModel
LinearWifiTxCurrentModel()
Definition:
wifi-tx-current-model.cc:77
ns3::LinearWifiTxCurrentModel::m_eta
double m_eta
ETA.
Definition:
wifi-tx-current-model.h:99
ns3::LinearWifiTxCurrentModel::CalcTxCurrent
double CalcTxCurrent(double txPowerDbm) const override
Definition:
wifi-tx-current-model.cc:88
ns3::LinearWifiTxCurrentModel::~LinearWifiTxCurrentModel
~LinearWifiTxCurrentModel() override
Definition:
wifi-tx-current-model.cc:82
ns3::LinearWifiTxCurrentModel::m_voltage
double m_voltage
voltage in Volts
Definition:
wifi-tx-current-model.h:100
ns3::LinearWifiTxCurrentModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
wifi-tx-current-model.cc:52
ns3::LinearWifiTxCurrentModel::m_idleCurrent
double m_idleCurrent
idle current in Amperes
Definition:
wifi-tx-current-model.h:101
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:931
ns3::WifiTxCurrentModel
Model the transmit current as a function of the transmit power and mode.
Definition:
wifi-tx-current-model.h:35
ns3::WifiTxCurrentModel::~WifiTxCurrentModel
~WifiTxCurrentModel() override
Definition:
wifi-tx-current-model.cc:45
ns3::WifiTxCurrentModel::WifiTxCurrentModel
WifiTxCurrentModel()
Definition:
wifi-tx-current-model.cc:41
ns3::WifiTxCurrentModel::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
wifi-tx-current-model.cc:35
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition:
log.h:202
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:240
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:46
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::DbmToW
double DbmToW(double dBm)
Convert from dBm to Watts.
Definition:
wifi-utils.cc:40
ns3::MakeDoubleAccessor
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Definition:
double.h:43
wifi-tx-current-model.h
wifi-utils.h
src
wifi
model
wifi-tx-current-model.cc
Generated on Sun Mar 3 2024 17:11:12 for ns-3 by
1.9.1