A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
channel-condition-model.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
9
10#include "ns3/boolean.h"
11#include "ns3/double.h"
12#include "ns3/geocentric-constant-position-mobility-model.h"
13#include "ns3/log.h"
14#include "ns3/mobility-model.h"
15#include "ns3/node.h"
16#include "ns3/pointer.h"
17#include "ns3/simulator.h"
18#include "ns3/string.h"
19
20#include <cmath>
21
22namespace
23{
24
25/// NTN Dense Urban LOS probabilities from table 6.6.1-1 of 3GPP 38.811
26const std::map<int, double> DenseUrbanLOSProb{
27 {10, {28.2}},
28 {20, {33.1}},
29 {30, {39.8}},
30 {40, {46.8}},
31 {50, {53.7}},
32 {60, {61.2}},
33 {70, {73.8}},
34 {80, {82.0}},
35 {90, {98.1}},
36};
37
38/// NTN Urban LOS probabilities from table 6.6.1-1 of 3GPP 38.811
39const std::map<int, double> UrbanLOSProb{
40 {10, {24.6}},
41 {20, {38.6}},
42 {30, {49.3}},
43 {40, {61.3}},
44 {50, {72.6}},
45 {60, {80.5}},
46 {70, {91.9}},
47 {80, {96.8}},
48 {90, {99.2}},
49};
50
51/// NTN Suburban LOS probabilities from table 6.6.1-1 of 3GPP 38.811
52const std::map<int, double> SuburbanRuralLOSProb{
53 {10, {78.2}},
54 {20, {86.9}},
55 {30, {91.9}},
56 {40, {92.9}},
57 {50, {93.5}},
58 {60, {94.0}},
59 {70, {94.9}},
60 {80, {95.2}},
61 {90, {99.8}},
62};
63
64} // namespace
65
66namespace ns3
67{
68
69NS_LOG_COMPONENT_DEFINE("ChannelConditionModel");
70
71NS_OBJECT_ENSURE_REGISTERED(ChannelCondition);
72
73TypeId
75{
76 static TypeId tid =
77 TypeId("ns3::ChannelCondition").SetParent<Object>().SetGroupName("Propagation");
78 return tid;
79}
80
82 : m_losCondition(LosConditionValue::LC_ND),
83 m_o2iCondition(O2iConditionValue::O2I_ND),
84 m_o2iLowHighCondition(O2iLowHighConditionValue::LH_O2I_ND)
85{
86}
87
91{
92 m_losCondition = losCondition;
93 m_o2iCondition = o2iCondition;
94 m_o2iLowHighCondition = o2iLowHighCondition;
95}
96
100
106
107void
112
118
119void
121{
122 m_o2iCondition = o2iCondition;
123}
124
130
131void
133{
134 m_o2iLowHighCondition = o2iLowHighCondition;
135}
136
137bool
142
143bool
148
149bool
154
155bool
160
161bool
166
167bool
172
173bool
175{
176 return m_losCondition == losCondition && m_o2iCondition == o2iCondition;
177}
178
179std::ostream&
181{
183 {
184 os << "LOS";
185 }
187 {
188 os << "NLOS";
189 }
191 {
192 os << "NLOSv";
193 }
194
195 return os;
196}
197
198// ------------------------------------------------------------------------- //
199
201
202TypeId
204{
205 static TypeId tid =
206 TypeId("ns3::ChannelConditionModel").SetParent<Object>().SetGroupName("Propagation");
207 return tid;
208}
209
213
217
218// ------------------------------------------------------------------------- //
219
221
222TypeId
224{
225 static TypeId tid = TypeId("ns3::AlwaysLosChannelConditionModel")
226 .SetParent<Object>()
227 .SetGroupName("Propagation")
228 .AddConstructor<AlwaysLosChannelConditionModel>();
229 return tid;
230}
231
235
239
248
249int64_t
251{
252 return 0;
253}
254
255// ------------------------------------------------------------------------- //
256
258
259TypeId
261{
262 static TypeId tid = TypeId("ns3::NeverLosChannelConditionModel")
263 .SetParent<Object>()
264 .SetGroupName("Propagation")
265 .AddConstructor<NeverLosChannelConditionModel>();
266 return tid;
267}
268
272
276
285
286int64_t
288{
289 return 0;
290}
291
292// ------------------------------------------------------------------------- //
293
295
296TypeId
298{
299 static TypeId tid = TypeId("ns3::NeverLosVehicleChannelConditionModel")
301 .SetGroupName("Propagation")
302 .AddConstructor<NeverLosVehicleChannelConditionModel>();
303 return tid;
304}
305
309
313
322
323int64_t
325{
326 return 0;
327}
328
329// ------------------------------------------------------------------------- //
330
332
333TypeId
335{
336 static TypeId tid =
337 TypeId("ns3::ThreeGppChannelConditionModel")
339 .SetGroupName("Propagation")
340 .AddAttribute(
341 "UpdatePeriod",
342 "Specifies the time period after which the channel "
343 "condition is recomputed. If set to 0, the channel condition is never updated.",
347 .AddAttribute("O2iThreshold",
348 "Specifies what will be the ratio of O2I channel "
349 "conditions. Default value is 0 that corresponds to 0 O2I losses.",
350 DoubleValue(0.0),
353 .AddAttribute("O2iLowLossThreshold",
354 "Specifies what will be the ratio of O2I "
355 "low - high penetration losses. Default value is 1.0 meaning that"
356 "all losses will be low",
357 DoubleValue(1.0),
360 .AddAttribute("LinkO2iConditionToAntennaHeight",
361 "Specifies whether the O2I condition will "
362 "be determined based on the UE height, i.e. if the UE height is 1.5 then "
363 "it is O2O, "
364 "otherwise it is O2I.",
365 BooleanValue(false),
369 return tid;
370}
371
382
386
387void
393
397{
399
400 // get the key for this channel
401 uint32_t key = GetKey(a, b);
402
403 bool notFound = false; // indicates if the channel condition is not present in the map
404 bool update = false; // indicates if the channel condition has to be updated
405
406 // look for the channel condition in m_channelConditionMap
407 auto mapItem = m_channelConditionMap.find(key);
408 if (mapItem != m_channelConditionMap.end())
409 {
410 NS_LOG_DEBUG("found the channel condition in the map");
411 cond = mapItem->second.m_condition;
412
413 // check if it has to be updated
414 if (!m_updatePeriod.IsZero() &&
415 Simulator::Now() - mapItem->second.m_generatedTime > m_updatePeriod)
416 {
417 NS_LOG_DEBUG("it has to be updated");
418 update = true;
419 }
420 }
421 else
422 {
423 NS_LOG_DEBUG("channel condition not found");
424 notFound = true;
425 }
426
427 // if the channel condition was not found or if it has to be updated
428 // generate a new channel condition
429 if (notFound || update)
430 {
431 cond = ComputeChannelCondition(a, b);
432 // store the channel condition in m_channelConditionMap, used as cache.
433 // For this reason you see a const_cast.
434 Item mapItem;
435 mapItem.m_condition = cond;
437 const_cast<ThreeGppChannelConditionModel*>(this)->m_channelConditionMap[key] = mapItem;
438 }
439
440 return cond;
441}
442
446{
447 double o2iProb = m_uniformVarO2i->GetValue(0, 1);
448
450 {
451 if (std::min(a->GetPosition().z, b->GetPosition().z) == 1.5)
452 {
454 }
455 else
456 {
458 }
459 }
460 else
461 {
462 if (o2iProb < m_o2iThreshold)
463 {
464 NS_LOG_INFO("Return O2i condition ....");
466 }
467 else
468 {
469 NS_LOG_INFO("Return O2o condition ....");
471 }
472 }
473}
474
478{
479 NS_LOG_FUNCTION(this << a << b);
481
482 // compute the LOS probability
483 double pLos = ComputePlos(a, b);
484 double pNlos = ComputePnlos(a, b);
485
486 // draw a random value
487 double pRef = m_uniformVar->GetValue();
488
489 NS_LOG_DEBUG("pRef " << pRef << " pLos " << pLos << " pNlos " << pNlos);
490
491 // get the channel condition
492 if (pRef <= pLos)
493 {
494 // LOS
495 cond->SetLosCondition(ChannelCondition::LosConditionValue::LOS);
496 }
497 else if (pRef <= pLos + pNlos)
498 {
499 // NLOS
500 cond->SetLosCondition(ChannelCondition::LosConditionValue::NLOS);
501 }
502 else
503 {
504 // NLOSv (added to support vehicular scenarios)
505 cond->SetLosCondition(ChannelCondition::LosConditionValue::NLOSv);
506 }
507
508 cond->SetO2iCondition(ComputeO2i(a, b));
509
510 if (cond->GetO2iCondition() == ChannelCondition::O2iConditionValue::O2I)
511 {
512 // Since we have O2I penetration losses, we should choose based on the
513 // threshold if it will be low or high penetration losses
514 // (see TR38.901 Table 7.4.3)
515 double o2iLowHighLossProb = m_uniformO2iLowHighLossVar->GetValue(0, 1);
517
518 if (o2iLowHighLossProb < m_o2iLowLossThreshold)
519 {
521 }
522 else
523 {
525 }
526 cond->SetO2iLowHighCondition(lowHighLossCondition);
527 }
528
529 return cond;
530}
531
532double
535{
536 NS_LOG_FUNCTION(this << a << b);
537 // by default returns 1 - PLOS
538 return (1 - ComputePlos(a, b));
539}
540
541int64_t
543{
544 m_uniformVar->SetStream(stream);
545 m_uniformVarO2i->SetStream(stream + 1);
546 m_uniformO2iLowHighLossVar->SetStream(stream + 2);
547
548 return 3;
549}
550
551double
553{
554 double x = a.x - b.x;
555 double y = a.y - b.y;
556 double distance2D = sqrt(x * x + y * y);
557
558 return distance2D;
559}
560
563{
564 // use the nodes ids to obtain a unique key for the channel between a and b
565 // sort the nodes ids so that the key is reciprocal
566 uint32_t x1 = std::min(a->GetObject<Node>()->GetId(), b->GetObject<Node>()->GetId());
567 uint32_t x2 = std::max(a->GetObject<Node>()->GetId(), b->GetObject<Node>()->GetId());
568
569 // use the cantor function to obtain the key
570 uint32_t key = (((x1 + x2) * (x1 + x2 + 1)) / 2) + x2;
571
572 return key;
573}
574
575std::tuple<double, double>
578{
581
582 // check if aMob and bMob are of type GeocentricConstantPositionMobilityModel
583 auto aNTNMob = DynamicCast<GeocentricConstantPositionMobilityModel>(aMobNonConst);
584 auto bNTNMob = DynamicCast<GeocentricConstantPositionMobilityModel>(bMobNonConst);
585 NS_ASSERT_MSG(aNTNMob && bNTNMob,
586 "Mobility Models need to be of type Geocentric for NTN scenarios");
587
588 double elevAngle = aNTNMob->GetElevationAngle(bNTNMob);
589 // Round the elevation angle into a two-digits integer between 10 and 90, as specified in
590 // Sec. 6.6.1, 3GPP TR 38.811 v15.4.0
591 int elevAngleQuantized = (elevAngle < 10) ? 10 : round(elevAngle / 10) * 10;
592 NS_ASSERT_MSG((elevAngleQuantized >= 10) && (elevAngleQuantized <= 90),
593 "Invalid elevation angle!");
594
595 return std::make_tuple(elevAngle, elevAngleQuantized);
596}
597
598// ------------------------------------------------------------------------- //
599
601
602TypeId
604{
605 static TypeId tid = TypeId("ns3::ThreeGppRmaChannelConditionModel")
607 .SetGroupName("Propagation")
608 .AddConstructor<ThreeGppRmaChannelConditionModel>();
609 return tid;
610}
611
616
620
621double
624{
625 // compute the 2D distance between a and b
626 double distance2D = Calculate2dDistance(a->GetPosition(), b->GetPosition());
627
628 // NOTE: no indication is given about the heights of the BS and the UT used
629 // to derive the LOS probability
630
631 // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
632 double pLos = 0.0;
633 if (distance2D <= 10.0)
634 {
635 pLos = 1.0;
636 }
637 else
638 {
639 pLos = exp(-(distance2D - 10.0) / 1000.0);
640 }
641
642 return pLos;
643}
644
645// ------------------------------------------------------------------------- //
646
648
649TypeId
651{
652 static TypeId tid = TypeId("ns3::ThreeGppUmaChannelConditionModel")
654 .SetGroupName("Propagation")
655 .AddConstructor<ThreeGppUmaChannelConditionModel>();
656 return tid;
657}
658
663
667
668double
671{
672 // compute the 2D distance between a and b
673 double distance2D = Calculate2dDistance(a->GetPosition(), b->GetPosition());
674
675 // retrieve h_UT, it should be smaller than 23 m
676 double h_UT = std::min(a->GetPosition().z, b->GetPosition().z);
677 if (h_UT > 23.0)
678 {
680 "The height of the UT should be smaller than 23 m (see TR 38.901, Table 7.4.2-1)");
681 }
682
683 // retrieve h_BS, it should be equal to 25 m
684 double h_BS = std::max(a->GetPosition().z, b->GetPosition().z);
685 if (h_BS != 25.0)
686 {
687 NS_LOG_WARN("The LOS probability was derived assuming BS antenna heights of 25 m (see TR "
688 "38.901, Table 7.4.2-1)");
689 }
690
691 // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
692 double pLos = 0.0;
693 if (distance2D <= 18.0)
694 {
695 pLos = 1.0;
696 }
697 else
698 {
699 // compute C'(h_UT)
700 double c = 0.0;
701 if (h_UT <= 13.0)
702 {
703 c = 0;
704 }
705 else
706 {
707 c = pow((h_UT - 13.0) / 10.0, 1.5);
708 }
709
710 pLos = (18.0 / distance2D + exp(-distance2D / 63.0) * (1.0 - 18.0 / distance2D)) *
711 (1.0 + c * 5.0 / 4.0 * pow(distance2D / 100.0, 3.0) * exp(-distance2D / 150.0));
712 }
713
714 return pLos;
715}
716
717// ------------------------------------------------------------------------- //
718
720
721TypeId
723{
724 static TypeId tid = TypeId("ns3::ThreeGppUmiStreetCanyonChannelConditionModel")
726 .SetGroupName("Propagation")
728 return tid;
729}
730
735
739
740double
743{
744 // compute the 2D distance between a and b
745 double distance2D = Calculate2dDistance(a->GetPosition(), b->GetPosition());
746
747 // NOTE: no indication is given about the UT height used to derive the
748 // LOS probability
749
750 // h_BS should be equal to 10 m. We check if at least one of the two
751 // nodes has height equal to 10 m
752 if (a->GetPosition().z != 10.0 && b->GetPosition().z != 10.0)
753 {
754 NS_LOG_WARN("The LOS probability was derived assuming BS antenna heights of 10 m (see TR "
755 "38.901, Table 7.4.2-1)");
756 }
757
758 // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
759 double pLos = 0.0;
760 if (distance2D <= 18.0)
761 {
762 pLos = 1.0;
763 }
764 else
765 {
766 pLos = 18.0 / distance2D + exp(-distance2D / 36.0) * (1.0 - 18.0 / distance2D);
767 }
768
769 return pLos;
770}
771
772// ------------------------------------------------------------------------- //
773
775
776TypeId
778{
779 static TypeId tid = TypeId("ns3::ThreeGppIndoorMixedOfficeChannelConditionModel")
781 .SetGroupName("Propagation")
783 return tid;
784}
785
790
794
795double
798{
799 // compute the 2D distance between a and b
800 double distance2D = Calculate2dDistance(a->GetPosition(), b->GetPosition());
801
802 // NOTE: no indication is given about the UT height used to derive the
803 // LOS probability
804
805 // retrieve h_BS, it should be equal to 3 m
806 double h_BS = std::max(a->GetPosition().z, b->GetPosition().z);
807 if (h_BS != 3.0)
808 {
809 NS_LOG_WARN("The LOS probability was derived assuming BS antenna heights of 3 m (see TR "
810 "38.901, Table 7.4.2-1)");
811 }
812
813 // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
814 double pLos = 0.0;
815 if (distance2D <= 1.2)
816 {
817 pLos = 1.0;
818 }
819 else if (distance2D > 1.2 && distance2D < 6.5)
820 {
821 pLos = exp(-(distance2D - 1.2) / 4.7);
822 }
823 else
824 {
825 pLos = exp(-(distance2D - 6.5) / 32.6) * 0.32;
826 }
827
828 return pLos;
829}
830
831// ------------------------------------------------------------------------- //
832
834
835TypeId
837{
838 static TypeId tid = TypeId("ns3::ThreeGppIndoorOpenOfficeChannelConditionModel")
840 .SetGroupName("Propagation")
842 return tid;
843}
844
849
853
854double
857{
858 // compute the 2D distance between a and b
859 double distance2D = Calculate2dDistance(a->GetPosition(), b->GetPosition());
860
861 // NOTE: no indication is given about the UT height used to derive the
862 // LOS probability
863
864 // retrieve h_BS, it should be equal to 3 m
865 double h_BS = std::max(a->GetPosition().z, b->GetPosition().z);
866 if (h_BS != 3.0)
867 {
868 NS_LOG_WARN("The LOS probability was derived assuming BS antenna heights of 3 m (see TR "
869 "38.901, Table 7.4.2-1)");
870 }
871
872 // compute the LOS probability (see 3GPP TR 38.901, Sec. 7.4.2)
873 double pLos = 0.0;
874 if (distance2D <= 5.0)
875 {
876 pLos = 1.0;
877 }
878 else if (distance2D > 5.0 && distance2D <= 49.0)
879 {
880 pLos = exp(-(distance2D - 5.0) / 70.8);
881 }
882 else
883 {
884 pLos = exp(-(distance2D - 49.0) / 211.7) * 0.54;
885 }
886
887 return pLos;
888}
889
890// ------------------------------------------------------------------------- //
891
893
894TypeId
896{
897 static TypeId tid = TypeId("ns3::ThreeGppNTNDenseUrbanChannelConditionModel")
899 .SetGroupName("Propagation")
901 return tid;
902}
903
904double
907{
908 // Compute the LOS probability (see 3GPP TR 38.811, Table 6.6.1-1).
909 // The elevation angle is first quantized to one of the reference angles.
910 auto [elevAngle, quantizedElevAngle] = GetQuantizedElevationAngle(a, b);
911 return DenseUrbanLOSProb.at(quantizedElevAngle);
912}
913
914// ------------------------------------------------------------------------- //
915
917
918TypeId
920{
921 static TypeId tid = TypeId("ns3::ThreeGppNTNUrbanChannelConditionModel")
923 .SetGroupName("Propagation")
924 .AddConstructor<ThreeGppNTNUrbanChannelConditionModel>();
925 return tid;
926}
927
928double
931{
932 // Compute the LOS probability (see 3GPP TR 38.811, Table 6.6.1-1).
933 // The elevation angle is first quantized to one of the reference angles.
934 auto [elevAngle, quantizedElevAngle] = GetQuantizedElevationAngle(a, b);
935 return UrbanLOSProb.at(quantizedElevAngle);
936}
937
938// ------------------------------------------------------------------------- //
939
941
942TypeId
944{
945 static TypeId tid = TypeId("ns3::ThreeGppNTNSuburbanChannelConditionModel")
947 .SetGroupName("Propagation")
949 return tid;
950}
951
952double
955{
956 // Compute the LOS probability (see 3GPP TR 38.811, Table 6.6.1-1).
957 // The elevation angle is first quantized to one of the reference angles.
958 auto [elevAngle, quantizedElevAngle] = GetQuantizedElevationAngle(a, b);
959 return SuburbanRuralLOSProb.at(quantizedElevAngle);
960}
961
962// ------------------------------------------------------------------------- //
963
965
966TypeId
968{
969 static TypeId tid = TypeId("ns3::ThreeGppNTNRuralChannelConditionModel")
971 .SetGroupName("Propagation")
972 .AddConstructor<ThreeGppNTNRuralChannelConditionModel>();
973 return tid;
974}
975
976double
979{
980 // Compute the LOS probability (see 3GPP TR 38.811, Table 6.6.1-1).
981 // The elevation angle is first quantized to one of the reference angles.
982 auto [elevAngle, quantizedElevAngle] = GetQuantizedElevationAngle(a, b);
983 return SuburbanRuralLOSProb.at(quantizedElevAngle);
984}
985
986} // end namespace ns3
Models an always in-LoS condition model.
int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
static TypeId GetTypeId()
Get the type ID.
Ptr< ChannelCondition > GetChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Computes the condition of the channel between a and b, that will be always LoS.
AttributeValue implementation for Boolean.
Definition boolean.h:26
LosConditionValue m_losCondition
contains the information about the LOS state of the channel
O2iLowHighConditionValue m_o2iLowHighCondition
contains the information about the O2I low-high building penetration losses
bool IsO2i() const
Return true if the channel is outdoor-to-indoor.
ChannelCondition()
Constructor for the ChannelCondition class.
void SetLosCondition(LosConditionValue losCondition)
Set the LosConditionValue with the information about the LOS/NLOS state of the channel.
LosConditionValue GetLosCondition() const
Get the LosConditionValue containing the information about the LOS/NLOS state of the channel.
bool IsNlos() const
Return true if the channel condition is NLOS.
bool IsEqual(LosConditionValue losCondition, O2iConditionValue o2iCondition) const
Return true if this instance is equivalent to the one passed as argument.
O2iConditionValue m_o2iCondition
contains the information about the O2I state of the channel
bool IsNlosv() const
Return true if the channel condition is NLOSv.
bool IsLos() const
Return true if the channel condition is LOS.
void SetO2iCondition(O2iConditionValue o2iCondition)
Set the O2iConditionValue containing the information about the O2I state of the channel.
~ChannelCondition() override
Destructor for the ChannelCondition class.
O2iLowHighConditionValue GetO2iLowHighCondition() const
Get the O2iLowHighConditionValue containing the information about the O2I building penetration losses...
bool IsO2o() const
Return true if the channel is outdoor-to-outdoor.
bool IsI2i() const
Return true if the channel is indoor-to-indoor.
static TypeId GetTypeId()
Get the type ID.
O2iConditionValue
Possible values for Outdoor to Indoor condition.
O2iLowHighConditionValue
Possible values for Low-High Penetration Loss condition.
@ LOW
Low Penetration Losses.
@ HIGH
High Penetration Losses.
void SetO2iLowHighCondition(O2iLowHighConditionValue o2iLowHighCondition)
Set the O2iLowHighConditionValue containing the information about the O2I building penetration losses...
O2iConditionValue GetO2iCondition() const
Get the O2iConditionValue containing the information about the O2I state of the channel.
LosConditionValue
Possible values for Line-of-Sight condition.
@ NLOSv
Non Line of Sight due to a vehicle.
Models the channel condition.
static TypeId GetTypeId()
Get the type ID.
ChannelConditionModel()
Constructor for the ChannelConditionModel class.
~ChannelConditionModel() override
Destructor for the ChannelConditionModel class.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
Models a never in-LoS condition model.
static TypeId GetTypeId()
Get the type ID.
Ptr< ChannelCondition > GetChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Computes the condition of the channel between a and b, that will be always non-LoS.
int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
Models a never in-LoS condition model caused by a blocking vehicle.
int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
Ptr< ChannelCondition > GetChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Computes the condition of the channel between a and b, that will be always NLOSv.
A network Node.
Definition node.h:46
uint32_t GetId() const
Definition node.cc:106
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
Base class for the 3GPP channel condition models.
int64_t AssignStreams(int64_t stream) override
If this model uses objects of type RandomVariableStream, set the stream numbers to the integers start...
void DoDispose() override
Destructor implementation.
Ptr< UniformRandomVariable > m_uniformVarO2i
uniform random variable that is used for the generation of the O2i conditions
virtual ChannelCondition::O2iConditionValue ComputeO2i(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
Determines whether the channel condition is O2I or O2O.
static uint32_t GetKey(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b)
Returns a unique and reciprocal key for the channel between a and b.
Ptr< ChannelCondition > GetChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Retrieve the condition of the channel between a and b.
~ThreeGppChannelConditionModel() override
Destructor for the ThreeGppRmaChannelConditionModel class.
Ptr< UniformRandomVariable > m_uniformO2iLowHighLossVar
a uniform random variable for the calculation of the low/high losses, see TR38.901 Table 7....
double m_o2iLowLossThreshold
the threshold for determining what is the ratio of low - high O2I building penetration losses
static double Calculate2dDistance(const Vector &a, const Vector &b)
Computes the 2D distance between two 3D vectors.
virtual double ComputePnlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
Compute the NLOS probability.
double m_o2iThreshold
the threshold for determining what is the ratio of channels with O2I
virtual double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const =0
Compute the LOS probability.
std::unordered_map< uint32_t, Item > m_channelConditionMap
map to store the channel conditions
Ptr< UniformRandomVariable > m_uniformVar
uniform random variable
static std::tuple< double, double > GetQuantizedElevationAngle(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b)
Computes and quantizes the elevation angle to a two-digits integer in [10, 90].
ThreeGppChannelConditionModel()
Constructor for the ThreeGppRmaChannelConditionModel class.
Ptr< ChannelCondition > ComputeChannelCondition(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const
This method computes the channel condition based on a probabilistic model that is specific for the sc...
bool m_linkO2iConditionToAntennaHeight
the indicator that determines whether the O2I/O2O condition is determined based on the UE height
Time m_updatePeriod
the update period for the channel condition
static TypeId GetTypeId()
Get the type ID.
Computes the channel condition for the Indoor Mixed Office scenario.
ThreeGppIndoorMixedOfficeChannelConditionModel()
Constructor for the ThreeGppIndoorMixedOfficeChannelConditionModel class.
~ThreeGppIndoorMixedOfficeChannelConditionModel() override
Destructor for the ThreeGppIndoorMixedOfficeChannelConditionModel class.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901 for the Indoor Mixed Offi...
Computes the channel condition for the Indoor Open Office scenario.
ThreeGppIndoorOpenOfficeChannelConditionModel()
Constructor for the ThreeGppIndoorOpenOfficeChannelConditionModel class.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901 for the Indoor Open Offic...
~ThreeGppIndoorOpenOfficeChannelConditionModel() override
Destructor for the ThreeGppIndoorOpenOfficeChannelConditionModel class.
Computes the channel condition for the NTN Dense Urban Scenario.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability.
Computes the channel condition for the NTN Rural Scenario.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability.
Computes the channel condition for the NTN Suburban Scenario.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability.
Computes the channel condition for the NTN Urban Scenario.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability.
Computes the channel condition for the RMa scenario.
~ThreeGppRmaChannelConditionModel() override
Destructor for the ThreeGppRmaChannelConditionModel class.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901 for the RMa scenario.
ThreeGppRmaChannelConditionModel()
Constructor for the ThreeGppRmaChannelConditionModel class.
static TypeId GetTypeId()
Get the type ID.
Computes the channel condition for the UMa scenario.
static TypeId GetTypeId()
Get the type ID.
ThreeGppUmaChannelConditionModel()
Constructor for the ThreeGppUmaChannelConditionModel class.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901 for the UMa scenario.
~ThreeGppUmaChannelConditionModel() override
Destructor for the ThreeGppUmaChannelConditionModel class.
Computes the channel condition for the UMi-Street canyon scenario.
ThreeGppUmiStreetCanyonChannelConditionModel()
Constructor for the ThreeGppUmiStreetCanyonChannelConditionModel class.
~ThreeGppUmiStreetCanyonChannelConditionModel() override
Destructor for the ThreeGppUmiStreetCanyonChannelConditionModel class.
double ComputePlos(Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Compute the LOS probability as specified in Table 7.4.2-1 of 3GPP TR 38.901 for the UMi-Street Canyon...
bool IsZero() const
Exactly equivalent to t == 0.
Definition nstime.h:304
AttributeValue implementation for Time.
Definition nstime.h:1431
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition assert.h:75
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition boolean.cc:113
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition boolean.h:70
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 > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition nstime.h:1432
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Definition nstime.h:1452
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition log.h:257
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition log.h:250
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition log.h:264
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1344
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1356
const std::map< int, double > SuburbanRuralLOSProb
NTN Suburban LOS probabilities from table 6.6.1-1 of 3GPP 38.811.
const std::map< int, double > UrbanLOSProb
NTN Urban LOS probabilities from table 6.6.1-1 of 3GPP 38.811.
const std::map< int, double > DenseUrbanLOSProb
NTN Dense Urban LOS probabilities from table 6.6.1-1 of 3GPP 38.811.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition angles.cc:148
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:580
Ptr< T1 > ConstCast(const Ptr< T2 > &p)
Cast a Ptr.
Definition ptr.h:573
Struct to store the channel condition in the m_channelConditionMap.
Ptr< ChannelCondition > m_condition
the channel condition
Time m_generatedTime
the time when the condition was generated