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-interference.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_INTERFERENCE_H
21
#define SPECTRUM_INTERFERENCE_H
22
23
#include <ns3/nstime.h>
24
#include <ns3/object.h>
25
#include <ns3/packet.h>
26
#include <ns3/spectrum-value.h>
27
28
namespace
ns3
29
{
30
31
class
SpectrumErrorModel;
32
40
class
SpectrumInterference
:
public
Object
41
{
42
public
:
43
SpectrumInterference
();
44
~SpectrumInterference
()
override
;
45
50
static
TypeId
GetTypeId
();
51
57
void
SetErrorModel
(
Ptr<SpectrumErrorModel>
e);
58
65
void
StartRx
(
Ptr<const Packet>
p,
Ptr<const SpectrumValue>
rxPsd);
66
70
void
AbortRx
();
71
83
bool
EndRx
();
84
93
void
AddSignal
(
Ptr<const SpectrumValue>
spd,
const
Time
duration);
94
101
void
SetNoisePowerSpectralDensity
(
Ptr<const SpectrumValue>
noisePsd);
102
103
protected
:
104
void
DoDispose
()
override
;
105
106
private
:
110
void
ConditionallyEvaluateChunk
();
115
void
DoAddSignal
(
Ptr<const SpectrumValue>
spd);
120
void
DoSubtractSignal
(
Ptr<const SpectrumValue>
spd);
121
122
bool
m_receiving
;
123
127
Ptr<const SpectrumValue>
m_rxSignal
;
128
133
Ptr<SpectrumValue>
m_allSignals
;
134
135
Ptr<const SpectrumValue>
m_noise
;
136
137
Time
m_lastChangeTime
;
138
139
Ptr<SpectrumErrorModel>
m_errorModel
;
140
};
141
142
}
// namespace ns3
143
144
#endif
/* SPECTRUM_INTERFERENCE_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::SpectrumInterference
This class implements a gaussian interference model, i.e., all incoming signals are added to the tota...
Definition:
spectrum-interference.h:41
ns3::SpectrumInterference::~SpectrumInterference
~SpectrumInterference() override
Definition:
spectrum-interference.cc:42
ns3::SpectrumInterference::AbortRx
void AbortRx()
Notify that the PHY has aborted RX.
Definition:
spectrum-interference.cc:79
ns3::SpectrumInterference::SetNoisePowerSpectralDensity
void SetNoisePowerSpectralDensity(Ptr< const SpectrumValue > noisePsd)
Set the Noise Power Spectral Density.
Definition:
spectrum-interference.cc:137
ns3::SpectrumInterference::ConditionallyEvaluateChunk
void ConditionallyEvaluateChunk()
Evaluate a Chunk, depending on the Rx status and the last update time.
Definition:
spectrum-interference.cc:120
ns3::SpectrumInterference::m_allSignals
Ptr< SpectrumValue > m_allSignals
Stores the spectral power density of the sum of incoming signals; does not include noise,...
Definition:
spectrum-interference.h:133
ns3::SpectrumInterference::EndRx
bool EndRx()
Notify that the RX attempt has ended.
Definition:
spectrum-interference.cc:85
ns3::SpectrumInterference::m_lastChangeTime
Time m_lastChangeTime
the time of the last change in m_TotalPower
Definition:
spectrum-interference.h:137
ns3::SpectrumInterference::m_receiving
bool m_receiving
True if in Rx status.
Definition:
spectrum-interference.h:122
ns3::SpectrumInterference::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
spectrum-interference.cc:48
ns3::SpectrumInterference::m_noise
Ptr< const SpectrumValue > m_noise
Noise spectral power density.
Definition:
spectrum-interference.h:135
ns3::SpectrumInterference::SetErrorModel
void SetErrorModel(Ptr< SpectrumErrorModel > e)
Set the SpectrumErrorModel to be used.
Definition:
spectrum-interference.cc:149
ns3::SpectrumInterference::DoSubtractSignal
void DoSubtractSignal(Ptr< const SpectrumValue > spd)
Removes a signal perceived in the medium.
Definition:
spectrum-interference.cc:111
ns3::SpectrumInterference::StartRx
void StartRx(Ptr< const Packet > p, Ptr< const SpectrumValue > rxPsd)
Notify that the PHY is starting a RX attempt.
Definition:
spectrum-interference.cc:69
ns3::SpectrumInterference::m_errorModel
Ptr< SpectrumErrorModel > m_errorModel
Error model.
Definition:
spectrum-interference.h:139
ns3::SpectrumInterference::DoAddSignal
void DoAddSignal(Ptr< const SpectrumValue > spd)
Adds a signal perceived in the medium.
Definition:
spectrum-interference.cc:102
ns3::SpectrumInterference::SpectrumInterference
SpectrumInterference()
Definition:
spectrum-interference.cc:32
ns3::SpectrumInterference::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
spectrum-interference.cc:58
ns3::SpectrumInterference::AddSignal
void AddSignal(Ptr< const SpectrumValue > spd, const Time duration)
Notify that a new signal is being perceived in the medium.
Definition:
spectrum-interference.cc:94
ns3::SpectrumInterference::m_rxSignal
Ptr< const SpectrumValue > m_rxSignal
Stores the power spectral density of the signal whose RX is being attempted.
Definition:
spectrum-interference.h:127
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.
src
spectrum
model
spectrum-interference.h
Generated on Sun Jul 2 2023 18:22:03 for ns-3 by
1.9.6