A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-remote-station-info.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005,2006,2007 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 */
8
10
11#include "ns3/simulator.h"
12
13namespace ns3
14{
15
17 : m_memoryTime(Seconds(1.0)),
18 m_lastUpdate(Seconds(0.0)),
19 m_failAvg(0.0)
20{
21}
22
26
27double
29{
30 double retval = std::exp(((m_lastUpdate - Now()) / m_memoryTime).GetDouble());
32 return retval;
33}
34
35void
37{
38 double coefficient = CalculateAveragingCoefficient();
39 m_failAvg = static_cast<double>(retryCounter) / (1 + retryCounter) * (1 - coefficient) +
40 coefficient * m_failAvg;
41}
42
43void
45{
46 double coefficient = CalculateAveragingCoefficient();
47 m_failAvg = (1 - coefficient) + coefficient * m_failAvg;
48}
49
50double
55
56} // namespace ns3
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
double m_failAvg
moving percentage of failed frames
Time m_lastUpdate
when last update has occurred
double CalculateAveragingCoefficient()
Calculate averaging coefficient for frame error rate.
void NotifyTxSuccess(uint32_t retryCounter)
Updates average frame error rate when data or RTS was transmitted successfully.
Time m_memoryTime
averaging coefficient depends on the memory time
double GetFrameErrorRate() const
Return frame error rate (probability that frame is corrupted due to transmission error).
void NotifyTxFailed()
Updates average frame error rate when final data or RTS has failed.
Time Now()
create an ns3::Time instance which contains the current simulation time.
Definition simulator.cc:294
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Every class exported by the ns3 library is enclosed in the ns3 namespace.