A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
propagation-loss-model.h
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: Gary Pei <guangyu.pei@boeing.com> for fixed RSS
9 * Contributions: Tom Hewer <tomhewer@mac.com> for two ray ground model
10 * Pavel Boyko <boyko@iitp.ru> for matrix
11 */
12
13#ifndef PROPAGATION_LOSS_MODEL_H
14#define PROPAGATION_LOSS_MODEL_H
15
16#include "ns3/object.h"
17#include "ns3/random-variable-stream.h"
18
19#include <unordered_map>
20
21namespace ns3
22{
23
24/**
25 * @defgroup propagation Propagation Models
26 */
27
28/**
29 * @ingroup propagation
30 * @ingroup tests
31 * @defgroup propagation-tests Propagation module tests
32 */
33
34class MobilityModel;
35
36/**
37 * @ingroup propagation
38 *
39 * @brief Models the propagation loss through a transmission medium
40 *
41 * Calculate the receive power (dbm) from a transmit power (dbm)
42 * and a mobility model for the source and destination positions.
43 */
45{
46 public:
47 /**
48 * Get the type ID.
49 * @brief Get the type ID.
50 * @return the object TypeId
51 */
52 static TypeId GetTypeId();
53
55 ~PropagationLossModel() override;
56
57 // Delete copy constructor and assignment operator to avoid misuse
60
61 /**
62 * @brief Enables a chain of loss models to act on the signal
63 * @param next The next PropagationLossModel to add to the chain
64 *
65 * This method of chaining propagation loss models only works commutatively
66 * if the propagation loss of all models in the chain are independent
67 * of transmit power.
68 */
70
71 /**
72 * @brief Gets the next PropagationLossModel in the chain of loss models
73 * that act on the signal.
74 * @returns The next PropagationLossModel in the chain
75 *
76 * This method of chaining propagation loss models only works commutatively
77 * if the propagation loss of all models in the chain are independent
78 * of transmit power.
79 */
81
82 /**
83 * Returns the Rx Power taking into account all the PropagationLossModel(s)
84 * chained to the current one.
85 *
86 * @param txPowerDbm current transmission power (in dBm)
87 * @param a the mobility model of the source
88 * @param b the mobility model of the destination
89 * @returns the reception power after adding/multiplying propagation loss (in dBm)
90 */
91 double CalcRxPower(double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
92
93 /**
94 * If this loss model uses objects of type RandomVariableStream,
95 * set the stream numbers to the integers starting with the offset
96 * 'stream'. Return the number of streams (possibly zero) that
97 * have been assigned. If there are PropagationLossModels chained
98 * together, this method will also assign streams to the
99 * downstream models.
100 *
101 * @param stream the stream index offset start
102 * @return the number of stream indices assigned by this model
103 */
104 int64_t AssignStreams(int64_t stream);
105
106 protected:
107 /**
108 * Assign a fixed random variable stream number to the random variables used by this model.
109 *
110 * Subclasses must implement this; those not using random variables
111 * can return zero.
112 *
113 * @param stream first stream index to use
114 * @return the number of stream indices assigned by this model
115 */
116 virtual int64_t DoAssignStreams(int64_t stream) = 0;
117
118 private:
119 /**
120 * PropagationLossModel.
121 *
122 * @param txPowerDbm current transmission power (in dBm)
123 * @param a the mobility model of the source
124 * @param b the mobility model of the destination
125 * @returns the reception power after adding/multiplying propagation loss (in dBm)
126 */
127 virtual double DoCalcRxPower(double txPowerDbm,
129 Ptr<MobilityModel> b) const = 0;
130
131 Ptr<PropagationLossModel> m_next; //!< Next propagation loss model in the list
132};
133
134/**
135 * @ingroup propagation
136 *
137 * @brief The propagation loss follows a random distribution.
138 */
140{
141 public:
142 /**
143 * @brief Get the type ID.
144 * @return the object TypeId
145 */
146 static TypeId GetTypeId();
147
150
151 // Delete copy constructor and assignment operator to avoid misuse
154
155 private:
156 double DoCalcRxPower(double txPowerDbm,
158 Ptr<MobilityModel> b) const override;
159 int64_t DoAssignStreams(int64_t stream) override;
160
162};
163
164/**
165 * @ingroup propagation
166 *
167 * @brief a Friis propagation loss model
168 *
169 * The Friis propagation loss model was first described in
170 * "A Note on a Simple Transmission Formula", by
171 * "Harald T. Friis".
172 *
173 * The original equation was described as:
174 * \f$ \frac{P_r}{P_t} = \frac{A_r A_t}{d^2\lambda^2} \f$
175 * with the following equation for the case of an
176 * isotropic antenna with no heat loss:
177 * \f$ A_{isotr.} = \frac{\lambda^2}{4\pi} \f$
178 *
179 * The final equation becomes:
180 * \f$ \frac{P_r}{P_t} = \frac{\lambda^2}{(4 \pi d)^2} \f$
181 *
182 * Modern extensions to this original equation are:
183 * \f$ P_r = \frac{P_t G_t G_r \lambda^2}{(4 \pi d)^2 L}\f$
184 *
185 * With:
186 * - \f$ P_r \f$ : reception power (W)
187 * - \f$ P_t \f$ : transmission power (W)
188 * - \f$ G_t \f$ : transmission gain (unit-less)
189 * - \f$ G_r \f$ : reception gain (unit-less)
190 * - \f$ \lambda \f$ : wavelength (m)
191 * - \f$ d \f$ : distance (m)
192 * - \f$ L \f$ : system loss (unit-less)
193 *
194 * In the implementation, \f$ \lambda \f$ is calculated as
195 * \f$ \frac{C}{f} \f$, where \f$ C = 299792458\f$ m/s is the speed of light in
196 * vacuum, and \f$ f \f$ is the frequency in Hz which can be configured by
197 * the user via the Frequency attribute.
198 *
199 * The Friis model is valid only for propagation in free space within
200 * the so-called far field region, which can be considered
201 * approximately as the region for \f$ d > 3 \lambda \f$.
202 * The model will still return a value for \f$ d < 3 \lambda \f$, as
203 * doing so (rather than triggering a fatal error) is practical for
204 * many simulation scenarios. However, we stress that the values
205 * obtained in such conditions shall not be considered realistic.
206 *
207 * Related with this issue, we note that the Friis formula is
208 * undefined for \f$ d = 0 \f$, and results in
209 * \f$ P_r > P_t \f$ for \f$ d < \lambda / 2 \sqrt{\pi} \f$.
210 * Both these conditions occur outside of the far field region, so in
211 * principle the Friis model shall not be used in these conditions.
212 * In practice, however, Friis is often used in scenarios where accurate
213 * propagation modeling is not deemed important, and values of \f$ d =
214 * 0 \f$ can occur. To allow practical use of the model in such
215 * scenarios, we have to 1) return some value for \f$ d = 0 \f$, and
216 * 2) avoid large discontinuities in propagation loss values (which
217 * could lead to artifacts such as bogus capture effects which are
218 * much worse than inaccurate propagation loss values). The two issues
219 * are conflicting, as, according to the Friis formula,
220 * \f$\lim_{d \to 0 } P_r = +\infty \f$;
221 * so if, for \f$ d = 0 \f$, we use a fixed loss value, we end up with an infinitely large
222 * discontinuity, which as we discussed can cause undesirable
223 * simulation artifacts.
224 *
225 * To avoid these artifact, this implementation of the Friis model
226 * provides an attribute called MinLoss which allows to specify the
227 * minimum total loss (in dB) returned by the model. This is used in
228 * such a way that
229 * \f$ P_r \f$ continuously increases for \f$ d \to 0 \f$, until
230 * MinLoss is reached, and then stay constant; this allow to
231 * return a value for \f$ d = 0 \f$ and at the same time avoid
232 * discontinuities. The model won't be much realistic, but at least
233 * the simulation artifacts discussed before are avoided. The default value of
234 * MinLoss is 0 dB, which means that by default the model will return
235 * \f$ P_r = P_t \f$ for \f$ d <= \lambda / 2 \sqrt{\pi} \f$. We note
236 * that this value of \f$ d \f$ is outside of the far field
237 * region, hence the validity of the model in the far field region is
238 * not affected.
239 *
240 */
242{
243 public:
244 /**
245 * @brief Get the type ID.
246 * @return the object TypeId
247 */
248 static TypeId GetTypeId();
250
251 // Delete copy constructor and assignment operator to avoid misuse
254
255 /**
256 * @param frequency (Hz)
257 *
258 * Set the carrier frequency used in the Friis model
259 * calculation.
260 */
261 void SetFrequency(double frequency);
262 /**
263 * @param systemLoss (linear factor, dimension-less)
264 *
265 * Set the system loss used by the Friis propagation model.
266 * Value should be greater than or equal to 1; the default of 1
267 * corresponds to no system loss.
268 */
269 void SetSystemLoss(double systemLoss);
270
271 /**
272 * @param minLoss the minimum loss (dB)
273 *
274 * no matter how short the distance, the total propagation loss (in
275 * dB) will always be greater or equal than this value
276 */
277 void SetMinLoss(double minLoss);
278
279 /**
280 * @return the minimum loss.
281 */
282 double GetMinLoss() const;
283
284 /**
285 * @returns the current frequency (Hz)
286 */
287 double GetFrequency() const;
288 /**
289 * @returns the current system loss (linear factor, dimension-less)
290 */
291 double GetSystemLoss() const;
292
293 private:
294 double DoCalcRxPower(double txPowerDbm,
296 Ptr<MobilityModel> b) const override;
297 int64_t DoAssignStreams(int64_t stream) override;
298
299 double m_lambda; //!< the carrier wavelength
300 double m_frequency; //!< the carrier frequency
301 double m_systemLoss; //!< the system loss (linear factor)
302 double m_minLoss; //!< the minimum loss
303};
304
305/**
306 * @ingroup propagation
307 *
308 * @brief a Two-Ray Ground propagation loss model ported from NS2
309 *
310 * Two-ray ground reflection model.
311 *
312 * \f$ Pr = \frac{P_t * G_t * G_r * (H_t^2 * H_r^2)}{d^4 * L} \f$
313 *
314 * The original equation in Rappaport's book assumes L = 1.
315 * To be consistent with the free space equation, L is added here.
316 *
317 * Ht and Hr are set at the respective nodes z coordinate plus a model parameter
318 * set via SetHeightAboveZ.
319 *
320 * The two-ray model does not give a good result for short distances, due to the
321 * oscillation caused by constructive and destructive combination of the two
322 * rays. Instead the Friis free-space model is used for small distances.
323 *
324 * The crossover distance, below which Friis is used, is calculated as follows:
325 *
326 * \f$ dCross = \frac{(4 * \pi * H_t * H_r)}{\lambda} \f$
327 *
328 * In the implementation, \f$ \lambda \f$ is calculated as
329 * \f$ \frac{C}{f} \f$, where \f$ C = 299792458\f$ m/s is the speed of light in
330 * vacuum, and \f$ f \f$ is the frequency in Hz which can be configured by
331 * the user via the Frequency attribute.
332 */
334{
335 public:
336 /**
337 * @brief Get the type ID.
338 * @return the object TypeId
339 */
340 static TypeId GetTypeId();
342
343 // Delete copy constructor and assignment operator to avoid misuse
346
347 /**
348 * @param frequency (Hz)
349 *
350 * Set the carrier frequency used in the TwoRayGround model
351 * calculation.
352 */
353 void SetFrequency(double frequency);
354
355 /**
356 * @param systemLoss (linear factor, dimension-less)
357 *
358 * Set the system loss used by the TwoRayGround propagation model.
359 * Value should be greater than or equal to 1; the default of 1
360 * corresponds to no system loss.
361 */
362 void SetSystemLoss(double systemLoss);
363 /**
364 * @param minDistance the minimum distance
365 *
366 * Below this distance, the txpower is returned
367 * unmodified as the rxpower.
368 */
369 void SetMinDistance(double minDistance);
370 /**
371 * @returns the minimum distance.
372 */
373 double GetMinDistance() const;
374
375 /**
376 * @returns the current frequency (Hz)
377 */
378 double GetFrequency() const;
379
380 /**
381 * @returns the current system loss (linear factor, dimension-less)
382 */
383 double GetSystemLoss() const;
384 /**
385 * @param heightAboveZ the model antenna height above the node's Z coordinate
386 *
387 * Set the model antenna height above the node's Z coordinate
388 */
389 void SetHeightAboveZ(double heightAboveZ);
390
391 private:
392 double DoCalcRxPower(double txPowerDbm,
394 Ptr<MobilityModel> b) const override;
395 int64_t DoAssignStreams(int64_t stream) override;
396
397 double m_lambda; //!< the carrier wavelength
398 double m_frequency; //!< the carrier frequency
399 double m_systemLoss; //!< the system loss (linear factor)
400 double m_minDistance; //!< minimum distance for the model
401 double m_heightAboveZ; //!< antenna height above the node's Z coordinate
402};
403
404/**
405 * @ingroup propagation
406 *
407 * @brief a log distance propagation model.
408 *
409 * This model calculates the reception power with a so-called
410 * log-distance propagation model:
411 * \f$ L = L_0 + 10 n log_{10}(\frac{d}{d_0})\f$
412 *
413 * where:
414 * - \f$ n \f$ : the path loss distance exponent
415 * - \f$ d_0 \f$ : reference distance (m)
416 * - \f$ L_0 \f$ : path loss at reference distance (dB)
417 * - \f$ d \f$ : distance (m)
418 * - \f$ L \f$ : path loss (dB)
419 *
420 * When the path loss is requested at a distance smaller than
421 * the reference distance, the tx power is returned.
422 *
423 */
425{
426 public:
427 /**
428 * @brief Get the type ID.
429 * @return the object TypeId
430 */
431 static TypeId GetTypeId();
433
434 // Delete copy constructor and assignment operator to avoid misuse
437
438 /**
439 * @param n the path loss exponent.
440 * Set the path loss exponent.
441 */
442 void SetPathLossExponent(double n);
443 /**
444 * @returns the current path loss exponent.
445 */
446 double GetPathLossExponent() const;
447
448 /**
449 * Set the reference path loss at a given distance
450 * @param referenceDistance reference distance
451 * @param referenceLoss reference path loss
452 */
453 void SetReference(double referenceDistance, double referenceLoss);
454
455 private:
456 double DoCalcRxPower(double txPowerDbm,
458 Ptr<MobilityModel> b) const override;
459
460 int64_t DoAssignStreams(int64_t stream) override;
461
462 /**
463 * Creates a default reference loss model
464 * @return a default reference loss model
465 */
467
468 double m_exponent; //!< model exponent
469 double m_referenceDistance; //!< reference distance
470 double m_referenceLoss; //!< reference loss
471};
472
473/**
474 * @ingroup propagation
475 *
476 * @brief A log distance path loss propagation model with three distance
477 * fields. This model is the same as ns3::LogDistancePropagationLossModel
478 * except that it has three distance fields: near, middle and far with
479 * different exponents.
480 *
481 * Within each field the reception power is calculated using the log-distance
482 * propagation equation:
483 * \f[ L = L_0 + 10 \cdot n_0 log_{10}(\frac{d}{d_0})\f]
484 * Each field begins where the previous ends and all together form a continuous function.
485 *
486 * There are three valid distance fields: near, middle, far. Actually four: the
487 * first from 0 to the reference distance is invalid and returns txPowerDbm.
488 *
489 * \f[ \underbrace{0 \cdots\cdots}_{=0} \underbrace{d_0 \cdots\cdots}_{n_0} \underbrace{d_1
490\cdots\cdots}_{n_1} \underbrace{d_2 \cdots\cdots}_{n_2} \infty \f]
491 *
492 * Complete formula for the path loss in dB:
493 *
494 * \f[\displaystyle L =
495\begin{cases}
4960 & d < d_0 \\
497L_0 + 10 \cdot n_0 \log_{10}(\frac{d}{d_0}) & d_0 \leq d < d_1 \\
498L_0 + 10 \cdot n_0 \log_{10}(\frac{d_1}{d_0}) + 10 \cdot n_1 \log_{10}(\frac{d}{d_1}) & d_1 \leq d <
499d_2 \\ L_0 + 10 \cdot n_0 \log_{10}(\frac{d_1}{d_0}) + 10 \cdot n_1 \log_{10}(\frac{d_2}{d_1}) + 10
500\cdot n_2 \log_{10}(\frac{d}{d_2})& d_2 \leq d \end{cases}\f]
501 *
502 * where:
503 * - \f$ L \f$ : resulting path loss (dB)
504 * - \f$ d \f$ : distance (m)
505 * - \f$ d_0, d_1, d_2 \f$ : three distance fields (m)
506 * - \f$ n_0, n_1, n_2 \f$ : path loss distance exponent for each field (unitless)
507 * - \f$ L_0 \f$ : path loss at reference distance (dB)
508 *
509 * When the path loss is requested at a distance smaller than the reference
510 * distance \f$ d_0 \f$, the tx power (with no path loss) is returned. The
511 * reference distance defaults to 1m and reference loss defaults to
512 * ns3::FriisPropagationLossModel with 5.15 GHz and is thus \f$ L_0 \f$ = 46.67 dB.
513 */
515{
516 public:
517 /**
518 * @brief Get the type ID.
519 * @return the object TypeId
520 */
521 static TypeId GetTypeId();
523
524 // Delete copy constructor and assignment operator to avoid misuse
527 delete;
528
529 // Parameters are all accessible via attributes.
530
531 private:
532 double DoCalcRxPower(double txPowerDbm,
534 Ptr<MobilityModel> b) const override;
535
536 int64_t DoAssignStreams(int64_t stream) override;
537
538 double m_distance0; //!< Beginning of the first (near) distance field
539 double m_distance1; //!< Beginning of the second (middle) distance field.
540 double m_distance2; //!< Beginning of the third (far) distance field.
541
542 double m_exponent0; //!< The exponent for the first field.
543 double m_exponent1; //!< The exponent for the second field.
544 double m_exponent2; //!< The exponent for the third field.
545
546 double m_referenceLoss; //!< The reference loss at distance d0 (dB).
547};
548
549/**
550 * @ingroup propagation
551 *
552 * @brief Nakagami-m fast fading propagation loss model.
553 *
554 * This propagation loss model implements the Nakagami-m fast fading
555 * model, which accounts for the variations in signal strength due to multipath
556 * fading. The model does not account for the path loss due to the
557 * distance traveled by the signal, hence for typical simulation usage it
558 * is recommended to consider using it in combination with other models
559 * that take into account this aspect.
560 *
561 * The Nakagami-m distribution is applied to the power level. The probability
562 * density function is defined as
563 * \f[ p(x; m, \omega) = \frac{2 m^m}{\Gamma(m) \omega^m} x^{2m - 1} e^{-\frac{m}{\omega} x^2} \f]
564 * with \f$ m \f$ the fading depth parameter and \f$ \omega \f$ the average received power.
565 *
566 * It is implemented by either a ns3::GammaRandomVariable or a
567 * ns3::ErlangRandomVariable random variable.
568 *
569 * The implementation of the model allows to specify different values of the m parameter (and hence
570 * different fading profiles) for three different distance ranges: \f[ \underbrace{0
571 * \cdots\cdots}_{m_0} \underbrace{d_1 \cdots\cdots}_{m_1} \underbrace{d_2 \cdots\cdots}_{m_2}
572 * @infty \f]
573 *
574 * For m = 1 the Nakagami-m distribution equals the Rayleigh distribution. Thus
575 * this model also implements Rayleigh distribution based fast fading.
576 */
578{
579 public:
580 /**
581 * @brief Get the type ID.
582 * @return the object TypeId
583 */
584 static TypeId GetTypeId();
585
587
588 // Delete copy constructor and assignment operator to avoid misuse
591
592 // Parameters are all accessible via attributes.
593
594 private:
595 double DoCalcRxPower(double txPowerDbm,
597 Ptr<MobilityModel> b) const override;
598
599 int64_t DoAssignStreams(int64_t stream) override;
600
601 double m_distance1; //!< Distance1
602 double m_distance2; //!< Distance2
603
604 double m_m0; //!< m for distances smaller than Distance1
605 double m_m1; //!< m for distances smaller than Distance2
606 double m_m2; //!< m for distances greater than Distance2
607
610};
611
612/**
613 * @ingroup propagation
614 *
615 * @brief Return a constant received power level independent of the transmit
616 * power
617 *
618 * The received power is constant independent of the transmit power. The user
619 * must set received power level through the Rss attribute or public
620 * SetRss() method. Note that if this loss model is chained to other loss
621 * models via SetNext() method, it can only be the first loss model in such
622 * a chain, or else it will disregard the losses computed by loss models
623 * that precede it in the chain.
624 */
626{
627 public:
628 /**
629 * @brief Get the type ID.
630 * @return the object TypeId
631 */
632 static TypeId GetTypeId();
633
635 ~FixedRssLossModel() override;
636
637 // Delete copy constructor and assignment operator to avoid misuse
640
641 /**
642 * @param rss (dBm) the received signal strength
643 *
644 * Set the received signal strength (RSS) in dBm.
645 */
646 void SetRss(double rss);
647
648 private:
649 double DoCalcRxPower(double txPowerDbm,
651 Ptr<MobilityModel> b) const override;
652
653 int64_t DoAssignStreams(int64_t stream) override;
654
655 double m_rss; //!< the received signal strength
656};
657
658/**
659 * @ingroup propagation
660 *
661 * @brief The propagation loss is fixed for each pair of nodes and doesn't depend on their actual
662 * positions.
663 *
664 * This is supposed to be used by synthetic tests. Note that by default propagation loss is assumed
665 * to be symmetric.
666 */
668{
669 public:
670 /**
671 * @brief Get the type ID.
672 * @return the object TypeId
673 */
674 static TypeId GetTypeId();
675
678
679 // Delete copy constructor and assignment operator to avoid misuse
682
683 /**
684 * @brief Set loss (in dB, positive) between pair of ns-3 objects
685 * (typically, nodes).
686 *
687 * @param a ma Source mobility model
688 * @param b mb Destination mobility model
689 * @param loss a -> b path loss, positive in dB
690 * @param symmetric If true (default), both a->b and b->a paths will be affected
691 */
692 void SetLoss(Ptr<MobilityModel> a, Ptr<MobilityModel> b, double loss, bool symmetric = true);
693
694 /**
695 * Set the default propagation loss (in dB, positive) to be used, infinity if not set
696 * @param defaultLoss the default proagation loss
697 */
698 void SetDefaultLoss(double defaultLoss);
699
700 private:
701 double DoCalcRxPower(double txPowerDbm,
703 Ptr<MobilityModel> b) const override;
704
705 int64_t DoAssignStreams(int64_t stream) override;
706
707 double m_default; //!< default loss
708
709 std::unordered_map<uint64_t, double> m_loss; //!< Propagation loss between pair of nodes
710};
711
712/**
713 * @ingroup propagation
714 *
715 * @brief The propagation loss depends only on the distance (range) between transmitter and
716 * receiver.
717 *
718 * The single MaxRange attribute (units of meters) determines path loss.
719 * Receivers at or within MaxRange meters receive the transmission at the
720 * transmit power level. Receivers beyond MaxRange receive at power
721 * -1000 dBm (effectively zero).
722 */
724{
725 public:
726 /**
727 * @brief Get the type ID.
728 * @return the object TypeId
729 */
730 static TypeId GetTypeId();
732
733 // Delete copy constructor and assignment operator to avoid misuse
736
737 private:
738 double DoCalcRxPower(double txPowerDbm,
740 Ptr<MobilityModel> b) const override;
741
742 int64_t DoAssignStreams(int64_t stream) override;
743
744 double m_range; //!< Maximum Transmission Range (meters)
745};
746
747} // namespace ns3
748
749#endif /* PROPAGATION_LOSS_MODEL_H */
double m_rss
the received signal strength
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
FixedRssLossModel & operator=(const FixedRssLossModel &)=delete
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
FixedRssLossModel(const FixedRssLossModel &)=delete
static TypeId GetTypeId()
Get the type ID.
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.
FriisPropagationLossModel(const FriisPropagationLossModel &)=delete
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)
FriisPropagationLossModel & operator=(const FriisPropagationLossModel &)=delete
LogDistancePropagationLossModel & operator=(const LogDistancePropagationLossModel &)=delete
LogDistancePropagationLossModel(const LogDistancePropagationLossModel &)=delete
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.
static Ptr< PropagationLossModel > CreateDefaultReference()
Creates a default reference loss model.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
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.
MatrixPropagationLossModel(const MatrixPropagationLossModel &)=delete
MatrixPropagationLossModel & operator=(const MatrixPropagationLossModel &)=delete
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.
Keep track of the current position and velocity of an object.
Ptr< ErlangRandomVariable > m_erlangRandomVariable
Erlang random variable.
double m_m0
m for distances smaller than Distance1
NakagamiPropagationLossModel(const NakagamiPropagationLossModel &)=delete
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.
NakagamiPropagationLossModel & operator=(const NakagamiPropagationLossModel &)=delete
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.
Object()
Caller graph was not generated because of its size.
Definition object.cc:93
PropagationLossModel & operator=(const PropagationLossModel &)=delete
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.
PropagationLossModel(const PropagationLossModel &)=delete
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
RandomPropagationLossModel & operator=(const RandomPropagationLossModel &)=delete
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.
RandomPropagationLossModel(const RandomPropagationLossModel &)=delete
RangePropagationLossModel & operator=(const RangePropagationLossModel &)=delete
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.
RangePropagationLossModel(const RangePropagationLossModel &)=delete
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
double m_range
Maximum Transmission Range (meters).
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.
ThreeLogDistancePropagationLossModel(const ThreeLogDistancePropagationLossModel &)=delete
double m_exponent2
The exponent for the third field.
double m_distance1
Beginning of the second (middle) distance field.
ThreeLogDistancePropagationLossModel & operator=(const ThreeLogDistancePropagationLossModel &)=delete
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.
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.
TwoRayGroundPropagationLossModel(const TwoRayGroundPropagationLossModel &)=delete
TwoRayGroundPropagationLossModel & operator=(const TwoRayGroundPropagationLossModel &)=delete
a unique identifier for an interface.
Definition type-id.h:49
Every class exported by the ns3 library is enclosed in the ns3 namespace.