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
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 <ns3/nstime.h>
24
#include <ns3/object.h>
25
#include <ns3/packet.h>
26
#include <ns3/ptr.h>
27
#include <ns3/spectrum-value.h>
28
29
namespace
ns3
30
{
31
36
class
SpectrumErrorModel
:
public
Object
37
{
38
public
:
43
static
TypeId
GetTypeId
();
44
~SpectrumErrorModel
()
override
;
45
50
virtual
void
StartRx
(
Ptr<const Packet>
p) = 0;
51
57
virtual
void
EvaluateChunk
(
const
SpectrumValue
& sinr,
Time
duration) = 0;
58
63
virtual
bool
IsRxCorrect
() = 0;
64
};
65
74
class
ShannonSpectrumErrorModel
:
public
SpectrumErrorModel
75
{
76
protected
:
77
void
DoDispose
()
override
;
78
79
public
:
84
static
TypeId
GetTypeId
();
85
// inherited from SpectrumErrorModel
86
void
StartRx
(
Ptr<const Packet>
p)
override
;
87
void
EvaluateChunk
(
const
SpectrumValue
& sinr,
Time
duration)
override
;
88
bool
IsRxCorrect
()
override
;
89
90
private
:
91
uint32_t
m_bytes
;
92
uint32_t
m_deliverableBytes
;
93
};
94
95
}
// namespace ns3
96
97
#endif
/* SPECTRUM_ERROR_MODEL_H */
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:78
ns3::ShannonSpectrumErrorModel
This class implements the error model described in this paper: N.
Definition:
spectrum-error-model.h:75
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:91
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:92
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
Introspection did not find any typical Config paths.
Definition:
spectrum-error-model.h:37
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:60
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
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
spectrum
model
spectrum-error-model.h
Generated on Sun Jul 2 2023 18:22:03 for ns-3 by
1.9.6