A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
spectrum-interference.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 CTTC
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Nicola Baldo <nbaldo@cttc.es>
19
*/
20
21
22
#ifndef SPECTRUM_INTERFERENCE_H
23
#define SPECTRUM_INTERFERENCE_H
24
25
#include <ns3/object.h>
26
#include <ns3/packet.h>
27
#include <ns3/nstime.h>
28
#include <ns3/spectrum-value.h>
29
30
namespace
ns3 {
31
32
33
34
35
class
SpectrumErrorModel;
36
37
38
46
class
SpectrumInterference
:
public
Object
47
{
48
public
:
49
SpectrumInterference
();
50
virtual
~SpectrumInterference
();
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
85
94
void
AddSignal
(
Ptr<const SpectrumValue>
spd,
const
Time
duration);
95
96
102
void
SetNoisePowerSpectralDensity
(
Ptr<const SpectrumValue>
noisePsd);
103
104
105
protected
:
106
void
DoDispose
();
107
108
private
:
109
void
ConditionallyEvaluateChunk
();
110
void
DoAddSignal
(
Ptr<const SpectrumValue>
spd);
111
void
DoSubtractSignal
(
Ptr<const SpectrumValue>
spd);
112
113
114
115
bool
m_receiving
;
116
117
Ptr<const SpectrumValue>
m_rxSignal
;
122
Ptr<SpectrumValue>
m_allSignals
;
127
Ptr<const SpectrumValue>
m_noise
;
128
129
Time
m_lastChangeTime
;
132
Ptr<SpectrumErrorModel>
m_errorModel
;
133
134
135
136
};
137
138
139
140
}
// namespace ns3
141
142
143
144
145
146
#endif
/* SPECTRUM_INTERFERENCE_H */
ns3::Time
keep track of time values and allow control of global simulation resolution
Definition:
nstime.h:81
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
ns3::SpectrumInterference::m_receiving
bool m_receiving
Definition:
spectrum-interference.h:115
ns3::SpectrumInterference::SetNoisePowerSpectralDensity
void SetNoisePowerSpectralDensity(Ptr< const SpectrumValue > noisePsd)
Definition:
spectrum-interference.cc:132
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:87
ns3::SpectrumInterference::AbortRx
void AbortRx()
notify that the PHY has aborted RX
Definition:
spectrum-interference.cc:71
ns3::SpectrumInterference::m_noise
Ptr< const SpectrumValue > m_noise
Definition:
spectrum-interference.h:127
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:61
ns3::SpectrumInterference::DoDispose
void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition:
spectrum-interference.cc:50
ns3::SpectrumInterference::m_lastChangeTime
Time m_lastChangeTime
the time of the last change in m_TotalPower
Definition:
spectrum-interference.h:129
ns3::SpectrumInterference::SpectrumInterference
SpectrumInterference()
Definition:
spectrum-interference.cc:34
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:122
ns3::SpectrumInterference::EndRx
bool EndRx()
notify that the RX attempt has ended.
Definition:
spectrum-interference.cc:77
ns3::SpectrumInterference
This class implements a gaussian interference model, i.e., all incoming signals are added to the tota...
Definition:
spectrum-interference.h:46
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:117
ns3::SpectrumInterference::m_errorModel
Ptr< SpectrumErrorModel > m_errorModel
Definition:
spectrum-interference.h:132
ns3::SpectrumInterference::~SpectrumInterference
virtual ~SpectrumInterference()
Definition:
spectrum-interference.cc:44
ns3::SpectrumInterference::DoAddSignal
void DoAddSignal(Ptr< const SpectrumValue > spd)
Definition:
spectrum-interference.cc:96
ns3::SpectrumInterference::SetErrorModel
void SetErrorModel(Ptr< SpectrumErrorModel > e)
set the SpectrumErrorModel to be used.
Definition:
spectrum-interference.cc:144
ns3::SpectrumInterference::DoSubtractSignal
void DoSubtractSignal(Ptr< const SpectrumValue > spd)
Definition:
spectrum-interference.cc:105
ns3::Object
a base class which provides memory management and object aggregation
Definition:
object.h:63
ns3::SpectrumInterference::ConditionallyEvaluateChunk
void ConditionallyEvaluateChunk()
Definition:
spectrum-interference.cc:115
src
spectrum
model
spectrum-interference.h
Generated on Sat Apr 19 2014 14:07:08 for ns-3 by
1.8.6