A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
spectrum-error-model.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 CTTC
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: Nicola Baldo <nbaldo@cttc.es>
18
*/
19
20
#ifndef SPECTRUM_ERROR_MODEL_H
21
#define SPECTRUM_ERROR_MODEL_H
22
23
#include "
spectrum-value.h
"
24
25
#include <ns3/nstime.h>
26
#include <ns3/object.h>
27
#include <ns3/packet.h>
28
#include <ns3/ptr.h>
29
30
namespace
ns3
31
{
32
37
class
SpectrumErrorModel
:
public
Object
38
{
39
public
:
44
static
TypeId
GetTypeId
();
45
~SpectrumErrorModel
()
override
;
46
51
virtual
void
StartRx
(
Ptr<const Packet>
p) = 0;
52
58
virtual
void
EvaluateChunk
(
const
SpectrumValue
& sinr,
Time
duration) = 0;
59
64
virtual
bool
IsRxCorrect
() = 0;
65
};
66
75
class
ShannonSpectrumErrorModel
:
public
SpectrumErrorModel
76
{
77
protected
:
78
void
DoDispose
()
override
;
79
80
public
:
85
static
TypeId
GetTypeId
();
86
// inherited from SpectrumErrorModel
87
void
StartRx
(
Ptr<const Packet>
p)
override
;
88
void
EvaluateChunk
(
const
SpectrumValue
& sinr,
Time
duration)
override
;
89
bool
IsRxCorrect
()
override
;
90
91
private
:
92
uint32_t
m_bytes
;
93
uint32_t
m_deliverableBytes
;
94
};
95
96
}
// namespace ns3
97
98
#endif
/* SPECTRUM_ERROR_MODEL_H */
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr< const Packet >
ns3::ShannonSpectrumErrorModel
This class implements the error model described in this paper: N.
Definition:
spectrum-error-model.h:76
ns3::ShannonSpectrumErrorModel::StartRx
void StartRx(Ptr< const Packet > p) override
Start a packet reception.
Definition:
spectrum-error-model.cc:67
ns3::ShannonSpectrumErrorModel::m_bytes
uint32_t m_bytes
Length of the packet being received.
Definition:
spectrum-error-model.h:92
ns3::ShannonSpectrumErrorModel::EvaluateChunk
void EvaluateChunk(const SpectrumValue &sinr, Time duration) override
Evaluates a chunk.
Definition:
spectrum-error-model.cc:76
ns3::ShannonSpectrumErrorModel::IsRxCorrect
bool IsRxCorrect() override
Checks if the packet being received is correct.
Definition:
spectrum-error-model.cc:99
ns3::ShannonSpectrumErrorModel::m_deliverableBytes
uint32_t m_deliverableBytes
Bytes that can be received according to the Shnanon's formula.
Definition:
spectrum-error-model.h:93
ns3::ShannonSpectrumErrorModel::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
spectrum-error-model.cc:50
ns3::ShannonSpectrumErrorModel::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
spectrum-error-model.cc:60
ns3::SpectrumErrorModel
Definition:
spectrum-error-model.h:38
ns3::SpectrumErrorModel::StartRx
virtual void StartRx(Ptr< const Packet > p)=0
Start a packet reception.
ns3::SpectrumErrorModel::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
spectrum-error-model.cc:33
ns3::SpectrumErrorModel::IsRxCorrect
virtual bool IsRxCorrect()=0
Checks if the packet being received is correct.
ns3::SpectrumErrorModel::~SpectrumErrorModel
~SpectrumErrorModel() override
Definition:
spectrum-error-model.cc:42
ns3::SpectrumErrorModel::EvaluateChunk
virtual void EvaluateChunk(const SpectrumValue &sinr, Time duration)=0
Evaluates a chunk.
ns3::SpectrumValue
Set of values corresponding to a given SpectrumModel.
Definition:
spectrum-value.h:61
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
spectrum-value.h
src
spectrum
model
spectrum-error-model.h
Generated on Sun Mar 3 2024 17:11:08 for ns-3 by
1.9.1