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
propagation-loss-model.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2005,2006,2007 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
* Contributions: Timo Bingmann <timo.bingmann@student.kit.edu>
20
* Contributions: Gary Pei <guangyu.pei@boeing.com> for fixed RSS
21
* Contributions: Tom Hewer <tomhewer@mac.com> for two ray ground model
22
* Pavel Boyko <boyko@iitp.ru> for matrix
23
*/
24
25
#ifndef PROPAGATION_LOSS_MODEL_H
26
#define PROPAGATION_LOSS_MODEL_H
27
28
#include "ns3/object.h"
29
#include "ns3/random-variable-stream.h"
30
#include <map>
31
32
namespace
ns3 {
33
39
class
MobilityModel;
40
49
class
PropagationLossModel
:
public
Object
50
{
51
public
:
52
static
TypeId
GetTypeId
(
void
);
53
54
PropagationLossModel
();
55
virtual
~PropagationLossModel
();
56
65
void
SetNext
(
Ptr<PropagationLossModel>
next);
66
76
Ptr<PropagationLossModel>
GetNext
();
77
84
double
CalcRxPower
(
double
txPowerDbm,
85
Ptr<MobilityModel>
a,
86
Ptr<MobilityModel>
b)
const
;
87
99
int64_t
AssignStreams
(int64_t stream);
100
101
private
:
102
PropagationLossModel
(
const
PropagationLossModel
&o);
103
PropagationLossModel
&
operator =
(
const
PropagationLossModel
&o);
104
virtual
double
DoCalcRxPower
(
double
txPowerDbm,
105
Ptr<MobilityModel>
a,
106
Ptr<MobilityModel>
b)
const
= 0;
107
112
virtual
int64_t
DoAssignStreams
(int64_t stream) = 0;
113
114
Ptr<PropagationLossModel>
m_next
;
115
};
116
122
class
RandomPropagationLossModel
:
public
PropagationLossModel
123
{
124
public
:
125
static
TypeId
GetTypeId
(
void
);
126
127
RandomPropagationLossModel
();
128
virtual
~RandomPropagationLossModel
();
129
130
private
:
131
RandomPropagationLossModel
(
const
RandomPropagationLossModel
&o);
132
RandomPropagationLossModel
&
operator =
(
const
RandomPropagationLossModel
&o);
133
virtual
double
DoCalcRxPower
(
double
txPowerDbm,
134
Ptr<MobilityModel>
a,
135
Ptr<MobilityModel>
b)
const
;
136
virtual
int64_t
DoAssignStreams
(int64_t stream);
137
Ptr<RandomVariableStream>
m_variable
;
138
};
139
175
class
FriisPropagationLossModel
:
public
PropagationLossModel
176
{
177
public
:
178
static
TypeId
GetTypeId
(
void
);
179
FriisPropagationLossModel
();
187
void
SetLambda
(
double
frequency,
double
speed);
194
void
SetLambda
(
double
lambda);
200
void
SetSystemLoss
(
double
systemLoss);
201
208
void
SetMinDistance
(
double
minDistance);
209
213
double
GetMinDistance
(
void
)
const
;
214
218
double
GetLambda
(
void
)
const
;
222
double
GetSystemLoss
(
void
)
const
;
223
224
private
:
225
FriisPropagationLossModel
(
const
FriisPropagationLossModel
&o);
226
FriisPropagationLossModel
&
operator =
(
const
FriisPropagationLossModel
&o);
227
virtual
double
DoCalcRxPower
(
double
txPowerDbm,
228
Ptr<MobilityModel>
a,
229
Ptr<MobilityModel>
b)
const
;
230
virtual
int64_t
DoAssignStreams
(int64_t stream);
231
double
DbmToW
(
double
dbm)
const
;
232
double
DbmFromW
(
double
w
)
const
;
233
234
static
const
double
PI
;
235
double
m_lambda
;
236
double
m_systemLoss
;
237
double
m_minDistance
;
238
};
239
263
class
TwoRayGroundPropagationLossModel
:
public
PropagationLossModel
264
{
265
public
:
266
static
TypeId
GetTypeId
(
void
);
267
TwoRayGroundPropagationLossModel
();
275
void
SetLambda
(
double
frequency,
double
speed);
282
void
SetLambda
(
double
lambda);
288
void
SetSystemLoss
(
double
systemLoss);
295
void
SetMinDistance
(
double
minDistance);
299
double
GetMinDistance
(
void
)
const
;
303
double
GetLambda
(
void
)
const
;
307
double
GetSystemLoss
(
void
)
const
;
313
void
SetHeightAboveZ
(
double
heightAboveZ);
314
315
private
:
316
TwoRayGroundPropagationLossModel
(
const
TwoRayGroundPropagationLossModel
&o);
317
TwoRayGroundPropagationLossModel
&
operator =
(
const
TwoRayGroundPropagationLossModel
&o);
318
virtual
double
DoCalcRxPower
(
double
txPowerDbm,
319
Ptr<MobilityModel>
a,
320
Ptr<MobilityModel>
b)
const
;
321
virtual
int64_t
DoAssignStreams
(int64_t stream);
322
double
DbmToW
(
double
dbm)
const
;
323
double
DbmFromW
(
double
w
)
const
;
324
325
static
const
double
PI
;
326
double
m_lambda
;
327
double
m_systemLoss
;
328
double
m_minDistance
;
329
double
m_heightAboveZ
;
330
};
331
352
class
LogDistancePropagationLossModel
:
public
PropagationLossModel
353
{
354
public
:
355
static
TypeId
GetTypeId
(
void
);
356
LogDistancePropagationLossModel
();
357
362
void
SetPathLossExponent
(
double
n);
366
double
GetPathLossExponent
(
void
)
const
;
367
368
void
SetReference
(
double
referenceDistance,
double
referenceLoss);
369
370
private
:
371
LogDistancePropagationLossModel
(
const
LogDistancePropagationLossModel
&o);
372
LogDistancePropagationLossModel
&
operator =
(
const
LogDistancePropagationLossModel
&o);
373
virtual
double
DoCalcRxPower
(
double
txPowerDbm,
374
Ptr<MobilityModel>
a,
375
Ptr<MobilityModel>
b)
const
;
376
virtual
int64_t
DoAssignStreams
(int64_t stream);
377
static
Ptr<PropagationLossModel>
CreateDefaultReference
(
void
);
378
379
double
m_exponent
;
380
double
m_referenceDistance
;
381
double
m_referenceLoss
;
382
};
383
424
class
ThreeLogDistancePropagationLossModel
:
public
PropagationLossModel
425
{
426
public
:
427
static
TypeId
GetTypeId
(
void
);
428
ThreeLogDistancePropagationLossModel
();
429
430
// Parameters are all accessible via attributes.
431
432
private
:
433
ThreeLogDistancePropagationLossModel
(
const
ThreeLogDistancePropagationLossModel
& o);
434
ThreeLogDistancePropagationLossModel
&
operator=
(
const
ThreeLogDistancePropagationLossModel
& o);
435
436
virtual
double
DoCalcRxPower
(
double
txPowerDbm,
437
Ptr<MobilityModel>
a,
438
Ptr<MobilityModel>
b)
const
;
439
virtual
int64_t
DoAssignStreams
(int64_t stream);
440
441
double
m_distance0
;
442
double
m_distance1
;
443
double
m_distance2
;
444
445
double
m_exponent0
;
446
double
m_exponent1
;
447
double
m_exponent2
;
448
449
double
m_referenceLoss
;
450
};
451
472
class
NakagamiPropagationLossModel
:
public
PropagationLossModel
473
{
474
public
:
475
static
TypeId
GetTypeId
(
void
);
476
477
NakagamiPropagationLossModel
();
478
479
// Parameters are all accessible via attributes.
480
481
private
:
482
NakagamiPropagationLossModel
(
const
NakagamiPropagationLossModel
& o);
483
NakagamiPropagationLossModel
&
operator=
(
const
NakagamiPropagationLossModel
& o);
484
485
virtual
double
DoCalcRxPower
(
double
txPowerDbm,
486
Ptr<MobilityModel>
a,
487
Ptr<MobilityModel>
b)
const
;
488
virtual
int64_t
DoAssignStreams
(int64_t stream);
489
490
double
m_distance1
;
491
double
m_distance2
;
492
493
double
m_m0
;
494
double
m_m1
;
495
double
m_m2
;
496
497
Ptr<ErlangRandomVariable>
m_erlangRandomVariable
;
498
Ptr<GammaRandomVariable>
m_gammaRandomVariable
;
499
};
500
514
class
FixedRssLossModel
:
public
PropagationLossModel
515
{
516
public
:
517
static
TypeId
GetTypeId
(
void
);
518
519
FixedRssLossModel
();
520
virtual
~FixedRssLossModel
();
526
void
SetRss
(
double
rss);
527
528
private
:
529
FixedRssLossModel
(
const
FixedRssLossModel
&o);
530
FixedRssLossModel
&
operator =
(
const
FixedRssLossModel
&o);
531
virtual
double
DoCalcRxPower
(
double
txPowerDbm,
532
Ptr<MobilityModel>
a,
533
Ptr<MobilityModel>
b)
const
;
534
virtual
int64_t
DoAssignStreams
(int64_t stream);
535
double
m_rss
;
536
};
537
545
class
MatrixPropagationLossModel
:
public
PropagationLossModel
546
{
547
public
:
548
static
TypeId
GetTypeId
(
void
);
549
550
MatrixPropagationLossModel
();
551
virtual
~MatrixPropagationLossModel
();
552
562
void
SetLoss
(
Ptr<MobilityModel>
a,
Ptr<MobilityModel>
b,
double
loss,
bool
symmetric =
true
);
564
void
SetDefaultLoss
(
double
);
565
566
private
:
567
virtual
double
DoCalcRxPower
(
double
txPowerDbm,
568
Ptr<MobilityModel>
a,
569
Ptr<MobilityModel>
b)
const
;
570
virtual
int64_t
DoAssignStreams
(int64_t stream);
571
private
:
573
double
m_default
;
574
575
typedef
std::pair< Ptr<MobilityModel>,
Ptr<MobilityModel>
>
MobilityPair
;
577
std::map<MobilityPair, double>
m_loss
;
578
};
579
590
class
RangePropagationLossModel
:
public
PropagationLossModel
591
{
592
public
:
593
static
TypeId
GetTypeId
(
void
);
594
RangePropagationLossModel
();
595
private
:
596
RangePropagationLossModel
(
const
RangePropagationLossModel
& o);
597
RangePropagationLossModel
&
operator=
(
const
RangePropagationLossModel
& o);
598
virtual
double
DoCalcRxPower
(
double
txPowerDbm,
599
Ptr<MobilityModel>
a,
600
Ptr<MobilityModel>
b)
const
;
601
virtual
int64_t
DoAssignStreams
(int64_t stream);
602
private
:
603
double
m_range
;
604
};
605
606
}
// namespace ns3
607
608
#endif
/* PROPAGATION_LOSS_MODEL_H */
src
propagation
model
propagation-loss-model.h
Generated on Tue Nov 13 2012 10:32:21 for ns-3 by
1.8.1.2