A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
propagation-loss-model.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005,2006,2007 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 * Contributions: Timo Bingmann <timo.bingmann@student.kit.edu>
8 * Contributions: Tom Hewer <tomhewer@mac.com> for Two Ray Ground Model
9 * Pavel Boyko <boyko@iitp.ru> for matrix
10 */
11
13
14#include "ns3/boolean.h"
15#include "ns3/double.h"
16#include "ns3/log.h"
17#include "ns3/mobility-model.h"
18#include "ns3/node.h"
19#include "ns3/pointer.h"
20#include "ns3/string.h"
21
22#include <cmath>
23
24namespace ns3
25{
26
27NS_LOG_COMPONENT_DEFINE("PropagationLossModel");
28
29// ------------------------------------------------------------------------- //
30
32
35{
36 static TypeId tid =
37 TypeId("ns3::PropagationLossModel").SetParent<Object>().SetGroupName("Propagation");
38 return tid;
39}
40
45
49
50void
55
61
62double
65 Ptr<MobilityModel> b) const
66{
67 double self = DoCalcRxPower(txPowerDbm, a, b);
68 if (m_next)
69 {
70 self = m_next->CalcRxPower(self, a, b);
71 }
72 return self;
73}
74
75int64_t
77{
78 int64_t currentStream = stream;
79 currentStream += DoAssignStreams(stream);
80 if (m_next)
81 {
82 currentStream += m_next->AssignStreams(currentStream);
83 }
84 return (currentStream - stream);
85}
86
87// ------------------------------------------------------------------------- //
88
90
93{
94 static TypeId tid =
95 TypeId("ns3::RandomPropagationLossModel")
97 .SetGroupName("Propagation")
98 .AddConstructor<RandomPropagationLossModel>()
99 .AddAttribute(
100 "Variable",
101 "The random variable used to pick a loss every time CalcRxPower is invoked.",
102 StringValue("ns3::ConstantRandomVariable[Constant=1.0]"),
105 return tid;
106}
107
112
116
117double
120 Ptr<MobilityModel> b) const
121{
122 double rxc = -m_variable->GetValue();
123 NS_LOG_DEBUG("attenuation coefficient=" << rxc << "Db");
124 return txPowerDbm + rxc;
125}
126
127int64_t
129{
130 m_variable->SetStream(stream);
131 return 1;
132}
133
134// ------------------------------------------------------------------------- //
135
137
138TypeId
140{
141 static TypeId tid =
142 TypeId("ns3::FriisPropagationLossModel")
144 .SetGroupName("Propagation")
145 .AddConstructor<FriisPropagationLossModel>()
146 .AddAttribute(
147 "Frequency",
148 "The carrier frequency (in Hz) at which propagation occurs (default is 5.15 GHz).",
149 DoubleValue(5.150e9),
153 .AddAttribute("SystemLoss",
154 "The system loss (linear factor >= 1, not in dB)",
155 DoubleValue(1.0),
159 .AddAttribute("MinLoss",
160 "The minimum value (dB) of the total loss, used at short ranges.",
161 DoubleValue(0.0),
165 return tid;
166}
167
171
172void
174{
175 NS_ABORT_MSG_UNLESS(systemLoss >= 1, "System loss less than 1 corresponds to gain");
176 m_systemLoss = systemLoss;
177}
178
179double
184
185void
187{
188 m_minLoss = minLoss;
189}
190
191double
196
197void
199{
200 m_frequency = frequency;
201 static const double C = 299792458.0; // speed of light in vacuum
202 m_lambda = C / frequency;
203}
204
205double
210
211double
214 Ptr<MobilityModel> b) const
215{
216 /*
217 * Friis free space equation:
218 * where Pt, Gr, Gr and P are in Watt units
219 * L is in meter units.
220 *
221 * P Gt * Gr * (lambda^2)
222 * --- = ---------------------
223 * Pt (4 * pi * d)^2 * L
224 *
225 * Gt: tx gain (unit-less)
226 * Gr: rx gain (unit-less)
227 * Pt: tx power (W)
228 * d: distance (m)
229 * L: system loss
230 * lambda: wavelength (m)
231 *
232 * Here, we ignore tx and rx gain and the input and output values
233 * are in dB or dBm:
234 *
235 * lambda^2
236 * rx = tx + 10 log10 (-------------------)
237 * (4 * pi * d)^2 * L
238 *
239 * rx: rx power (dB)
240 * tx: tx power (dB)
241 * d: distance (m)
242 * L: system loss (unit-less)
243 * lambda: wavelength (m)
244 */
245 double distance = a->GetDistanceFrom(b);
246 if (distance < 3 * m_lambda)
247 {
249 "distance not within the far field region => inaccurate propagation loss value");
250 }
251 if (distance <= 0)
252 {
253 return txPowerDbm - m_minLoss;
254 }
255 double numerator = m_lambda * m_lambda;
256 double denominator = 16 * M_PI * M_PI * distance * distance * m_systemLoss;
257 double lossDb = -10 * log10(numerator / denominator);
258 NS_LOG_DEBUG("distance=" << distance << "m, loss=" << lossDb << "dB");
259 return txPowerDbm - std::max(lossDb, m_minLoss);
260}
261
262int64_t
264{
265 return 0;
266}
267
268// ------------------------------------------------------------------------- //
269// -- Two-Ray Ground Model ported from NS-2 -- tomhewer@mac.com -- Nov09 //
270
272
273TypeId
275{
276 static TypeId tid =
277 TypeId("ns3::TwoRayGroundPropagationLossModel")
279 .SetGroupName("Propagation")
280 .AddConstructor<TwoRayGroundPropagationLossModel>()
281 .AddAttribute(
282 "Frequency",
283 "The carrier frequency (in Hz) at which propagation occurs (default is 5.15 GHz).",
284 DoubleValue(5.150e9),
288 .AddAttribute("SystemLoss",
289 "The system loss (linear factor >= 1, not in dB)",
290 DoubleValue(1.0),
294 .AddAttribute(
295 "MinDistance",
296 "The distance under which the propagation model refuses to give results (m)",
297 DoubleValue(0.5),
301 .AddAttribute("HeightAboveZ",
302 "The height of the antenna (m) above the node's Z coordinate",
303 DoubleValue(0),
306 return tid;
307}
308
312
313void
315{
316 NS_ABORT_MSG_UNLESS(systemLoss >= 1, "System loss less than 1 corresponds to gain");
317 m_systemLoss = systemLoss;
318}
319
320double
325
326void
328{
329 m_minDistance = minDistance;
330}
331
332double
337
338void
340{
341 m_heightAboveZ = heightAboveZ;
342}
343
344void
346{
347 m_frequency = frequency;
348 static const double C = 299792458.0; // speed of light in vacuum
349 m_lambda = C / frequency;
350}
351
352double
357
358double
361 Ptr<MobilityModel> b) const
362{
363 /*
364 * Two-Ray Ground equation:
365 *
366 * where Pt, Gt and Gr are in dBm units
367 * L, Ht and Hr are in meter units.
368 *
369 * Pr Gt * Gr * (Ht^2 * Hr^2)
370 * -- = (-------------------------)
371 * Pt d^4 * L
372 *
373 * Gt: tx gain (unit-less)
374 * Gr: rx gain (unit-less)
375 * Pt: tx power (dBm)
376 * d: distance (m)
377 * L: system loss
378 * Ht: Tx antenna height (m)
379 * Hr: Rx antenna height (m)
380 * lambda: wavelength (m)
381 *
382 * As with the Friis model we ignore tx and rx gain and output values
383 * are in dB or dBm
384 *
385 * (Ht * Ht) * (Hr * Hr)
386 * rx = tx + 10 log10 (-----------------------)
387 * (d * d * d * d) * L
388 */
389 double distance = a->GetDistanceFrom(b);
390 if (distance <= m_minDistance)
391 {
392 return txPowerDbm;
393 }
394
395 // Set the height of the Tx and Rx antennae
396 double txAntHeight = a->GetPosition().z + m_heightAboveZ;
397 double rxAntHeight = b->GetPosition().z + m_heightAboveZ;
398
399 // Calculate a crossover distance, under which we use Friis
400 /*
401 *
402 * dCross = (4 * pi * Ht * Hr) / lambda
403 *
404 */
405
406 double dCross = (4 * M_PI * txAntHeight * rxAntHeight) / m_lambda;
407 double tmp = 0;
408 if (distance <= dCross)
409 {
410 // We use Friis
411 double numerator = m_lambda * m_lambda;
412 tmp = M_PI * distance;
413 double denominator = 16 * tmp * tmp * m_systemLoss;
414 double pr = 10 * std::log10(numerator / denominator);
415 NS_LOG_DEBUG("Receiver within crossover (" << dCross << "m) for Two_ray path; using Friis");
416 NS_LOG_DEBUG("distance=" << distance << "m, attenuation coefficient=" << pr << "dB");
417 return txPowerDbm + pr;
418 }
419 else // Use Two-Ray Pathloss
420 {
421 tmp = txAntHeight * rxAntHeight;
422 double rayNumerator = tmp * tmp;
423 tmp = distance * distance;
424 double rayDenominator = tmp * tmp * m_systemLoss;
425 double rayPr = 10 * std::log10(rayNumerator / rayDenominator);
426 NS_LOG_DEBUG("distance=" << distance << "m, attenuation coefficient=" << rayPr << "dB");
427 return txPowerDbm + rayPr;
428 }
429}
430
431int64_t
433{
434 return 0;
435}
436
437// ------------------------------------------------------------------------- //
438
440
441TypeId
443{
444 static TypeId tid =
445 TypeId("ns3::LogDistancePropagationLossModel")
447 .SetGroupName("Propagation")
448 .AddConstructor<LogDistancePropagationLossModel>()
449 .AddAttribute("Exponent",
450 "The exponent of the Path Loss propagation model",
451 DoubleValue(3.0),
454 .AddAttribute("ReferenceDistance",
455 "The distance at which the reference loss is calculated (m)",
456 DoubleValue(1.0),
459 .AddAttribute("ReferenceLoss",
460 "The reference loss at reference distance (dB). (Default is Friis at 1m "
461 "with 5.15 GHz)",
462 DoubleValue(46.6777),
465 return tid;
466}
467
471
472void
477
478void
479LogDistancePropagationLossModel::SetReference(double referenceDistance, double referenceLoss)
480{
481 m_referenceDistance = referenceDistance;
482 m_referenceLoss = referenceLoss;
483}
484
485double
490
491double
494 Ptr<MobilityModel> b) const
495{
496 double distance = a->GetDistanceFrom(b);
497 if (distance <= m_referenceDistance)
498 {
499 NS_LOG_DEBUG("distance=" << distance << "m, reference-attenuation=" << -m_referenceLoss
500 << "dB, no further attenuation");
501 return txPowerDbm - m_referenceLoss;
502 }
503 /**
504 * The formula is:
505 * rx = 10 * log (Pr0(tx)) - n * 10 * log (d/d0)
506 *
507 * Pr0: rx power at reference distance d0 (W)
508 * d0: reference distance: 1.0 (m)
509 * d: distance (m)
510 * tx: tx power (dB)
511 * rx: dB
512 *
513 * Which, in our case is:
514 *
515 * rx = rx0(tx) - 10 * n * log (d/d0)
516 */
517 double pathLossDb = 10 * m_exponent * std::log10(distance / m_referenceDistance);
518 double rxc = -m_referenceLoss - pathLossDb;
519 NS_LOG_DEBUG("distance=" << distance << "m, reference-attenuation=" << -m_referenceLoss
520 << "dB, "
521 << "attenuation coefficient=" << rxc << "db");
522 return txPowerDbm + rxc;
523}
524
525int64_t
527{
528 return 0;
529}
530
531// ------------------------------------------------------------------------- //
532
534
535TypeId
537{
538 static TypeId tid =
539 TypeId("ns3::ThreeLogDistancePropagationLossModel")
541 .SetGroupName("Propagation")
542 .AddConstructor<ThreeLogDistancePropagationLossModel>()
543 .AddAttribute("Distance0",
544 "Beginning of the first (near) distance field",
545 DoubleValue(1.0),
548 .AddAttribute("Distance1",
549 "Beginning of the second (middle) distance field.",
550 DoubleValue(200.0),
553 .AddAttribute("Distance2",
554 "Beginning of the third (far) distance field.",
555 DoubleValue(500.0),
558 .AddAttribute("Exponent0",
559 "The exponent for the first field.",
560 DoubleValue(1.9),
563 .AddAttribute("Exponent1",
564 "The exponent for the second field.",
565 DoubleValue(3.8),
568 .AddAttribute("Exponent2",
569 "The exponent for the third field.",
570 DoubleValue(3.8),
573 .AddAttribute(
574 "ReferenceLoss",
575 "The reference loss at distance d0 (dB). (Default is Friis at 1m with 5.15 GHz)",
576 DoubleValue(46.6777),
579 return tid;
580}
581
585
586double
589 Ptr<MobilityModel> b) const
590{
591 double distance = a->GetDistanceFrom(b);
592 NS_ASSERT(distance >= 0);
593
594 // See doxygen comments for the formula and explanation
595
596 double pathLossDb;
597
598 if (distance < m_distance0)
599 {
600 pathLossDb = 0;
601 }
602 else if (distance < m_distance1)
603 {
604 pathLossDb = m_referenceLoss + 10 * m_exponent0 * std::log10(distance / m_distance0);
605 }
606 else if (distance < m_distance2)
607 {
608 pathLossDb = m_referenceLoss + 10 * m_exponent0 * std::log10(m_distance1 / m_distance0) +
609 10 * m_exponent1 * std::log10(distance / m_distance1);
610 }
611 else
612 {
613 pathLossDb = m_referenceLoss + 10 * m_exponent0 * std::log10(m_distance1 / m_distance0) +
614 10 * m_exponent1 * std::log10(m_distance2 / m_distance1) +
615 10 * m_exponent2 * std::log10(distance / m_distance2);
616 }
617
618 NS_LOG_DEBUG("ThreeLogDistance distance=" << distance << "m, "
619 << "attenuation=" << pathLossDb << "dB");
620
621 return txPowerDbm - pathLossDb;
622}
623
624int64_t
626{
627 return 0;
628}
629
630// ------------------------------------------------------------------------- //
631
633
634TypeId
636{
637 static TypeId tid =
638 TypeId("ns3::NakagamiPropagationLossModel")
640 .SetGroupName("Propagation")
641 .AddConstructor<NakagamiPropagationLossModel>()
642 .AddAttribute("Distance1",
643 "Beginning of the second distance field. Default is 80m.",
644 DoubleValue(80.0),
647 .AddAttribute("Distance2",
648 "Beginning of the third distance field. Default is 200m.",
649 DoubleValue(200.0),
652 .AddAttribute("m0",
653 "m0 for distances smaller than Distance1. Default is 1.5.",
654 DoubleValue(1.5),
657 .AddAttribute("m1",
658 "m1 for distances smaller than Distance2. Default is 0.75.",
659 DoubleValue(0.75),
662 .AddAttribute("m2",
663 "m2 for distances greater than Distance2. Default is 0.75.",
664 DoubleValue(0.75),
667 .AddAttribute(
668 "ErlangRv",
669 "Access to the underlying ErlangRandomVariable",
670 StringValue("ns3::ErlangRandomVariable"),
673 .AddAttribute("GammaRv",
674 "Access to the underlying GammaRandomVariable",
675 StringValue("ns3::GammaRandomVariable"),
678 ;
679 return tid;
680}
681
685
686double
689 Ptr<MobilityModel> b) const
690{
691 // select m parameter
692
693 double distance = a->GetDistanceFrom(b);
694 NS_ASSERT(distance >= 0);
695
696 double m;
697 if (distance < m_distance1)
698 {
699 m = m_m0;
700 }
701 else if (distance < m_distance2)
702 {
703 m = m_m1;
704 }
705 else
706 {
707 m = m_m2;
708 }
709
710 // the current power unit is dBm, but Watt is put into the Nakagami /
711 // Rayleigh distribution.
712 double powerW = std::pow(10, (txPowerDbm - 30) / 10);
713
714 double resultPowerW;
715
716 // switch between Erlang- and Gamma distributions: this is only for
717 // speed. (Gamma is equal to Erlang for any positive integer m.)
718 auto int_m = static_cast<unsigned int>(std::floor(m));
719
720 if (int_m == m)
721 {
722 resultPowerW = m_erlangRandomVariable->GetValue(int_m, powerW / m);
723 }
724 else
725 {
726 resultPowerW = m_gammaRandomVariable->GetValue(m, powerW / m);
727 }
728
729 double resultPowerDbm = 10 * std::log10(resultPowerW) + 30;
730
731 NS_LOG_DEBUG("Nakagami distance=" << distance << "m, "
732 << "power=" << powerW << "W, "
733 << "resultPower=" << resultPowerW << "W=" << resultPowerDbm
734 << "dBm");
735
736 return resultPowerDbm;
737}
738
739int64_t
741{
742 m_erlangRandomVariable->SetStream(stream);
743 m_gammaRandomVariable->SetStream(stream + 1);
744 return 2;
745}
746
747// ------------------------------------------------------------------------- //
748
750
751TypeId
753{
754 static TypeId tid = TypeId("ns3::FixedRssLossModel")
756 .SetGroupName("Propagation")
757 .AddConstructor<FixedRssLossModel>()
758 .AddAttribute("Rss",
759 "The fixed receiver Rss.",
760 DoubleValue(-150.0),
763 return tid;
764}
765
770
774
775void
777{
778 m_rss = rss;
779}
780
781double
784 Ptr<MobilityModel> b) const
785{
786 return m_rss;
787}
788
789int64_t
791{
792 return 0;
793}
794
795// ------------------------------------------------------------------------- //
796
798
799TypeId
801{
802 static TypeId tid =
803 TypeId("ns3::MatrixPropagationLossModel")
805 .SetGroupName("Propagation")
806 .AddConstructor<MatrixPropagationLossModel>()
807 .AddAttribute("DefaultLoss",
808 "The default value for propagation loss, dB.",
809 DoubleValue(std::numeric_limits<double>::max()),
812 return tid;
813}
814
820
824
825void
827{
828 m_default = loss;
829}
830
831void
834 double loss,
835 bool symmetric)
836{
837 NS_ASSERT(ma && mb);
838
839 uint64_t p = ((uint64_t)ma->GetObject<Node>()->GetId()) << 32 |
840 ((uint64_t)mb->GetObject<Node>()->GetId());
841 auto i = m_loss.find(p);
842
843 if (i == m_loss.end())
844 {
845 m_loss.insert(std::make_pair(p, loss));
846 }
847 else
848 {
849 i->second = loss;
850 }
851
852 if (symmetric)
853 {
854 SetLoss(mb, ma, loss, false);
855 }
856}
857
858double
861 Ptr<MobilityModel> b) const
862{
863 uint64_t p =
864 ((uint64_t)a->GetObject<Node>()->GetId()) << 32 | ((uint64_t)b->GetObject<Node>()->GetId());
865 auto i = m_loss.find(p);
866
867 if (i != m_loss.end())
868 {
869 return txPowerDbm - i->second;
870 }
871 else
872 {
873 return txPowerDbm - m_default;
874 }
875}
876
877int64_t
879{
880 return 0;
881}
882
883// ------------------------------------------------------------------------- //
884
886
887TypeId
889{
890 static TypeId tid = TypeId("ns3::RangePropagationLossModel")
892 .SetGroupName("Propagation")
893 .AddConstructor<RangePropagationLossModel>()
894 .AddAttribute("MaxRange",
895 "Maximum Transmission Range (meters)",
896 DoubleValue(250),
899 return tid;
900}
901
905
906double
909 Ptr<MobilityModel> b) const
910{
911 double distance = a->GetDistanceFrom(b);
912 if (distance <= m_range)
913 {
914 return txPowerDbm;
915 }
916 else
917 {
918 return -1000;
919 }
920}
921
922int64_t
924{
925 return 0;
926}
927
928// ------------------------------------------------------------------------- //
929
930} // namespace ns3
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
Return a constant received power level independent of the transmit power.
double m_rss
the received signal strength
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
static TypeId GetTypeId()
Get the type ID.
a Friis propagation loss model
double m_lambda
the carrier wavelength
double m_frequency
the carrier frequency
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
static TypeId GetTypeId()
Get the type ID.
double m_systemLoss
the system loss (linear factor)
a log distance propagation model.
void SetReference(double referenceDistance, double referenceLoss)
Set the reference path loss at a given distance.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
static TypeId GetTypeId()
Get the type ID.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
The propagation loss is fixed for each pair of nodes and doesn't depend on their actual positions.
void SetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b, double loss, bool symmetric=true)
Set loss (in dB, positive) between pair of ns-3 objects (typically, nodes).
void SetDefaultLoss(double defaultLoss)
Set the default propagation loss (in dB, positive) to be used, infinity if not set.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
std::unordered_map< uint64_t, double > m_loss
Propagation loss between pair of nodes.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
static TypeId GetTypeId()
Get the type ID.
Nakagami-m fast fading propagation loss model.
Ptr< ErlangRandomVariable > m_erlangRandomVariable
Erlang random variable.
double m_m0
m for distances smaller than Distance1
Ptr< GammaRandomVariable > m_gammaRandomVariable
Gamma random variable.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
double m_m1
m for distances smaller than Distance2
double m_m2
m for distances greater than Distance2
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
static TypeId GetTypeId()
Get the type ID.
A network Node.
Definition node.h:46
uint32_t GetId() const
Definition node.cc:106
Object()
Caller graph was not generated because of its size.
Definition object.cc:93
Models the propagation loss through a transmission medium.
virtual int64_t DoAssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model.
Ptr< PropagationLossModel > m_next
Next propagation loss model in the list.
double CalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account all the PropagationLossModel(s) chained to the current one.
static TypeId GetTypeId()
Get the type ID.
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const =0
PropagationLossModel.
int64_t AssignStreams(int64_t stream)
If this loss model uses objects of type RandomVariableStream, set the stream numbers to the integers ...
void SetNext(Ptr< PropagationLossModel > next)
Enables a chain of loss models to act on the signal.
Ptr< PropagationLossModel > GetNext()
Gets the next PropagationLossModel in the chain of loss models that act on the signal.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
The propagation loss follows a random distribution.
static TypeId GetTypeId()
Get the type ID.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
Ptr< RandomVariableStream > m_variable
random generator
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
The propagation loss depends only on the distance (range) between transmitter and receiver.
static TypeId GetTypeId()
Get the type ID.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
double m_range
Maximum Transmission Range (meters).
Hold variables of type string.
Definition string.h:45
A log distance path loss propagation model with three distance fields.
double m_referenceLoss
The reference loss at distance d0 (dB).
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
double m_distance0
Beginning of the first (near) distance field.
double m_distance2
Beginning of the third (far) distance field.
double m_exponent2
The exponent for the third field.
double m_distance1
Beginning of the second (middle) distance field.
double m_exponent0
The exponent for the first field.
double m_exponent1
The exponent for the second field.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
a Two-Ray Ground propagation loss model ported from NS2
double m_minDistance
minimum distance for the model
double m_heightAboveZ
antenna height above the node's Z coordinate
static TypeId GetTypeId()
Get the type ID.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
double m_systemLoss
the system loss (linear factor)
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
a unique identifier for an interface.
Definition type-id.h:49
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:999
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
Ptr< const AttributeChecker > MakeDoubleChecker()
Definition double.h:82
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition double.h:32
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition pointer.h:250
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
Definition pointer.h:273
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
Definition abort.h:133
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:194
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:260
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition log.h:253
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.
STL namespace.