A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
three-gpp-propagation-loss-model-test-suite.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering,
3 * University of Padova
4 *
5 * SPDX-License-Identifier: GPL-2.0-only
6 */
7
8#include "ns3/abort.h"
9#include "ns3/boolean.h"
10#include "ns3/channel-condition-model.h"
11#include "ns3/config.h"
12#include "ns3/constant-position-mobility-model.h"
13#include "ns3/constant-velocity-mobility-model.h"
14#include "ns3/double.h"
15#include "ns3/log.h"
16#include "ns3/mobility-helper.h"
17#include "ns3/node.h"
18#include "ns3/rng-seed-manager.h"
19#include "ns3/simple-net-device.h"
20#include "ns3/simulator.h"
21#include "ns3/string.h"
22#include "ns3/test.h"
23#include "ns3/three-gpp-propagation-loss-model.h"
24#include "ns3/three-gpp-v2v-propagation-loss-model.h"
25
26using namespace ns3;
27
28NS_LOG_COMPONENT_DEFINE("ThreeGppPropagationLossModelsTest");
29
30/**
31 * @ingroup propagation-tests
32 *
33 * Test case for the class ThreeGppRmaPropagationLossModel.
34 * It computes the pathloss between two nodes and compares it with the value
35 * obtained using the formula in 3GPP TR 38.901, Table 7.4.1-1.
36 */
38{
39 public:
40 /**
41 * Constructor
42 */
44
45 /**
46 * Destructor
47 */
49
50 private:
51 /**
52 * Build the simulation scenario and run the tests
53 */
54 void DoRun() override;
55
56 /**
57 * Struct containing the parameters for each test
58 */
60 {
61 double m_distance; //!< 2D distance between UT and BS in meters
62 bool m_isLos; //!< if true LOS, if false NLOS
63 double m_frequency; //!< carrier frequency in Hz
64 double m_pt; //!< transmitted power in dBm
65 double m_pr; //!< received power in dBm
66 };
67
68 TestVectors<TestVector> m_testVectors; //!< array containing all the test vectors
69 double m_tolerance; //!< tolerance
70};
71
73 : TestCase("Test for the ThreeGppRmaPropagationLossModel class"),
75 m_tolerance(5e-2)
76{
77}
78
82
83void
85{
86 TestVector testVector;
87
88 testVector.m_distance = 10.0;
89 testVector.m_isLos = true;
90 testVector.m_frequency = 5.0e9;
91 testVector.m_pt = 0.0;
92 testVector.m_pr = -77.3784;
93 m_testVectors.Add(testVector);
94
95 testVector.m_distance = 100.0;
96 testVector.m_isLos = true;
97 testVector.m_frequency = 5.0e9;
98 testVector.m_pt = 0.0;
99 testVector.m_pr = -87.2965;
100 m_testVectors.Add(testVector);
101
102 testVector.m_distance = 1000.0;
103 testVector.m_isLos = true;
104 testVector.m_frequency = 5.0e9;
105 testVector.m_pt = 0.0;
106 testVector.m_pr = -108.5577;
107 m_testVectors.Add(testVector);
108
109 testVector.m_distance = 10000.0;
110 testVector.m_isLos = true;
111 testVector.m_frequency = 5.0e9;
112 testVector.m_pt = 0.0;
113 testVector.m_pr = -140.3896;
114 m_testVectors.Add(testVector);
115
116 testVector.m_distance = 10.0;
117 testVector.m_isLos = false;
118 testVector.m_frequency = 5.0e9;
119 testVector.m_pt = 0.0;
120 testVector.m_pr = -77.3784;
121 m_testVectors.Add(testVector);
122
123 testVector.m_distance = 100.0;
124 testVector.m_isLos = false;
125 testVector.m_frequency = 5.0e9;
126 testVector.m_pt = 0.0;
127 testVector.m_pr = -95.7718;
128 m_testVectors.Add(testVector);
129
130 testVector.m_distance = 1000.0;
131 testVector.m_isLos = false;
132 testVector.m_frequency = 5.0e9;
133 testVector.m_pt = 0.0;
134 testVector.m_pr = -133.5223;
135 m_testVectors.Add(testVector);
136
137 testVector.m_distance = 5000.0;
138 testVector.m_isLos = false;
139 testVector.m_frequency = 5.0e9;
140 testVector.m_pt = 0.0;
141 testVector.m_pr = -160.5169;
142 m_testVectors.Add(testVector);
143
144 // Create the nodes for BS and UT
146 nodes.Create(2);
147
148 // Create the mobility models
150 nodes.Get(0)->AggregateObject(a);
152 nodes.Get(1)->AggregateObject(b);
153
154 // Use a deterministic channel condition model
157
158 // Create the propagation loss model
161 lossModel->SetAttribute("ShadowingEnabled", BooleanValue(false)); // disable the shadow fading
162
163 for (const auto& testVector : m_testVectors)
164 {
165 Vector posBs = Vector(0.0, 0.0, 35.0);
166 Vector posUt = Vector(testVector.m_distance, 0.0, 1.5);
167
168 // set the LOS or NLOS condition
169 if (testVector.m_isLos)
170 {
171 lossModel->SetChannelConditionModel(losCondModel);
172 }
173 else
174 {
175 lossModel->SetChannelConditionModel(nlosCondModel);
176 }
177
178 a->SetPosition(posBs);
179 b->SetPosition(posUt);
180
181 lossModel->SetAttribute("Frequency", DoubleValue(testVector.m_frequency));
182 NS_TEST_EXPECT_MSG_EQ_TOL(lossModel->CalcRxPower(testVector.m_pt, a, b),
183 testVector.m_pr,
185 "Got unexpected rcv power");
186 }
187
189}
190
191/**
192 * @ingroup propagation-tests
193 *
194 * Test case for the class ThreeGppUmaPropagationLossModel.
195 * It computes the pathloss between two nodes and compares it with the value
196 * obtained using the formula in 3GPP TR 38.901, Table 7.4.1-1.
197 */
199{
200 public:
201 /**
202 * Constructor
203 */
205
206 /**
207 * Destructor
208 */
210
211 private:
212 /**
213 * Build the simulation scenario and run the tests
214 */
215 void DoRun() override;
216
217 /**
218 * Struct containing the parameters for each test
219 */
221 {
222 double m_distance; //!< 2D distance between UT and BS in meters
223 bool m_isLos; //!< if true LOS, if false NLOS
224 double m_frequency; //!< carrier frequency in Hz
225 double m_pt; //!< transmitted power in dBm
226 double m_pr; //!< received power in dBm
227 };
228
229 TestVectors<TestVector> m_testVectors; //!< array containing all the test vectors
230 double m_tolerance; //!< tolerance
231};
232
234 : TestCase("Test for the ThreeGppUmaPropagationLossModel class"),
236 m_tolerance(5e-2)
237{
238}
239
243
244void
246{
247 TestVector testVector;
248
249 testVector.m_distance = 10.0;
250 testVector.m_isLos = true;
251 testVector.m_frequency = 5.0e9;
252 testVector.m_pt = 0.0;
253 testVector.m_pr = -72.9380;
254 m_testVectors.Add(testVector);
255
256 testVector.m_distance = 100.0;
257 testVector.m_isLos = true;
258 testVector.m_frequency = 5.0e9;
259 testVector.m_pt = 0.0;
260 testVector.m_pr = -86.2362;
261 m_testVectors.Add(testVector);
262
263 testVector.m_distance = 1000.0;
264 testVector.m_isLos = true;
265 testVector.m_frequency = 5.0e9;
266 testVector.m_pt = 0.0;
267 testVector.m_pr = -109.7252;
268 m_testVectors.Add(testVector);
269
270 testVector.m_distance = 5000.0;
271 testVector.m_isLos = true;
272 testVector.m_frequency = 5.0e9;
273 testVector.m_pt = 0.0;
274 testVector.m_pr = -137.6794;
275 m_testVectors.Add(testVector);
276
277 testVector.m_distance = 10.0;
278 testVector.m_isLos = false;
279 testVector.m_frequency = 5.0e9;
280 testVector.m_pt = 0.0;
281 testVector.m_pr = -82.5131;
282 m_testVectors.Add(testVector);
283
284 testVector.m_distance = 100.0;
285 testVector.m_isLos = false;
286 testVector.m_frequency = 5.0e9;
287 testVector.m_pt = 0.0;
288 testVector.m_pr = -106.1356;
289 m_testVectors.Add(testVector);
290
291 testVector.m_distance = 1000.0;
292 testVector.m_isLos = false;
293 testVector.m_frequency = 5.0e9;
294 testVector.m_pt = 0.0;
295 testVector.m_pr = -144.7641;
296 m_testVectors.Add(testVector);
297
298 testVector.m_distance = 5000.0;
299 testVector.m_isLos = false;
300 testVector.m_frequency = 5.0e9;
301 testVector.m_pt = 0.0;
302 testVector.m_pr = -172.0753;
303 m_testVectors.Add(testVector);
304
305 // Create the nodes for BS and UT
307 nodes.Create(2);
308
309 // Create the mobility models
311 nodes.Get(0)->AggregateObject(a);
313 nodes.Get(1)->AggregateObject(b);
314
315 // Use a deterministic channel condition model
318
319 // Create the propagation loss model
322 lossModel->SetAttribute("ShadowingEnabled", BooleanValue(false)); // disable the shadow fading
323
324 for (std::size_t i = 0; i < m_testVectors.GetN(); i++)
325 {
326 TestVector testVector = m_testVectors.Get(i);
327
328 Vector posBs = Vector(0.0, 0.0, 25.0);
329 Vector posUt = Vector(testVector.m_distance, 0.0, 1.5);
330
331 // set the LOS or NLOS condition
332 if (testVector.m_isLos)
333 {
334 lossModel->SetChannelConditionModel(losCondModel);
335 }
336 else
337 {
338 lossModel->SetChannelConditionModel(nlosCondModel);
339 }
340
341 a->SetPosition(posBs);
342 b->SetPosition(posUt);
343
344 lossModel->SetAttribute("Frequency", DoubleValue(testVector.m_frequency));
345 NS_TEST_EXPECT_MSG_EQ_TOL(lossModel->CalcRxPower(testVector.m_pt, a, b),
346 testVector.m_pr,
348 "Got unexpected rcv power");
349 }
350
352}
353
354/**
355 * @ingroup propagation-tests
356 *
357 * Test case for the class ThreeGppUmiStreetCanyonPropagationLossModel.
358 * It computes the pathloss between two nodes and compares it with the value
359 * obtained using the formula in 3GPP TR 38.901, Table 7.4.1-1.
360 */
362{
363 public:
364 /**
365 * Constructor
366 */
368
369 /**
370 * Destructor
371 */
373
374 private:
375 /**
376 * Build the simulation scenario and run the tests
377 */
378 void DoRun() override;
379
380 /**
381 * Struct containing the parameters for each test
382 */
384 {
385 double m_distance; //!< 2D distance between UT and BS in meters
386 bool m_isLos; //!< if true LOS, if false NLOS
387 double m_frequency; //!< carrier frequency in Hz
388 double m_pt; //!< transmitted power in dBm
389 double m_pr; //!< received power in dBm
390 };
391
392 TestVectors<TestVector> m_testVectors; //!< array containing all the test vectors
393 double m_tolerance; //!< tolerance
394};
395
397 : TestCase("Test for the ThreeGppUmiPropagationLossModel class"),
399 m_tolerance(5e-2)
400{
401}
402
406
407void
409{
410 TestVector testVector;
411
412 testVector.m_distance = 10.0;
413 testVector.m_isLos = true;
414 testVector.m_frequency = 5.0e9;
415 testVector.m_pt = 0.0;
416 testVector.m_pr = -69.8591;
417 m_testVectors.Add(testVector);
418
419 testVector.m_distance = 100.0;
420 testVector.m_isLos = true;
421 testVector.m_frequency = 5.0e9;
422 testVector.m_pt = 0.0;
423 testVector.m_pr = -88.4122;
424 m_testVectors.Add(testVector);
425
426 testVector.m_distance = 1000.0;
427 testVector.m_isLos = true;
428 testVector.m_frequency = 5.0e9;
429 testVector.m_pt = 0.0;
430 testVector.m_pr = -119.3114;
431
432 testVector.m_distance = 5000.0;
433 testVector.m_isLos = true;
434 testVector.m_frequency = 5.0e9;
435 testVector.m_pt = 0.0;
436 testVector.m_pr = -147.2696;
437
438 testVector.m_distance = 10.0;
439 testVector.m_isLos = false;
440 testVector.m_frequency = 5.0e9;
441 testVector.m_pt = 0.0;
442 testVector.m_pr = -76.7563;
443
444 testVector.m_distance = 100.0;
445 testVector.m_isLos = false;
446 testVector.m_frequency = 5.0e9;
447 testVector.m_pt = 0.0;
448 testVector.m_pr = -107.9432;
449
450 testVector.m_distance = 1000.0;
451 testVector.m_isLos = false;
452 testVector.m_frequency = 5.0e9;
453 testVector.m_pt = 0.0;
454 testVector.m_pr = -143.1886;
455
456 testVector.m_distance = 5000.0;
457 testVector.m_isLos = false;
458 testVector.m_frequency = 5.0e9;
459 testVector.m_pt = 0.0;
460 testVector.m_pr = -167.8617;
461
462 // Create the nodes for BS and UT
464 nodes.Create(2);
465
466 // Create the mobility models
468 nodes.Get(0)->AggregateObject(a);
470 nodes.Get(1)->AggregateObject(b);
471
472 // Use a deterministic channel condition model
475
476 // Create the propagation loss model
479 lossModel->SetAttribute("ShadowingEnabled", BooleanValue(false)); // disable the shadow fading
480
481 for (std::size_t i = 0; i < m_testVectors.GetN(); i++)
482 {
483 TestVector testVector = m_testVectors.Get(i);
484
485 Vector posBs = Vector(0.0, 0.0, 10.0);
486 Vector posUt = Vector(testVector.m_distance, 0.0, 1.5);
487
488 // set the LOS or NLOS condition
489 if (testVector.m_isLos)
490 {
491 lossModel->SetChannelConditionModel(losCondModel);
492 }
493 else
494 {
495 lossModel->SetChannelConditionModel(nlosCondModel);
496 }
497
498 a->SetPosition(posBs);
499 b->SetPosition(posUt);
500
501 lossModel->SetAttribute("Frequency", DoubleValue(testVector.m_frequency));
502 NS_TEST_EXPECT_MSG_EQ_TOL(lossModel->CalcRxPower(testVector.m_pt, a, b),
503 testVector.m_pr,
505 "Got unexpected rcv power");
506 }
507
509}
510
511/**
512 * @ingroup propagation-tests
513 *
514 * Test case for the class ThreeGppIndoorOfficePropagationLossModel.
515 * It computes the pathloss between two nodes and compares it with the value
516 * obtained using the formula in 3GPP TR 38.901, Table 7.4.1-1.
517 */
519{
520 public:
521 /**
522 * Constructor
523 */
525
526 /**
527 * Destructor
528 */
530
531 private:
532 /**
533 * Build the simulation scenario and run the tests
534 */
535 void DoRun() override;
536
537 /**
538 * Struct containing the parameters for each test
539 */
541 {
542 double m_distance; //!< 2D distance between UT and BS in meters
543 bool m_isLos; //!< if true LOS, if false NLOS
544 double m_frequency; //!< carrier frequency in Hz
545 double m_pt; //!< transmitted power in dBm
546 double m_pr; //!< received power in dBm
547 };
548
549 TestVectors<TestVector> m_testVectors; //!< array containing all the test vectors
550 double m_tolerance; //!< tolerance
551};
552
554 : TestCase("Test for the ThreeGppIndoorOfficePropagationLossModel class"),
556 m_tolerance(5e-2)
557{
558}
559
564
565void
567{
568 TestVector testVector;
569
570 testVector.m_distance = 1.0;
571 testVector.m_isLos = true;
572 testVector.m_frequency = 5.0e9;
573 testVector.m_pt = 0.0;
574 testVector.m_pr = -50.8072;
575 m_testVectors.Add(testVector);
576
577 testVector.m_distance = 10.0;
578 testVector.m_isLos = true;
579 testVector.m_frequency = 5.0e9;
580 testVector.m_pt = 0.0;
581 testVector.m_pr = -63.7630;
582 m_testVectors.Add(testVector);
583
584 testVector.m_distance = 50.0;
585 testVector.m_isLos = true;
586 testVector.m_frequency = 5.0e9;
587 testVector.m_pt = 0.0;
588 testVector.m_pr = -75.7750;
589 m_testVectors.Add(testVector);
590
591 testVector.m_distance = 100.0;
592 testVector.m_isLos = true;
593 testVector.m_frequency = 5.0e9;
594 testVector.m_pt = 0.0;
595 testVector.m_pr = -80.9802;
596 m_testVectors.Add(testVector);
597
598 testVector.m_distance = 1.0;
599 testVector.m_isLos = false;
600 testVector.m_frequency = 5.0e9;
601 testVector.m_pt = 0.0;
602 testVector.m_pr = -50.8072;
603 m_testVectors.Add(testVector);
604
605 testVector.m_distance = 10.0;
606 testVector.m_isLos = false;
607 testVector.m_frequency = 5.0e9;
608 testVector.m_pt = 0.0;
609 testVector.m_pr = -73.1894;
610 m_testVectors.Add(testVector);
611
612 testVector.m_distance = 50.0;
613 testVector.m_isLos = false;
614 testVector.m_frequency = 5.0e9;
615 testVector.m_pt = 0.0;
616 testVector.m_pr = -99.7824;
617 m_testVectors.Add(testVector);
618
619 testVector.m_distance = 100.0;
620 testVector.m_isLos = false;
621 testVector.m_frequency = 5.0e9;
622 testVector.m_pt = 0.0;
623 testVector.m_pr = -111.3062;
624 m_testVectors.Add(testVector);
625
626 // Create the nodes for BS and UT
628 nodes.Create(2);
629
630 // Create the mobility models
632 nodes.Get(0)->AggregateObject(a);
634 nodes.Get(1)->AggregateObject(b);
635
636 // Use a deterministic channel condition model
639
640 // Create the propagation loss model
643 lossModel->SetAttribute("ShadowingEnabled", BooleanValue(false)); // disable the shadow fading
644
645 for (std::size_t i = 0; i < m_testVectors.GetN(); i++)
646 {
647 TestVector testVector = m_testVectors.Get(i);
648
649 Vector posBs = Vector(0.0, 0.0, 3.0);
650 Vector posUt = Vector(testVector.m_distance, 0.0, 1.5);
651
652 // set the LOS or NLOS condition
653 if (testVector.m_isLos)
654 {
655 lossModel->SetChannelConditionModel(losCondModel);
656 }
657 else
658 {
659 lossModel->SetChannelConditionModel(nlosCondModel);
660 }
661
662 a->SetPosition(posBs);
663 b->SetPosition(posUt);
664
665 lossModel->SetAttribute("Frequency", DoubleValue(testVector.m_frequency));
666 NS_TEST_EXPECT_MSG_EQ_TOL(lossModel->CalcRxPower(testVector.m_pt, a, b),
667 testVector.m_pr,
669 "Got unexpected rcv power");
670 }
671
673}
674
675/**
676 * @ingroup propagation-tests
677 *
678 * Test case for the class ThreeGppV2vUrbanPropagationLossModel.
679 * It computes the pathloss between two nodes and compares it with the value
680 * obtained using the formula in 3GPP TR 37.885 Table 6.2.1-1 for v2v
681 * communications (sidelink).
682 *
683 * Note that 3GPP TR 37.885 defines 3 different channel states for vehicular
684 * environments: LOS, NLOS, and NLOSv, the latter representing the case in which
685 * the LOS path is blocked by other vehicles in the scenario. However, for
686 * computing the pathloss, only the two states are considered: LOS/NLOSv or NLOS
687 * (see TR 37.885 Section 6.2.1). In case of NLOSv, an additional vehicle
688 * blockage loss may be added, according to a log-normal random variable.
689 * Here, we test both conditions: LOS/NLOSv (without vehicle blockage
690 * loss) and NLOS.
691 */
693{
694 public:
695 /**
696 * Constructor
697 */
699
700 /**
701 * Destructor
702 */
704
705 private:
706 /**
707 * Build the simulation scenario and run the tests
708 */
709 void DoRun() override;
710
711 /**
712 * Struct containing the parameters for each test
713 */
715 {
716 double m_distance; //!< 2D distance between UT and BS in meters
717 bool m_isLos; //!< if true LOS/NLOSv, if false NLOS
718 double m_frequency; //!< carrier frequency in Hz
719 double m_pt; //!< transmitted power in dBm
720 double m_pr; //!< received power in dBm
721 };
722
723 TestVectors<TestVector> m_testVectors; //!< array containing all the test vectors
724 double m_tolerance; //!< tolerance
725};
726
728 : TestCase("Test for the ThreeGppV2vUrbanPropagationLossModel class."),
730 m_tolerance(5e-2)
731{
732}
733
737
738void
740{
741 TestVector testVector;
742
743 testVector.m_distance = 10.0;
744 testVector.m_isLos = true;
745 testVector.m_frequency = 5.0e9;
746 testVector.m_pt = 0.0;
747 testVector.m_pr = -68.1913;
748 m_testVectors.Add(testVector);
749
750 testVector.m_distance = 100.0;
751 testVector.m_isLos = true;
752 testVector.m_frequency = 5.0e9;
753 testVector.m_pt = 0.0;
754 testVector.m_pr = -84.8913;
755 m_testVectors.Add(testVector);
756
757 testVector.m_distance = 1000.0;
758 testVector.m_isLos = true;
759 testVector.m_frequency = 5.0e9;
760 testVector.m_pt = 0.0;
761 testVector.m_pr = -101.5913;
762 m_testVectors.Add(testVector);
763
764 testVector.m_distance = 10.0;
765 testVector.m_isLos = false;
766 testVector.m_frequency = 5.0e9;
767 testVector.m_pt = 0.0;
768 testVector.m_pr = -80.0605;
769 m_testVectors.Add(testVector);
770
771 testVector.m_distance = 100.0;
772 testVector.m_isLos = false;
773 testVector.m_frequency = 5.0e9;
774 testVector.m_pt = 0.0;
775 testVector.m_pr = -110.0605;
776 m_testVectors.Add(testVector);
777
778 testVector.m_distance = 1000.0;
779 testVector.m_isLos = false;
780 testVector.m_frequency = 5.0e9;
781 testVector.m_pt = 0.0;
782 testVector.m_pr = -140.0605;
783 m_testVectors.Add(testVector);
784
785 // Create the nodes for BS and UT
787 nodes.Create(2);
788
789 // Create the mobility models
791 nodes.Get(0)->AggregateObject(a);
793 nodes.Get(1)->AggregateObject(b);
794
795 // Use a deterministic channel condition model
798
799 // Create the propagation loss model
802 lossModel->SetAttribute("ShadowingEnabled", BooleanValue(false)); // disable the shadow fading
803
804 for (std::size_t i = 0; i < m_testVectors.GetN(); i++)
805 {
806 TestVector testVector = m_testVectors.Get(i);
807
808 Vector posUe1 = Vector(0.0, 0.0, 1.6);
809 Vector posUe2 = Vector(testVector.m_distance, 0.0, 1.6);
810
811 // set the LOS or NLOS condition
812 if (testVector.m_isLos)
813 {
814 lossModel->SetChannelConditionModel(losCondModel);
815 }
816 else
817 {
818 lossModel->SetChannelConditionModel(nlosCondModel);
819 }
820
821 a->SetPosition(posUe1);
822 b->SetPosition(posUe2);
823
824 lossModel->SetAttribute("Frequency", DoubleValue(testVector.m_frequency));
825 NS_TEST_EXPECT_MSG_EQ_TOL(lossModel->CalcRxPower(testVector.m_pt, a, b),
826 testVector.m_pr,
828 "Got unexpected rcv power");
829 }
830
832}
833
834/**
835 * @ingroup propagation-tests
836 *
837 * Test case for the class ThreeGppV2vHighwayPropagationLossModel.
838 * It computes the pathloss between two nodes and compares it with the value
839 * obtained using the formula in 3GPP TR 37.885 Table 6.2.1-1 for v2v
840 * communications (sidelink).
841 *
842 * Note that 3GPP TR 37.885 defines 3 different channel states for vehicular
843 * environments: LOS, NLOS and NLOSv, the latter representing the case in which
844 * the LOS path is blocked by other vehicles in the scenario. However, for
845 * computing the pathloss, only two states are considered: LOS/NLOSv or NLOS
846 * (see TR 37.885 Section 6.2.1). In case of NLOSv, an additional vehicle
847 * blockage loss may be added, according to a log-normal random variable.
848 * Here, we test both conditions: LOS/NLOSv (without vehicle blockage
849 * loss) and NLOS.
850 */
852{
853 public:
854 /**
855 * Constructor
856 */
858
859 /**
860 * Destructor
861 */
863
864 private:
865 /**
866 * Build the simulation scenario and run the tests
867 */
868 void DoRun() override;
869
870 /**
871 * Struct containing the parameters for each test
872 */
874 {
875 double m_distance; //!< 2D distance between UT and BS in meters
876 bool m_isLos; //!< if true LOS/NLOSv, if false NLOS
877 double m_frequency; //!< carrier frequency in Hz
878 double m_pt; //!< transmitted power in dBm
879 double m_pr; //!< received power in dBm
880 };
881
882 TestVectors<TestVector> m_testVectors; //!< array containing all the test vectors
883 double m_tolerance; //!< tolerance
884};
885
887 : TestCase("Test for the ThreeGppV2vHighwayPropagationLossModel"),
889 m_tolerance(5e-2)
890{
891}
892
896
897void
899{
900 TestVector testVector;
901
902 testVector.m_distance = 10.0;
903 testVector.m_isLos = true;
904 testVector.m_frequency = 5.0e9;
905 testVector.m_pt = 0.0;
906 testVector.m_pr = -66.3794;
907 m_testVectors.Add(testVector);
908
909 testVector.m_distance = 100.0;
910 testVector.m_isLos = true;
911 testVector.m_frequency = 5.0e9;
912 testVector.m_pt = 0.0;
913 testVector.m_pr = -86.3794;
914 m_testVectors.Add(testVector);
915
916 testVector.m_distance = 1000.0;
917 testVector.m_isLos = true;
918 testVector.m_frequency = 5.0e9;
919 testVector.m_pt = 0.0;
920 testVector.m_pr = -106.3794;
921 m_testVectors.Add(testVector);
922
923 testVector.m_distance = 10.0;
924 testVector.m_isLos = false;
925 testVector.m_frequency = 5.0e9;
926 testVector.m_pt = 0.0;
927 testVector.m_pr = -80.0605;
928 m_testVectors.Add(testVector);
929
930 testVector.m_distance = 100.0;
931 testVector.m_isLos = false;
932 testVector.m_frequency = 5.0e9;
933 testVector.m_pt = 0.0;
934 testVector.m_pr = -110.0605;
935 m_testVectors.Add(testVector);
936
937 testVector.m_distance = 1000.0;
938 testVector.m_isLos = false;
939 testVector.m_frequency = 5.0e9;
940 testVector.m_pt = 0.0;
941 testVector.m_pr = -140.0605;
942 m_testVectors.Add(testVector);
943
944 // Create the nodes for BS and UT
946 nodes.Create(2);
947
948 // Create the mobility models
950 nodes.Get(0)->AggregateObject(a);
952 nodes.Get(1)->AggregateObject(b);
953
954 // Use a deterministic channel condition model
957
958 // Create the propagation loss model
961 lossModel->SetAttribute("ShadowingEnabled", BooleanValue(false)); // disable the shadow fading
962
963 for (std::size_t i = 0; i < m_testVectors.GetN(); i++)
964 {
965 TestVector testVector = m_testVectors.Get(i);
966
967 Vector posUe1 = Vector(0.0, 0.0, 1.6);
968 Vector posUe2 = Vector(testVector.m_distance, 0.0, 1.6);
969
970 // set the LOS or NLOS condition
971 if (testVector.m_isLos)
972 {
973 lossModel->SetChannelConditionModel(losCondModel);
974 }
975 else
976 {
977 lossModel->SetChannelConditionModel(nlosCondModel);
978 }
979
980 a->SetPosition(posUe1);
981 b->SetPosition(posUe2);
982
983 lossModel->SetAttribute("Frequency", DoubleValue(testVector.m_frequency));
984 NS_TEST_EXPECT_MSG_EQ_TOL(lossModel->CalcRxPower(testVector.m_pt, a, b),
985 testVector.m_pr,
987 "Got unexpected rcv power");
988 }
989
991}
992
993/**
994 * @ingroup propagation-tests
995 *
996 * Test to check if the shadowing fading is correctly computed
997 */
999{
1000 public:
1002 ~ThreeGppShadowingTestCase() override;
1003
1004 private:
1005 void DoRun() override;
1006
1007 /**
1008 * Run the experiment
1009 * @param testNum the index of the experiment
1010 * @param propagationLossModelType the type id of the propagation loss model
1011 * to be used
1012 * @param hBs the BS height in meters
1013 * @param hUt the UT height in meters
1014 * @param distance the initial distance between the BS and the UT
1015 * @param shadowingEnabled true if shadowing must be enabled
1016 * @param frequency channel frequency
1017 */
1018 void RunTest(uint16_t testNum,
1019 std::string propagationLossModelType,
1020 double hBs,
1021 double hUt,
1022 double distance,
1023 bool shadowingEnabled,
1024 double frequency);
1025
1026 /**
1027 * Compute the propagation loss
1028 * @param a the first mobility model
1029 * @param b the second mobility model
1030 * @param testNum the index of the experiment
1031 */
1032 void EvaluateLoss(Ptr<MobilityModel> a, Ptr<MobilityModel> b, uint16_t testNum);
1033
1034 /**
1035 * Change the channel condition model
1036 * @param ccm the new ChannelConditionModel
1037 */
1039
1040 /**
1041 * Struct containing the parameters for each test
1042 */
1044 {
1045 std::string m_propagationLossModelType; //!< the propagation loss model type id
1046 double m_hBs; //!< the BS height in meters
1047 double m_hUt; //!< the UT height in meters
1048 double m_distance; //!< the initial 2D distance in meters between BS and UT in meters
1049 double m_shadowingStdLos; //!< the standard deviation of the shadowing component in the LOS
1050 //!< case in dB
1051 double m_shadowingStdNlos; //!< the standard deviation of the shadowing component in the
1052 //!< NLOS case in dB
1053 double m_frequency; //!< channel frequency
1054 };
1055
1056 TestVectors<TestVector> m_testVectors; //!< array containing all the test vectors
1057 Ptr<ThreeGppPropagationLossModel> m_lossModel; //!< the propagation loss model
1058 std::map<uint16_t /* index of experiment */, std::vector<double> /* loss in dB for each run */>
1059 m_results; //!< used to store the test results
1060};
1061
1063 : TestCase("Test to check if the shadow fading is correctly computed")
1064{
1065}
1066
1070
1071void
1074 uint16_t testNum)
1075{
1076 double loss = m_lossModel->CalcRxPower(0, a, b);
1077 m_results.at(testNum).push_back(loss);
1078}
1079
1080void
1085
1086void
1088 std::string propagationLossModelType,
1089 double hBs,
1090 double hUt,
1091 double distance,
1092 bool shadowingEnabled,
1093 double frequency)
1094{
1095 // Add a new entry for this test in the results map
1096 m_results[testNum] = std::vector<double>();
1097
1098 // Create the nodes for BS and UT
1100 nodes.Create(2);
1101
1102 // Create the mobility models
1104 a->SetPosition(Vector(0.0, 0.0, hBs));
1105 nodes.Get(0)->AggregateObject(a);
1106
1108 nodes.Get(1)->AggregateObject(b);
1109 b->SetPosition(Vector(0.0, distance, hUt));
1110 b->SetVelocity(Vector(1.0, 0.0, 0.0));
1111
1112 // Create the propagation loss model
1113 ObjectFactory propagationLossModelFactory = ObjectFactory(propagationLossModelType);
1114 m_lossModel = propagationLossModelFactory.Create<ThreeGppPropagationLossModel>();
1115 m_lossModel->SetAttribute("Frequency", DoubleValue(frequency));
1116 m_lossModel->SetAttribute("ShadowingEnabled",
1117 BooleanValue(shadowingEnabled)); // enable the shadow fading
1118 m_lossModel->AssignStreams(testNum);
1119
1120 // Set the channel condition to LOS
1122 m_lossModel->SetChannelConditionModel(losCondModel);
1123 // Schedule a transition to NLOS
1127 this,
1128 nlosCondModel);
1129
1130 // Schedule multiple calls to EvaluateLoss. Use both EvaluateLoss (a,b) and
1131 // EvaluateLoss (b,a) to check if the reciprocity holds.
1132 for (int i = 0; i < 200; i++)
1133 {
1134 if (i % 2 == 0)
1135 {
1138 this,
1139 a,
1140 b,
1141 testNum);
1142 }
1143 else
1144 {
1147 this,
1148 b,
1149 a,
1150 testNum);
1151 }
1152 }
1153
1156}
1157
1158void
1160{
1161 // The test scenario is composed of two nodes, one fixed
1162 // at position (0,0) and the other moving with constant velocity from
1163 // position (0,50) to position (200,50).
1164 // The channel condition changes from LOS to NLOS when the second node
1165 // reaches position (100,50).
1166 // Each experiment computes the propagation loss between the two nodes
1167 // every second, until the final position is reached, and saves the
1168 // results in an entry of the map m_results.
1169 // We run numSamples experiments and estimate the mean propagation loss in
1170 // each position by averaging among the samples.
1171 // Then, we perform the null hypothesis test with a significance level of
1172 // 0.05.
1173 // This procedure is repeated for all the 3GPP propagation scenarios, i.e.,
1174 // RMa, UMa, UMi and Indoor-Office.
1175
1176 TestVector testVector;
1177
1178 // Above 6GHz
1179 testVector.m_frequency = 6e9;
1180 testVector.m_propagationLossModelType = "ns3::ThreeGppRmaPropagationLossModel";
1181 testVector.m_hBs = 25;
1182 testVector.m_hUt = 1.6;
1183 testVector.m_distance = 100;
1184 testVector.m_shadowingStdLos = 4;
1185 testVector.m_shadowingStdNlos = 8;
1186 m_testVectors.Add(testVector);
1187
1188 testVector.m_frequency = 6e9;
1189 testVector.m_propagationLossModelType = "ns3::ThreeGppRmaPropagationLossModel";
1190 testVector.m_hBs = 25;
1191 testVector.m_hUt = 1.6;
1192 testVector.m_distance = 4000; // beyond the breakpoint distance
1193 testVector.m_shadowingStdLos = 6;
1194 testVector.m_shadowingStdNlos = 8;
1195 m_testVectors.Add(testVector);
1196
1197 testVector.m_frequency = 6e9;
1198 testVector.m_propagationLossModelType = "ns3::ThreeGppUmaPropagationLossModel";
1199 testVector.m_hBs = 25;
1200 testVector.m_hUt = 1.6;
1201 testVector.m_distance = 100;
1202 testVector.m_shadowingStdLos = 4;
1203 testVector.m_shadowingStdNlos = 6;
1204 m_testVectors.Add(testVector);
1205
1206 testVector.m_frequency = 6e9;
1207 testVector.m_propagationLossModelType = "ns3::ThreeGppUmiStreetCanyonPropagationLossModel";
1208 testVector.m_hBs = 10;
1209 testVector.m_hUt = 1.6;
1210 testVector.m_distance = 100;
1211 testVector.m_shadowingStdLos = 4;
1212 testVector.m_shadowingStdNlos = 7.82;
1213 m_testVectors.Add(testVector);
1214
1215 testVector.m_frequency = 6e9;
1216 testVector.m_propagationLossModelType = "ns3::ThreeGppIndoorOfficePropagationLossModel";
1217 testVector.m_hBs = 3;
1218 testVector.m_hUt = 1;
1219 testVector.m_distance = 50;
1220 testVector.m_shadowingStdLos = 3;
1221 testVector.m_shadowingStdNlos = 8.03;
1222 m_testVectors.Add(testVector);
1223
1224 testVector.m_frequency = 6e9;
1225 testVector.m_propagationLossModelType = "ns3::ThreeGppV2vUrbanPropagationLossModel";
1226 testVector.m_hBs = 1.6;
1227 testVector.m_hUt = 1.6;
1228 testVector.m_distance = 50;
1229 testVector.m_shadowingStdLos = 3;
1230 testVector.m_shadowingStdNlos = 4;
1231 m_testVectors.Add(testVector);
1232
1233 testVector.m_frequency = 6e9;
1234 testVector.m_propagationLossModelType = "ns3::ThreeGppV2vHighwayPropagationLossModel";
1235 testVector.m_hBs = 1.6;
1236 testVector.m_hUt = 1.6;
1237 testVector.m_distance = 50;
1238 testVector.m_shadowingStdLos = 3;
1239 testVector.m_shadowingStdNlos = 4;
1240 m_testVectors.Add(testVector);
1241
1242 // Sub 6GHz
1243 testVector.m_frequency = 3.5e9;
1244 testVector.m_propagationLossModelType = "ns3::ThreeGppUmaPropagationLossModel";
1245 testVector.m_hBs = 25;
1246 testVector.m_hUt = 1.6;
1247 testVector.m_distance = 100;
1248 testVector.m_shadowingStdLos = 7;
1249 testVector.m_shadowingStdNlos = 7;
1250 m_testVectors.Add(testVector);
1251
1252 testVector.m_frequency = 3.5e9;
1253 testVector.m_propagationLossModelType = "ns3::ThreeGppUmiStreetCanyonPropagationLossModel";
1254 testVector.m_hBs = 10;
1255 testVector.m_hUt = 1.6;
1256 testVector.m_distance = 100;
1257 testVector.m_shadowingStdLos = 7;
1258 testVector.m_shadowingStdNlos = 7;
1259 m_testVectors.Add(testVector);
1260
1261 uint16_t numSamples = 400;
1262
1263 for (std::size_t tvIndex = 0; tvIndex < m_testVectors.GetN(); tvIndex++)
1264 {
1265 TestVector tv = m_testVectors.Get(tvIndex);
1266
1267 // run the experiments.
1268 for (uint16_t sampleIndex = 0; sampleIndex < numSamples; sampleIndex++)
1269 {
1270 RunTest(sampleIndex,
1272 tv.m_hBs,
1273 tv.m_hUt,
1274 tv.m_distance,
1275 true,
1276 tv.m_frequency);
1277 }
1278
1279 // analyze the results
1280 std::vector<double> mean_vector; // the vector containing the mean propagation loss for
1281 // each position (sample mean)
1282
1283 uint16_t numPositions = m_results.at(0).size();
1284 for (uint16_t k = 0; k < numPositions; k++)
1285 {
1286 // compute the mean propagation loss in position k
1287 double mean = 0.0;
1288 for (auto resIt : m_results)
1289 {
1290 mean += resIt.second.at(k);
1291 }
1292 mean /= m_results.size();
1293 mean_vector.push_back(mean);
1294 }
1295
1296 // compute the true mean - just the pathloss, without the shadowing component
1297 RunTest(numSamples,
1299 tv.m_hBs,
1300 tv.m_hUt,
1301 tv.m_distance,
1302 false,
1303 tv.m_frequency);
1304 std::vector<double> true_mean =
1305 m_results.at(numSamples); // the result of the last test is the true mean
1306
1307 // perform the null hypothesis test for the LOS case
1308 // positions from (0, 50) to (99, 50) are LOS
1309 for (std::size_t i = 0; i < mean_vector.size() / 2; i++)
1310 {
1311 double z = (mean_vector.at(i) - true_mean.at(i)) /
1312 (tv.m_shadowingStdLos / std::sqrt(mean_vector.size() / 2));
1314 z,
1315 0.0,
1316 1.96,
1317 "Null hypothesis test (LOS case) for the shadowing component rejected");
1318 }
1319
1320 // perform the null hypothesis test for the NLOS case
1321 // positions from (100, 50) to (199, 50) are NLOS
1322 for (std::size_t i = mean_vector.size() / 2; i < mean_vector.size(); i++)
1323 {
1324 double z = (mean_vector.at(i) - true_mean.at(i)) /
1325 (tv.m_shadowingStdNlos / std::sqrt(mean_vector.size() / 2));
1327 z,
1328 0.0,
1329 1.96,
1330 "Null hypothesis test (NLOS case) for the shadowing component rejected");
1331 }
1332 }
1333}
1334
1335/**
1336 * @ingroup propagation-tests
1337 *
1338 * Test case for the inter-UE (drop-based) spatial consistency of TR 38.901
1339 * Sec. 7.6.3. With the InterUeSpatialConsistency attribute of the channel
1340 * condition model enabled, two co-located terminals served by the same site
1341 * sample the LOS/NLOS-state, indoor-state, building-type, shadow-fading and
1342 * O2I penetration random fields at the same position and must therefore
1343 * obtain the same channel condition and the same total loss, and a terminal
1344 * must obtain the same indoor state towards different sites. Without it, the
1345 * per-link draws are independent and co-located terminals obtain different
1346 * shadowing realizations. The terminals are created before the sites, so the
1347 * site of each link is only identified by its net device type, see the
1348 * SiteNetDeviceTypes attribute of ChannelConditionModel.
1349 */
1351{
1352 public:
1354
1355 private:
1356 void DoRun() override;
1357
1358 /**
1359 * Create a node with an aggregated constant-position mobility model.
1360 *
1361 * @param pos The node position.
1362 * @param site Whether to install the net device identifying a site.
1363 * @return The mobility model of the new node.
1364 */
1365 Ptr<MobilityModel> CreateNodeAt(const Vector& pos, bool site);
1366
1367 /// Result of ComputeColocatedLosses()
1369 {
1370 double loss1; ///< loss of the first terminal, in dB
1371 double loss2; ///< loss of the second terminal, in dB
1372 bool sameCondition; ///< whether the two terminals obtain the same channel condition
1373 bool sameIndoorStates; ///< whether the first terminal obtains the same indoor state
1374 ///< towards both sites
1375 };
1376
1377 /**
1378 * Compute the losses perceived by two co-located terminals.
1379 *
1380 * @param scenario Key of the scenario to test.
1381 * @param interUeSpatialConsistency Value for the InterUeSpatialConsistency attribute.
1382 * @param position The common terminal position.
1383 * @param frequency The centre frequency in Hz.
1384 * @param o2iThreshold Value for the O2iThreshold attribute.
1385 * @return The losses and the channel condition comparisons.
1386 */
1387 ColocatedLosses ComputeColocatedLosses(const std::string& scenario,
1388 bool interUeSpatialConsistency,
1389 const Vector& position,
1390 double frequency,
1391 double o2iThreshold);
1392};
1393
1395 : TestCase("Test that co-located terminals perceive the same loss with "
1396 "InterUeSpatialConsistency")
1397{
1398}
1399
1402{
1404 if (site)
1405 {
1407 node->AddDevice(dev);
1408 dev->SetNode(node);
1409 }
1411 mob->SetPosition(pos);
1412 node->AggregateObject(mob);
1413 return mob;
1414}
1415
1418 bool interUeSpatialConsistency,
1419 const Vector& position,
1420 double frequency,
1421 double o2iThreshold)
1422{
1423 double hBs;
1426 if (scenario == "RMa")
1427 {
1428 hBs = 35;
1431 }
1432 else if (scenario == "UMa")
1433 {
1434 hBs = 25;
1437 }
1438 else if (scenario == "UMi")
1439 {
1440 hBs = 10;
1443 }
1444 else
1445 {
1446 NS_ABORT_MSG_UNLESS(scenario == "InH", "Unknown scenario " << scenario);
1447 hBs = 3;
1450 }
1451
1452 lossModel->SetAttribute("Frequency", DoubleValue(frequency));
1453 lossModel->SetAttribute("ShadowingEnabled", BooleanValue(true));
1454 condModel->SetAttribute("InterUeSpatialConsistency", BooleanValue(interUeSpatialConsistency));
1455 condModel->SetAttribute("O2iThreshold", DoubleValue(o2iThreshold));
1456 condModel->SetAttribute("O2iLowLossThreshold", DoubleValue(0.5));
1457 condModel->SetAttribute("SiteNetDeviceTypes", StringValue("ns3::SimpleNetDevice"));
1458 lossModel->SetChannelConditionModel(condModel);
1459
1460 // The terminals get lower node ids than the sites.
1461 Ptr<MobilityModel> rx1 = CreateNodeAt(position, false);
1462 Ptr<MobilityModel> rx2 = CreateNodeAt(position, false);
1463 Ptr<MobilityModel> tx = CreateNodeAt(Vector(0.0, 0.0, hBs), true);
1464 Ptr<MobilityModel> tx2 = CreateNodeAt(Vector(-80.0, 50.0, hBs), true);
1465
1466 Ptr<ChannelCondition> cond1 = condModel->GetChannelCondition(tx, rx1);
1467 Ptr<ChannelCondition> cond2 = condModel->GetChannelCondition(tx, rx2);
1468 Ptr<ChannelCondition> cond1Site2 = condModel->GetChannelCondition(rx1, tx2);
1469 return {lossModel->CalcRxPower(0.0, tx, rx1),
1470 lossModel->CalcRxPower(0.0, rx2, tx),
1471 cond1->GetLosCondition() == cond2->GetLosCondition() &&
1472 cond1->GetO2iCondition() == cond2->GetO2iCondition() &&
1473 cond1->GetO2iLowHighCondition() == cond2->GetO2iLowHighCondition(),
1474 cond1->GetO2iCondition() == cond1Site2->GetO2iCondition()};
1475}
1476
1477void
1479{
1482
1483 const std::vector<Vector> positions{Vector(60.0, 0.0, 1.5),
1484 Vector(-35.0, 120.0, 1.5),
1485 Vector(200.0, -150.0, 1.5),
1486 Vector(90.0, 90.0, 1.5),
1487 Vector(-140.0, -30.0, 1.5)};
1488 for (const std::string scenario : {"RMa", "UMa", "UMi", "InH"})
1489 {
1490 // Below 6 GHz the single-frequency O2I model applies, above it the
1491 // low/high-loss one with a spatially consistent building type.
1492 for (double frequency : {3.5e9, 28e9})
1493 {
1494 for (double o2iThreshold : {0.0, 0.5, 1.0})
1495 {
1496 for (const Vector& pos : positions)
1497 {
1498 const auto r =
1499 ComputeColocatedLosses(scenario, true, pos, frequency, o2iThreshold);
1500 NS_TEST_ASSERT_MSG_EQ(r.sameCondition,
1501 true,
1502 "Co-located terminals must obtain the same channel "
1503 "condition with InterUeSpatialConsistency ("
1504 << scenario << ", O2iThreshold " << o2iThreshold
1505 << ")");
1506 NS_TEST_ASSERT_MSG_EQ(r.sameIndoorStates,
1507 true,
1508 "A terminal must obtain the same indoor state towards "
1509 "every site with InterUeSpatialConsistency ("
1510 << scenario << ", O2iThreshold " << o2iThreshold
1511 << ")");
1513 r.loss2,
1514 1e-9,
1515 "Co-located terminals must perceive the same loss "
1516 "with InterUeSpatialConsistency ("
1517 << scenario << ", " << frequency / 1e9
1518 << " GHz, O2iThreshold " << o2iThreshold << ")");
1519 }
1520 }
1521 }
1522
1523 // Without spatial consistency the shadowing draws are independent: at
1524 // least one co-located pair sharing the channel condition (so that
1525 // only the shadowing can differ) must differ.
1526 bool anyDifferent = false;
1527 for (const Vector& pos : positions)
1528 {
1529 const auto r = ComputeColocatedLosses(scenario, false, pos, 3.5e9, 0.0);
1530 anyDifferent |= r.sameCondition && std::abs(r.loss1 - r.loss2) > 0.1;
1531 }
1532 NS_TEST_ASSERT_MSG_EQ(anyDifferent,
1533 true,
1534 "Without InterUeSpatialConsistency, co-located terminals should "
1535 "draw independent shadowing realizations ("
1536 << scenario << ")");
1537 }
1538
1540}
1541
1542/**
1543 * @ingroup propagation-tests
1544 *
1545 * @brief 3GPP Propagation models TestSuite
1546 *
1547 * This TestSuite tests the following models:
1548 * - ThreeGppRmaPropagationLossModel
1549 * - ThreeGppUmaPropagationLossModel
1550 * - ThreeGppUmiPropagationLossModel
1551 * - ThreeGppIndoorOfficePropagationLossModel
1552 * - ThreeGppV2vUrbanPropagationLossModel
1553 * - ThreeGppV2vHighwayPropagationLossModel
1554 * - ThreeGppShadowing
1555 */
1561
1574
1575/// Static variable for test initialization
uint32_t r
Test case for the inter-UE (drop-based) spatial consistency of TR 38.901 Sec.
Ptr< MobilityModel > CreateNodeAt(const Vector &pos, bool site)
Create a node with an aggregated constant-position mobility model.
void DoRun() override
Implementation to actually run this TestCase.
ColocatedLosses ComputeColocatedLosses(const std::string &scenario, bool interUeSpatialConsistency, const Vector &position, double frequency, double o2iThreshold)
Compute the losses perceived by two co-located terminals.
Test case for the class ThreeGppIndoorOfficePropagationLossModel.
void DoRun() override
Build the simulation scenario and run the tests.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
Test case for the class ThreeGppRmaPropagationLossModel.
void DoRun() override
Build the simulation scenario and run the tests.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
Test to check if the shadowing fading is correctly computed.
void DoRun() override
Implementation to actually run this TestCase.
std::map< uint16_t, std::vector< double > > m_results
used to store the test results
void ChangeChannelCondition(Ptr< ChannelConditionModel > ccm)
Change the channel condition model.
Ptr< ThreeGppPropagationLossModel > m_lossModel
the propagation loss model
TestVectors< TestVector > m_testVectors
array containing all the test vectors
void RunTest(uint16_t testNum, std::string propagationLossModelType, double hBs, double hUt, double distance, bool shadowingEnabled, double frequency)
Run the experiment.
void EvaluateLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b, uint16_t testNum)
Compute the propagation loss.
Test case for the class ThreeGppUmaPropagationLossModel.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
void DoRun() override
Build the simulation scenario and run the tests.
Test case for the class ThreeGppUmiStreetCanyonPropagationLossModel.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
void DoRun() override
Build the simulation scenario and run the tests.
Test case for the class ThreeGppV2vHighwayPropagationLossModel.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
void DoRun() override
Build the simulation scenario and run the tests.
Test case for the class ThreeGppV2vUrbanPropagationLossModel.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
void DoRun() override
Build the simulation scenario and run the tests.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
keep track of a set of node pointers.
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
static void SetRun(uint64_t run)
Set the run number of simulation.
static void SetSeed(uint32_t seed)
Set the seed.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition simulator.h:580
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:125
static void Run()
Run the simulation.
Definition simulator.cc:161
Hold variables of type string.
Definition string.h:45
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition test.cc:296
@ QUICK
Fast test.
Definition test.h:1057
TestCase(const TestCase &)=delete
Caller graph was not generated because of its size.
Type
Type of test.
Definition test.h:1271
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
Definition test.cc:494
A simple way to store test vectors (for stimulus or from responses).
Definition test.h:1328
Base class for the 3GPP propagation models.
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
Definition abort.h:136
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:201
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:627
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Definition test.h:133
#define NS_TEST_EXPECT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report if ...
Definition test.h:499
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Definition test.h:326
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1313
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1330
NodeContainer nodes
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static PropagationLossModelsTestSuite g_propagationLossModelsTestSuite
Static variable for test initialization.
bool sameCondition
whether the two terminals obtain the same channel condition
bool sameIndoorStates
whether the first terminal obtains the same indoor state towards both sites
double m_distance
the initial 2D distance in meters between BS and UT in meters
std::string m_propagationLossModelType
the propagation loss model type id
double m_shadowingStdLos
the standard deviation of the shadowing component in the LOS case in dB
double m_shadowingStdNlos
the standard deviation of the shadowing component in the NLOS case in dB