12#include "ns3/boolean.h"
13#include "ns3/double.h"
14#include "ns3/geocentric-constant-position-mobility-model.h"
16#include "ns3/mobility-model.h"
18#include "ns3/pointer.h"
19#include "ns3/simulator.h"
43 {10, {3.5, 15.5, 34.3, 2.9, 17.1, 44.3}},
44 {20, {3.4, 13.9, 30.9, 2.4, 17.1, 39.9}},
45 {30, {2.9, 12.4, 29.0, 2.7, 15.6, 37.5}},
46 {40, {3.0, 11.7, 27.7, 2.4, 14.6, 35.8}},
47 {50, {3.1, 10.6, 26.8, 2.4, 14.2, 34.6}},
48 {60, {2.7, 10.5, 26.2, 2.7, 12.6, 33.8}},
49 {70, {2.5, 10.1, 25.8, 2.6, 12.1, 33.3}},
50 {80, {2.3, 9.2, 25.5, 2.8, 12.3, 33.0}},
51 {90, {1.2, 9.2, 25.5, 0.6, 12.3, 32.9}},
59 {10, {4, 6, 34.3, 4, 6, 44.3}},
60 {20, {4, 6, 30.9, 4, 6, 39.9}},
61 {30, {4, 6, 29.0, 4, 6, 37.5}},
62 {40, {4, 6, 27.7, 4, 6, 35.8}},
63 {50, {4, 6, 26.8, 4, 6, 34.6}},
64 {60, {4, 6, 26.2, 4, 6, 33.8}},
65 {70, {4, 6, 25.8, 4, 6, 33.3}},
66 {80, {4, 6, 25.5, 4, 6, 33.0}},
67 {90, {4, 6, 25.5, 4, 6, 32.9}},
75 {10, {1.79, 8.93, 19.52, 1.9, 10.7, 29.5}},
76 {20, {1.14, 9.08, 18.17, 1.6, 10.0, 24.6}},
77 {30, {1.14, 8.78, 18.42, 1.9, 11.2, 21.9}},
78 {40, {0.92, 10.25, 18.28, 2.3, 11.6, 20.0}},
79 {50, {1.42, 10.56, 18.63, 2.7, 11.8, 18.7}},
80 {60, {1.56, 10.74, 17.68, 3.1, 10.8, 17.8}},
81 {70, {0.85, 10.17, 16.5, 3.0, 10.8, 17.2}},
82 {80, {0.72, 11.52, 16.3, 3.6, 10.8, 16.9}},
83 {90, {0.72, 11.52, 16.3, 0.4, 10.8, 16.8}},
94 0, 0.0300, 0.0350, 0.0380, 0.0390, 0.0410, 0.0420, 0.0450, 0.0480, 0.0500,
95 0.0530, 0.0587, 0.0674, 0.0789, 0.0935, 0.1113, 0.1322, 0.1565, 0.1841, 0.2153,
96 0.2500, 0.3362, 0.4581, 0.5200, 0.5200, 0.5000, 0.4500, 0.3850, 0.3200, 0.2700,
97 0.2500, 0.2517, 0.2568, 0.2651, 0.2765, 0.2907, 0.3077, 0.3273, 0.3493, 0.3736,
98 0.4000, 0.4375, 0.4966, 0.5795, 0.6881, 0.8247, 0.9912, 1.1900, 1.4229, 1.6922,
99 2.0000, 4.2654, 10.1504, 19.2717, 31.2457, 45.6890, 62.2182, 80.4496, 100.0000, 140.0205,
100 170.0000, 100.0000, 78.1682, 59.3955, 43.5434, 30.4733, 20.0465, 12.1244, 6.5683, 3.2397,
101 2.0000, 1.7708, 1.5660, 1.3858, 1.2298, 1.0981, 0.9905, 0.9070, 0.8475, 0.8119,
102 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000, 0.8000,
103 0.8000, 0.8029, 0.8112, 0.8243, 0.8416, 0.8625, 0.8864, 0.9127, 0.9408, 0.9701,
132std::tuple<double, double, double, double>
136 auto aPos = a->GetPosition();
137 auto bPos = b->GetPosition();
140 double hBs = std::max(aPos.z, bPos.z);
141 double hUt = std::min(aPos.z, bPos.z);
142 return std::make_tuple(distance2D, distance3D, hBs, hUt);
153std::tuple<double, double>
156 double hBs = (heightA == 10) ? heightA : heightB;
157 double hUt = (heightA == 10) ? heightB : heightA;
158 return std::make_tuple(hBs, hUt);
173 return 32.45 + 20 * log10(freq / 1e9) + 20 * log10(dist3d);
189 if ((elevAngle < 10 && freq > 1e9) || freq >= 10e9)
191 int roundedFreq = round(freq / 10e8);
214 loss = 6.22 / (pow(freq / 1e9, 1.5));
237 const std::map<
int, std::vector<float>>* sfcl,
238 double elevAngleQuantized)
255constexpr double M_C = 3.0e8;
270 TypeId(
"ns3::ThreeGppPropagationLossModel")
272 .SetGroupName(
"Propagation")
273 .AddAttribute(
"Frequency",
274 "The centre frequency in Hz.",
279 .AddAttribute(
"ShadowingEnabled",
280 "Enable/disable shadowing.",
285 "ChannelConditionModel",
286 "Pointer to the channel condition model.",
291 .AddAttribute(
"EnforceParameterRanges",
292 "Whether to strictly enforce TR38.901 applicability ranges",
297 "BuildingPenetrationLossesEnabled",
298 "Enable/disable Building Penetration Losses.",
359 "Frequency should be between 0.5 and 100 GHz but is " << f);
390 double rxPow = txPowerDbm;
425 switch (cond->GetLosCondition())
451 double o2iLossValue = 0;
452 double lowLossTw = 0;
454 double lowlossNormalVariate = 0;
456 double lConcrete = 0;
461 bool notFound =
false;
462 bool newCondition =
false;
469 newCondition = (it->second.m_condition != cond);
476 it =
m_o2iLossMap.insert(it, std::make_pair(key, newItem));
479 if (notFound || newCondition)
491 5 - 10 * log10(0.3 * std::pow(10, -lGlass / 10) + 0.7 * std::pow(10, -lConcrete / 10));
494 lossIn = 0.5 * distance2dIn;
499 o2iLossValue = lowLossTw + lossIn + lowlossNormalVariate;
503 o2iLossValue = it->second.m_o2iLoss;
507 it->second.m_o2iLoss = o2iLossValue;
508 it->second.m_condition = cond;
521 double o2iLossValue = 0;
522 double highLossTw = 0;
524 double highlossNormalVariate = 0;
525 double lIIRGlass = 0;
526 double lConcrete = 0;
531 bool notFound =
false;
532 bool newCondition =
false;
539 newCondition = (it->second.m_condition != cond);
546 it =
m_o2iLossMap.insert(it, std::make_pair(key, newItem));
549 if (notFound || newCondition)
562 highLossTw = 5 - 10 * log10(0.7 * std::pow(10, -lIIRGlass / 10) +
563 0.3 * std::pow(10, -lConcrete / 10));
566 lossIn = 0.5 * distance2dIn;
571 o2iLossValue = highLossTw + lossIn + highlossNormalVariate;
575 o2iLossValue = it->second.m_o2iLoss;
579 it->second.m_o2iLoss = o2iLossValue;
580 it->second.m_condition = cond;
598 NS_ABORT_MSG(
"If we have set the O2I condition, we shouldn't be here");
617 double shadowingValue;
622 bool notFound =
false;
623 bool newCondition =
false;
631 newCondition = (it->second.m_condition != cond);
642 if (notFound || newCondition)
650 Vector2D displacement(newDistance.x - it->second.m_distance.x,
651 newDistance.y - it->second.m_distance.y);
653 shadowingValue = R * it->second.m_shadowing + sqrt(1 - R * R) *
659 it->second.m_shadowing = shadowingValue;
660 it->second.m_distance = newDistance;
662 it->second.m_condition = cond;
664 return shadowingValue;
684 double x = a.x - b.x;
685 double y = a.y - b.y;
686 double distance2D = sqrt(x * x + y * y);
700 uint32_t key = (((x1 + x2) * (x1 + x2 + 1)) / 2) + x2;
713 return b->GetPosition() - a->GetPosition();
717 return a->GetPosition() - b->GetPosition();
728 static TypeId tid =
TypeId(
"ns3::ThreeGppRmaPropagationLossModel")
730 .SetGroupName(
"Propagation")
732 .AddAttribute(
"AvgBuildingHeight",
733 "The average building height in meters.",
737 .AddAttribute(
"AvgStreetWidth",
738 "The average street width in meters.",
769 [[maybe_unused]])
const
781 "RMa scenario is valid for frequencies between 0.5 and 30 GHz.");
783 auto [distance2D, distance3D, hBs, hUt] = GetBsUtDistancesAndHeights(a, b);
786 if (hUt < 1.0 || hUt > 10.0)
790 "The height of the UT should be between 1 and 10 m (see TR 38.901, Table 7.4.1-1)");
793 if (hBs < 10.0 || hBs > 150.0)
797 "The height of the BS should be between 10 and 150 m (see TR 38.901, Table 7.4.1-1)");
811 "Breakpoint distance is zero (divide-by-zero below); are either hBs or hUt = 0?");
814 if (distance2D < 10.0 || distance2D > 10.0e3)
817 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
823 if (distance2D <= distanceBp)
844 "RMa scenario is valid for frequencies between 0.5 and 30 GHz.");
846 auto [distance2D, distance3D, hBs, hUt] = GetBsUtDistancesAndHeights(a, b);
849 if (hUt < 1.0 || hUt > 10.0)
853 "The height of the UT should be between 1 and 10 m (see TR 38.901, Table 7.4.1-1)");
856 if (hBs < 10.0 || hBs > 150.0)
860 "The height of the BS should be between 10 and 150 m (see TR 38.901, Table 7.4.1-1)");
871 if (distance2D < 10.0 || distance2D > 5.0e3)
874 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
879 double plNlos = 161.04 - 7.1 * log10(
m_w) + 7.5 * log10(
m_h) -
880 (24.37 - 3.7 * pow((
m_h / hBs), 2)) * log10(hBs) +
881 (43.42 - 3.1 * log10(hBs)) * (log10(distance3D) - 3.0) +
882 20.0 * log10(
m_frequency / 1e9) - (3.2 * pow(log10(11.75 * hUt), 2) - 4.97);
884 double loss = std::max(
GetLossLos(a, b), plNlos);
907 if (distance2d <= distanceBp)
933 double correlationDistance;
938 correlationDistance = 37;
942 correlationDistance = 120;
949 return correlationDistance;
955 double loss = 20.0 * log10(40.0 * M_PI * distance3D * frequency / 1e9 / 3.0) +
956 std::min(0.03 * pow(h, 1.72), 10.0) * log10(distance3D) -
957 std::min(0.044 * pow(h, 1.72), 14.77) + 0.002 * log10(h) * distance3D;
964 double distanceBp = 2.0 * M_PI * hA * hB * frequency / M_C;
975 static TypeId tid =
TypeId(
"ns3::ThreeGppUmaPropagationLossModel")
977 .SetGroupName(
"Propagation")
1003 if (distance2D > 18.0)
1005 g = 5.0 / 4.0 * pow(distance2D / 100.0, 3) * exp(-distance2D / 150.0);
1012 c = pow((hUt - 13.0) / 10.0, 1.5) * g;
1016 double prob = 1.0 / (1.0 + c);
1024 int random =
m_uniformVar->GetInteger(12, std::max(12, (
int)(hUt - 1.5)));
1025 hE = (
double)floor(random / 3.0) * 3.0;
1029 double distanceBp = 4 * (hBs - hE) * (hUt - hE) *
m_frequency / M_C;
1039 auto [distance2D, distance3D, hBs, hUt] = GetBsUtDistancesAndHeights(a, b);
1042 if (hUt < 1.5 || hUt > 22.5)
1046 "The height of the UT should be between 1.5 and 22.5 m (see TR 38.901, Table 7.4.1-1)");
1052 NS_LOG_WARN(
"The height of the BS should be equal to 25 m (see TR 38.901, Table 7.4.1-1)");
1067 if (distance2D < 10.0 || distance2D > 5.0e3)
1070 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1076 if (distance2D <= distanceBp)
1079 loss = 28.0 + 22.0 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9);
1084 loss = 28.0 + 40.0 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9) -
1085 9.0 * log10(pow(distanceBp, 2) + pow(hBs - hUt, 2));
1106 auto [distance2D, distance3D, hBs, hUt] = GetBsUtDistancesAndHeights(a, b);
1109 if (hUt < 1.5 || hUt > 22.5)
1113 "The height of the UT should be between 1.5 and 22.5 m (see TR 38.901, Table 7.4.1-1)");
1119 NS_LOG_WARN(
"The height of the BS should be equal to 25 m (see TR 38.901, Table 7.4.1-1)");
1130 if (distance2D < 10.0 || distance2D > 5.0e3)
1133 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1139 13.54 + 39.08 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9) - 0.6 * (hUt - 1.5);
1140 double loss = std::max(
GetLossLos(a, b), plNlos);
1152 double shadowingStd;
1167 return shadowingStd;
1175 double correlationDistance;
1180 correlationDistance = 37;
1184 correlationDistance = 50;
1191 return correlationDistance;
1211 static TypeId tid =
TypeId(
"ns3::ThreeGppUmiStreetCanyonPropagationLossModel")
1213 .SetGroupName(
"Propagation")
1243 double distanceBp = 4 * (hBs - hE) * (hUt - hE) *
m_frequency / M_C;
1264 auto [hBs, hUt] = GetBsUtHeightsUmiStreetCanyon(a->GetPosition().z, b->GetPosition().z);
1267 if (hUt < 1.5 || hUt >= 10.0)
1271 "The height of the UT should be between 1.5 and 22.5 m (see TR 38.901, Table 7.4.1-1). "
1272 "We further assume hUT < hBS, then hUT is upper bounded by hBS, which should be 10 m");
1278 NS_LOG_WARN(
"The height of the BS should be equal to 10 m (see TR 38.901, Table 7.4.1-1)");
1293 if (distance2D < 10.0 || distance2D > 5.0e3)
1296 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1302 if (distance2D <= distanceBp)
1305 loss = 32.4 + 21.0 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9);
1310 loss = 32.4 + 40.0 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9) -
1311 9.5 * log10(pow(distanceBp, 2) + pow(hBs - hUt, 2));
1327 auto [hBs, hUt] = GetBsUtHeightsUmiStreetCanyon(a->GetPosition().z, b->GetPosition().z);
1330 if (hUt < 1.5 || hUt >= 10.0)
1334 "The height of the UT should be between 1.5 and 22.5 m (see TR 38.901, Table 7.4.1-1). "
1335 "We further assume hUT < hBS, then hUT is upper bounded by hBS, which should be 10 m");
1341 NS_LOG_WARN(
"The height of the BS should be equal to 10 m (see TR 38.901, Table 7.4.1-1)");
1352 if (distance2D < 10.0 || distance2D > 5.0e3)
1355 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1361 22.4 + 35.3 * log10(distance3D) + 21.3 * log10(
m_frequency / 1e9) - 0.3 * (hUt - 1.5);
1362 double loss = std::max(
GetLossLos(a, b), plNlos);
1375 double shadowingStd;
1383 shadowingStd = 7.82;
1390 return shadowingStd;
1398 double correlationDistance;
1403 correlationDistance = 10;
1407 correlationDistance = 13;
1414 return correlationDistance;
1424 static TypeId tid =
TypeId(
"ns3::ThreeGppIndoorOfficePropagationLossModel")
1426 .SetGroupName(
"Propagation")
1460 if (distance3D < 1.0 || distance3D > 150.0)
1463 NS_LOG_WARN(
"The 3D distance is outside the validity range, the pathloss value may not be "
1468 double loss = 32.4 + 17.3 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9);
1484 if (distance3D < 1.0 || distance3D > 150.0)
1487 NS_LOG_WARN(
"The 3D distance is outside the validity range, the pathloss value may not be "
1492 double plNlos = 17.3 + 38.3 * log10(distance3D) + 24.9 * log10(
m_frequency / 1e9);
1493 double loss = std::max(
GetLossLos(a, b), plNlos);
1507 double shadowingStd;
1515 shadowingStd = 8.03;
1522 return shadowingStd;
1532 double correlationDistance;
1536 correlationDistance = 10;
1540 correlationDistance = 6;
1547 return correlationDistance;
1555 static TypeId tid =
TypeId(
"ns3::ThreeGppNTNDenseUrbanPropagationLossModel")
1557 .SetGroupName(
"Propagation")
1564 m_SFCL_DenseUrban(&SFCL_DenseUrban)
1587 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1590 auto [elevAngle, elevAngleQuantized] =
1594 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1597 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1600 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1612 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1615 auto [elevAngle, elevAngleQuantized] =
1619 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1625 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1628 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1641 double shadowingStd;
1643 std::string freqBand = (
m_frequency < 13.0e9) ?
"S" :
"Ka";
1644 auto [elevAngle, elevAngleQuantized] =
1669 return shadowingStd;
1677 double correlationDistance;
1682 correlationDistance = 37;
1686 correlationDistance = 50;
1693 return correlationDistance;
1703 static TypeId tid =
TypeId(
"ns3::ThreeGppNTNUrbanPropagationLossModel")
1705 .SetGroupName(
"Propagation")
1712 m_SFCL_Urban(&SFCL_Urban)
1734 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1737 auto [elevAngle, elevAngleQuantized] =
1741 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1744 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1747 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1758 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1761 auto [elevAngle, elevAngleQuantized] =
1765 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1771 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1774 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1787 double shadowingStd;
1789 std::string freqBand = (
m_frequency < 13.0e9) ?
"S" :
"Ka";
1790 auto [elevAngle, elevAngleQuantized] =
1815 return shadowingStd;
1823 double correlationDistance;
1828 correlationDistance = 37;
1832 correlationDistance = 50;
1839 return correlationDistance;
1849 static TypeId tid =
TypeId(
"ns3::ThreeGppNTNSuburbanPropagationLossModel")
1851 .SetGroupName(
"Propagation")
1858 m_SFCL_SuburbanRural(&SFCL_SuburbanRural)
1881 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1884 auto [elevAngle, elevAngleQuantized] =
1888 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1891 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1894 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1907 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1910 auto [elevAngle, elevAngleQuantized] =
1914 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1920 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1923 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1936 double shadowingStd;
1938 std::string freqBand = (
m_frequency < 13.0e9) ?
"S" :
"Ka";
1939 auto [elevAngle, elevAngleQuantized] =
1964 return shadowingStd;
1972 double correlationDistance;
1977 correlationDistance = 37;
1981 correlationDistance = 50;
1988 return correlationDistance;
1998 static TypeId tid =
TypeId(
"ns3::ThreeGppNTNRuralPropagationLossModel")
2000 .SetGroupName(
"Propagation")
2007 m_SFCL_SuburbanRural(&SFCL_SuburbanRural)
2029 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
2032 auto [elevAngle, elevAngleQuantized] =
2036 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
2039 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
2042 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
2053 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
2056 auto [elevAngle, elevAngleQuantized] =
2060 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
2066 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
2069 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
2082 double shadowingStd;
2084 std::string freqBand = (
m_frequency < 13.0e9) ?
"S" :
"Ka";
2085 auto [elevAngle, elevAngleQuantized] =
2110 return shadowingStd;
2118 double correlationDistance;
2123 correlationDistance = 37;
2127 correlationDistance = 120;
2134 return correlationDistance;
@ LOW
Low Penetration Losses.
@ HIGH
High Penetration Losses.
LosConditionValue
Possible values for Line-of-Sight condition.
@ NLOSv
Non Line of Sight due to a vehicle.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
AttributeValue implementation for Pointer.
Models the propagation loss through a transmission medium.
Smart pointer class similar to boost::intrusive_ptr.
static double Calculate2dDistance(const Vector &a, const Vector &b)
Computes the 2D distance between two 3D vectors.
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].
Implements the pathloss model defined in 3GPP TR 38.901, Table 7.4.1-1 for the Indoor Office scenario...
static TypeId GetTypeId()
Get the type ID.
double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
double GetO2iDistance2dIn() const override
Returns the minimum of the two independently generated distances according to the uniform distributio...
double GetLossNlos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is obstructed.
~ThreeGppIndoorOfficePropagationLossModel() override
Destructor.
ThreeGppIndoorOfficePropagationLossModel()
Constructor.
double GetLossLos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
Implements the pathloss model defined in 3GPP TR 38.811, Table ???? for the NTN Dense Urban scenario.
~ThreeGppNTNDenseUrbanPropagationLossModel() override
Destructor.
double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
double GetO2iDistance2dIn() const override
Returns the minimum of the two independently generated distances according to the uniform distributio...
double GetLossLos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
const std::map< int, std::vector< float > > * m_SFCL_DenseUrban
The nested map containing the Shadow Fading and Clutter Loss values for the NTN Dense Urban scenario.
static TypeId GetTypeId()
Get the type ID.
double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
double GetLossNlos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is obstructed.
ThreeGppNTNDenseUrbanPropagationLossModel()
Constructor.
Implements the pathloss model defined in 3GPP TR 38.811, Table ???? for the NTN Rural scenario.
const std::map< int, std::vector< float > > * m_SFCL_SuburbanRural
The nested map containing the Shadow Fading and Clutter Loss values for the NTN Suburban and Rural sc...
double GetO2iDistance2dIn() const override
Returns the minimum of the two independently generated distances according to the uniform distributio...
static TypeId GetTypeId()
Get the type ID.
ThreeGppNTNRuralPropagationLossModel()
Constructor.
double GetLossNlos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is obstructed.
double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
~ThreeGppNTNRuralPropagationLossModel() override
Destructor.
double GetLossLos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
Implements the pathloss model defined in 3GPP TR 38.811, Table ???? for the NTN Suburban scenario.
ThreeGppNTNSuburbanPropagationLossModel()
Constructor.
double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
const std::map< int, std::vector< float > > * m_SFCL_SuburbanRural
The nested map containing the Shadow Fading and Clutter Loss values for the NTN Suburban and Rural sc...
static TypeId GetTypeId()
Get the type ID.
double GetO2iDistance2dIn() const override
Returns the minimum of the two independently generated distances according to the uniform distributio...
double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
double GetLossLos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
~ThreeGppNTNSuburbanPropagationLossModel() override
Destructor.
double GetLossNlos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is obstructed.
Implements the pathloss model defined in 3GPP TR 38.811, Table ???? for the NTN Urban scenario.
ThreeGppNTNUrbanPropagationLossModel()
Constructor.
double GetLossNlos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is obstructed.
const std::map< int, std::vector< float > > * m_SFCL_Urban
The nested map containing the Shadow Fading and Clutter Loss values for the NTN Urban scenario.
static TypeId GetTypeId()
Get the type ID.
double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
double GetLossLos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
~ThreeGppNTNUrbanPropagationLossModel() override
Destructor.
double GetO2iDistance2dIn() const override
Returns the minimum of the two independently generated distances according to the uniform distributio...
double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
Base class for the 3GPP propagation models.
Ptr< ChannelConditionModel > GetChannelConditionModel() const
Returns the associated channel condition model.
virtual double GetO2iLowPenetrationLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const
Retrieves the o2i building penetration loss value by looking at m_o2iLossMap.
Ptr< UniformRandomVariable > m_randomO2iVar2
a uniform random variable for the calculation of the indoor loss, see TR38.901 Table 7....
double GetFrequency() const
Return the current central frequency.
double GetLoss(Ptr< ChannelCondition > cond, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Computes the pathloss between a and b.
Ptr< UniformRandomVariable > m_randomO2iVar1
a uniform random variable for the calculation of the indoor loss, see TR38.901 Table 7....
double GetShadowing(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const
Retrieves the shadowing value by looking at m_shadowingMap.
static double Calculate2dDistance(Vector a, Vector b)
Computes the 2D distance between two 3D vectors.
void SetChannelConditionModel(Ptr< ChannelConditionModel > model)
Set the channel condition model used to determine the channel state (e.g., the LOS/NLOS condition)
std::unordered_map< uint32_t, ShadowingMapItem > m_shadowingMap
map to store the shadowing values
virtual double GetLossNlos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const =0
Computes the pathloss between a and b considering that the line of sight is obstructed.
virtual bool DoIsO2iLowPenetrationLoss(Ptr< const ChannelCondition > cond) const
Indicates the condition of the o2i building penetration loss (defined in 3GPP TR 38....
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
virtual double GetLossNlosv(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Computes the pathloss between a and b considering that the line of sight is obstructed by a vehicle.
virtual double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const =0
Returns the shadow fading correlation distance.
ThreeGppPropagationLossModel()
Constructor.
Ptr< NormalRandomVariable > m_normRandomVariable
normal random variable
static TypeId GetTypeId()
Get the type ID.
Ptr< ChannelConditionModel > m_channelConditionModel
pointer to the channel condition model
~ThreeGppPropagationLossModel() override
Destructor.
std::unordered_map< uint32_t, O2iLossMapItem > m_o2iLossMap
map to store the o2i Loss values
virtual double GetO2iDistance2dIn() const =0
Returns the minimum of the two independently generated distances according to the uniform distributio...
virtual double GetO2iHighPenetrationLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const
Retrieves the o2i building penetration loss value by looking at m_o2iLossMap.
bool IsO2iLowPenetrationLoss(Ptr< const ChannelCondition > cond) const
Return true if the O2I Building Penetration loss corresponds to a low loss condition.
void SetFrequency(double f)
Set the central frequency of the model.
void DoDispose() override
Destructor implementation.
static uint32_t GetKey(Ptr< MobilityModel > a, Ptr< MobilityModel > b)
Returns an unique key for the channel between a and b.
Ptr< NormalRandomVariable > m_normalO2iLowLossVar
a normal random variable for the calculation of 02i low loss, see TR38.901 Table 7....
double m_frequency
operating frequency in Hz
bool m_enforceRanges
strictly enforce TR 38.901 parameter ranges
virtual double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const =0
Returns the shadow fading standard deviation.
Ptr< NormalRandomVariable > m_normalO2iHighLossVar
a normal random variable for the calculation of 02i high loss, see TR38.901 Table 7....
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the received power by applying the pathloss model described in 3GPP TR 38....
bool m_shadowingEnabled
enable/disable shadowing
static Vector GetVectorDifference(Ptr< MobilityModel > a, Ptr< MobilityModel > b)
Get the difference between the node position.
bool m_buildingPenLossesEnabled
enable/disable building penetration losses
virtual double GetLossLos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const =0
Computes the pathloss between a and b considering that the line of sight is not obstructed.
Implements the pathloss model defined in 3GPP TR 38.901, Table 7.4.1-1 for the RMa scenario.
double GetLossNlos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is obstructed.
double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
static double Pl1(double frequency, double distance3D, double h, double w)
Computes the PL1 formula for the RMa scenario.
double GetLossLos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
double GetO2iDistance2dIn() const override
Returns the minimum of the two independently generated distances according to the uniform distributio...
ThreeGppRmaPropagationLossModel()
Constructor.
~ThreeGppRmaPropagationLossModel() override
Destructor.
double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
double m_h
average building height in meters
static TypeId GetTypeId()
Get the type ID.
static double GetBpDistance(double frequency, double hA, double hB)
Computes the breakpoint distance for the RMa scenario.
double m_w
average street width in meters
bool DoIsO2iLowPenetrationLoss(Ptr< const ChannelCondition > cond) const override
Indicates the condition of the o2i building penetration loss (defined in 3GPP TR 38....
Implements the pathloss model defined in 3GPP TR 38.901, Table 7.4.1-1 for the UMa scenario.
static TypeId GetTypeId()
Get the type ID.
double GetLossNlos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is obstructed.
double GetBpDistance(double hUt, double hBs, double distance2D) const
Computes the breakpoint distance.
~ThreeGppUmaPropagationLossModel() override
Destructor.
ThreeGppUmaPropagationLossModel()
Constructor.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
double GetLossLos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
double GetO2iDistance2dIn() const override
Returns the minimum of the two independently generated distances according to the uniform distributio...
Ptr< UniformRandomVariable > m_uniformVar
a uniform random variable used for the computation of the breakpoint distance
double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
Implements the pathloss model defined in 3GPP TR 38.901, Table 7.4.1-1 for the UMi-Street Canyon scen...
~ThreeGppUmiStreetCanyonPropagationLossModel() override
Destructor.
double GetLossNlos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is obstructed.
double GetShadowingStd(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading standard deviation.
double GetBpDistance(double hUt, double hBs, double distance2D) const
Computes the breakpoint distance.
double GetO2iDistance2dIn() const override
Returns the minimum of the two independently generated distances according to the uniform distributio...
ThreeGppUmiStreetCanyonPropagationLossModel()
Constructor.
double GetLossLos(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Computes the pathloss between a and b considering that the line of sight is not obstructed.
static TypeId GetTypeId()
Get the type ID.
double GetShadowingCorrelationDistance(ChannelCondition::LosConditionValue cond) const override
Returns the shadow fading correlation distance.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
double GetLength() const
Compute the length (magnitude) of the vector.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#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.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
const std::map< int, std::vector< float > > SFCL_SuburbanRural
The map containing the 3GPP value regarding Shadow Fading and Clutter Loss tables for the NTN Suburba...
constexpr double M_C
propagation velocity in free space
double ComputeIonosphericPlusTroposphericScintillationLoss(double freq, double elevAngleQuantized)
Computes the ionospheric plus tropospheric scintillation loss using the formulas described in 3GPP TR...
std::tuple< double, double, double, double > GetBsUtDistancesAndHeights(ns3::Ptr< const ns3::MobilityModel > a, ns3::Ptr< const ns3::MobilityModel > b)
Get the base station and user terminal relative distances and heights.
double ComputeAtmosphericAbsorptionLoss(double freq, double elevAngle)
Computes the atmospheric absorption loss using the formula described in 3GPP TR 38....
double ComputeNtnPathloss(double freq, double dist3d)
Computes the free-space path loss using the formula described in 3GPP TR 38.811, Table 6....
const double atmosphericAbsorption[101]
Array containing the attenuation given by atmospheric absorption.
const std::map< int, float > troposphericScintillationLoss
Map containing the Tropospheric attenuation in dB with 99% probability at 20 GHz in Toulouse used for...
const std::map< int, std::vector< float > > SFCL_Urban
The map containing the 3GPP value regarding Shadow Fading and Clutter Loss tables for the NTN Urban s...
double ComputeClutterLoss(double freq, const std::map< int, std::vector< float > > *sfcl, double elevAngleQuantized)
Computes the clutter loss using the formula described in 3GPP TR 38.811, Sec 6.6.6....
SFCL_params
The enumerator used for code clarity when performing parameter assignment in the GetLoss Methods.
std::tuple< double, double > GetBsUtHeightsUmiStreetCanyon(double heightA, double heightB)
Get the base station and user terminal heights for the UmiStreetCanyon scenario.
const std::map< int, std::vector< float > > SFCL_DenseUrban
The map containing the 3GPP value regarding Shadow Fading and Clutter Loss tables for the NTN Dense U...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeChecker > MakeDoubleChecker()
double CalculateDistance(const Vector3D &a, const Vector3D &b)
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Define a struct for the m_o2iLossMap entries.
Define a struct for the m_shadowingMap entries.