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.",
302 .AddAttribute(
"MeanVehicularLoss",
303 "9dB for standard cars, 20dB for cars with "
304 "metal coated glass panels.",
369 "Frequency should be between 0.5 and 100 GHz but is " << f);
400 double rxPow = txPowerDbm;
445 switch (cond->GetLosCondition())
471 double o2iLossValue = 0;
474 double lossNormalVariate = 0;
479 bool notFound =
false;
480 bool newCondition =
false;
487 newCondition = (it->second.m_condition != cond);
494 it =
m_o2iLossMap.insert(it, std::make_pair(key, newItem));
497 if (notFound || newCondition)
507 lossIn = 0.5 * distance2dIn;
510 lossNormalVariate = 0;
512 o2iLossValue = lossTw + lossIn + lossNormalVariate;
515 it->second.m_o2iLoss = o2iLossValue;
516 it->second.m_condition = cond;
520 o2iLossValue = it->second.m_o2iLoss;
534 double o2iLossValue = 0;
535 double lowLossTw = 0;
537 double lowlossNormalVariate = 0;
539 double lConcrete = 0;
544 bool notFound =
false;
545 bool newCondition =
false;
552 newCondition = (it->second.m_condition != cond);
559 it =
m_o2iLossMap.insert(it, std::make_pair(key, newItem));
562 if (notFound || newCondition)
574 5 - 10 * log10(0.3 * std::pow(10, -lGlass / 10) + 0.7 * std::pow(10, -lConcrete / 10));
577 lossIn = 0.5 * distance2dIn;
582 o2iLossValue = lowLossTw + lossIn + lowlossNormalVariate;
585 it->second.m_o2iLoss = o2iLossValue;
586 it->second.m_condition = cond;
590 o2iLossValue = it->second.m_o2iLoss;
604 double o2iLossValue = 0;
605 double highLossTw = 0;
607 double highlossNormalVariate = 0;
608 double lIIRGlass = 0;
609 double lConcrete = 0;
614 bool notFound =
false;
615 bool newCondition =
false;
622 newCondition = (it->second.m_condition != cond);
629 it =
m_o2iLossMap.insert(it, std::make_pair(key, newItem));
632 if (notFound || newCondition)
645 highLossTw = 5 - 10 * log10(0.7 * std::pow(10, -lIIRGlass / 10) +
646 0.3 * std::pow(10, -lConcrete / 10));
649 lossIn = 0.5 * distance2dIn;
654 o2iLossValue = highLossTw + lossIn + highlossNormalVariate;
657 it->second.m_o2iLoss = o2iLossValue;
658 it->second.m_condition = cond;
662 o2iLossValue = it->second.m_o2iLoss;
681 NS_ABORT_MSG(
"If we have set the O2I condition, we shouldn't be here");
700 double shadowingValue;
705 bool notFound =
false;
706 bool newCondition =
false;
714 newCondition = (it->second.m_condition != cond);
725 if (notFound || newCondition)
733 Vector2D displacement(newDistance.x - it->second.m_distance.x,
734 newDistance.y - it->second.m_distance.y);
736 shadowingValue = R * it->second.m_shadowing + sqrt(1 - R * R) *
742 it->second.m_shadowing = shadowingValue;
743 it->second.m_distance = newDistance;
745 it->second.m_condition = cond;
747 return shadowingValue;
767 double x = a.x - b.x;
768 double y = a.y - b.y;
769 double distance2D = sqrt(
x *
x + y * y);
783 uint32_t key = (((x1 + x2) * (x1 + x2 + 1)) / 2) + x2;
796 return b->GetPosition() - a->GetPosition();
800 return a->GetPosition() - b->GetPosition();
824 double o2iVehicularLoss = 0.0;
829 for (
const auto& mob : {a, b})
831 auto velocityKmH = mob->GetVelocity().GetLength() * 3.6;
832 auto idNode = mob->GetObject<
Node>()->GetId();
834 if (velocityKmH < 30)
840 else if (velocityKmH >= 30 && velocityKmH <= 120)
851 "O2I loss for high-speed (>120 km/h) transit and satellites not implemented");
861 return o2iVehicularLoss;
871 static TypeId tid =
TypeId(
"ns3::ThreeGppRmaPropagationLossModel")
873 .SetGroupName(
"Propagation")
875 .AddAttribute(
"AvgBuildingHeight",
876 "The average building height in meters.",
880 .AddAttribute(
"AvgStreetWidth",
881 "The average street width in meters.",
912 [[maybe_unused]])
const
924 "RMa scenario is valid for frequencies between 0.5 and 30 GHz.");
926 auto [distance2D, distance3D, hBs, hUt] = GetBsUtDistancesAndHeights(a, b);
929 if (hUt < 1.0 || hUt > 10.0)
933 "The height of the UT should be between 1 and 10 m (see TR 38.901, Table 7.4.1-1)");
936 if (hBs < 10.0 || hBs > 150.0)
940 "The height of the BS should be between 10 and 150 m (see TR 38.901, Table 7.4.1-1)");
954 "Breakpoint distance is zero (divide-by-zero below); are either hBs or hUt = 0?");
957 if (distance2D < 10.0 || distance2D > 10.0e3)
960 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
966 if (distance2D <= distanceBp)
987 "RMa scenario is valid for frequencies between 0.5 and 30 GHz.");
989 auto [distance2D, distance3D, hBs, hUt] = GetBsUtDistancesAndHeights(a, b);
992 if (hUt < 1.0 || hUt > 10.0)
996 "The height of the UT should be between 1 and 10 m (see TR 38.901, Table 7.4.1-1)");
999 if (hBs < 10.0 || hBs > 150.0)
1003 "The height of the BS should be between 10 and 150 m (see TR 38.901, Table 7.4.1-1)");
1014 if (distance2D < 10.0 || distance2D > 5.0e3)
1017 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1022 double plNlos = 161.04 - 7.1 * log10(
m_w) + 7.5 * log10(
m_h) -
1023 (24.37 - 3.7 * pow((
m_h / hBs), 2)) * log10(hBs) +
1024 (43.42 - 3.1 * log10(hBs)) * (log10(distance3D) - 3.0) +
1025 20.0 * log10(
m_frequency / 1e9) - (3.2 * pow(log10(11.75 * hUt), 2) - 4.97);
1027 double loss = std::max(
GetLossLos(a, b), plNlos);
1040 double shadowingStd;
1050 if (distance2d <= distanceBp)
1068 return shadowingStd;
1076 double correlationDistance;
1081 correlationDistance = 37;
1085 correlationDistance = 120;
1092 return correlationDistance;
1098 double loss = 20.0 * log10(40.0 * M_PI * distance3D * frequency / 1e9 / 3.0) +
1099 std::min(0.03 * pow(h, 1.72), 10.0) * log10(distance3D) -
1100 std::min(0.044 * pow(h, 1.72), 14.77) + 0.002 * log10(h) * distance3D;
1107 double distanceBp = 2.0 * M_PI * hA * hB * frequency / M_C;
1118 static TypeId tid =
TypeId(
"ns3::ThreeGppUmaPropagationLossModel")
1120 .SetGroupName(
"Propagation")
1146 if (distance2D > 18.0)
1148 g = 5.0 / 4.0 * pow(distance2D / 100.0, 3) * exp(-distance2D / 150.0);
1155 c = pow((hUt - 13.0) / 10.0, 1.5) * g;
1159 double prob = 1.0 / (1.0 + c);
1167 int random =
m_uniformVar->GetInteger(12, std::max(12, (
int)(hUt - 1.5)));
1168 hE = (
double)floor(random / 3.0) * 3.0;
1172 double distanceBp = 4 * (hBs - hE) * (hUt - hE) *
m_frequency / M_C;
1182 auto [distance2D, distance3D, hBs, hUt] = GetBsUtDistancesAndHeights(a, b);
1185 if (hUt < 1.5 || hUt > 22.5)
1189 "The height of the UT should be between 1.5 and 22.5 m (see TR 38.901, Table 7.4.1-1)");
1195 NS_LOG_WARN(
"The height of the BS should be equal to 25 m (see TR 38.901, Table 7.4.1-1)");
1210 if (distance2D < 10.0 || distance2D > 5.0e3)
1213 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1219 if (distance2D <= distanceBp)
1222 loss = 28.0 + 22.0 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9);
1227 loss = 28.0 + 40.0 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9) -
1228 9.0 * log10(pow(distanceBp, 2) + pow(hBs - hUt, 2));
1256 auto [distance2D, distance3D, hBs, hUt] = GetBsUtDistancesAndHeights(a, b);
1259 if (hUt < 1.5 || hUt > 22.5)
1263 "The height of the UT should be between 1.5 and 22.5 m (see TR 38.901, Table 7.4.1-1)");
1269 NS_LOG_WARN(
"The height of the BS should be equal to 25 m (see TR 38.901, Table 7.4.1-1)");
1280 if (distance2D < 10.0 || distance2D > 5.0e3)
1283 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1289 13.54 + 39.08 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9) - 0.6 * (hUt - 1.5);
1290 double loss = std::max(
GetLossLos(a, b), plNlos);
1302 double shadowingStd;
1322 return shadowingStd;
1330 double correlationDistance;
1335 correlationDistance = 37;
1339 correlationDistance = 50;
1346 return correlationDistance;
1366 static TypeId tid =
TypeId(
"ns3::ThreeGppUmiStreetCanyonPropagationLossModel")
1368 .SetGroupName(
"Propagation")
1398 double distanceBp = 4 * (hBs - hE) * (hUt - hE) *
m_frequency / M_C;
1426 auto [hBs, hUt] = GetBsUtHeightsUmiStreetCanyon(a->GetPosition().z, b->GetPosition().z);
1429 if (hUt < 1.5 || hUt >= 10.0)
1433 "The height of the UT should be between 1.5 and 22.5 m (see TR 38.901, Table 7.4.1-1). "
1434 "We further assume hUT < hBS, then hUT is upper bounded by hBS, which should be 10 m");
1440 NS_LOG_WARN(
"The height of the BS should be equal to 10 m (see TR 38.901, Table 7.4.1-1)");
1455 if (distance2D < 10.0 || distance2D > 5.0e3)
1458 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1464 if (distance2D <= distanceBp)
1467 loss = 32.4 + 21.0 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9);
1472 loss = 32.4 + 40.0 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9) -
1473 9.5 * log10(pow(distanceBp, 2) + pow(hBs - hUt, 2));
1489 auto [hBs, hUt] = GetBsUtHeightsUmiStreetCanyon(a->GetPosition().z, b->GetPosition().z);
1492 if (hUt < 1.5 || hUt >= 10.0)
1496 "The height of the UT should be between 1.5 and 22.5 m (see TR 38.901, Table 7.4.1-1). "
1497 "We further assume hUT < hBS, then hUT is upper bounded by hBS, which should be 10 m");
1503 NS_LOG_WARN(
"The height of the BS should be equal to 10 m (see TR 38.901, Table 7.4.1-1)");
1514 if (distance2D < 10.0 || distance2D > 5.0e3)
1517 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1523 22.4 + 35.3 * log10(distance3D) + 21.3 * log10(
m_frequency / 1e9) - 0.3 * (hUt - 1.5);
1524 double loss = std::max(
GetLossLos(a, b), plNlos);
1537 double shadowingStd;
1551 shadowingStd = 7.82;
1558 return shadowingStd;
1566 double correlationDistance;
1571 correlationDistance = 10;
1575 correlationDistance = 13;
1582 return correlationDistance;
1592 static TypeId tid =
TypeId(
"ns3::ThreeGppIndoorOfficePropagationLossModel")
1594 .SetGroupName(
"Propagation")
1628 if (distance3D < 1.0 || distance3D > 150.0)
1631 NS_LOG_WARN(
"The 3D distance is outside the validity range, the pathloss value may not be "
1636 double loss = 32.4 + 17.3 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9);
1652 if (distance3D < 1.0 || distance3D > 150.0)
1655 NS_LOG_WARN(
"The 3D distance is outside the validity range, the pathloss value may not be "
1660 double plNlos = 17.3 + 38.3 * log10(distance3D) + 24.9 * log10(
m_frequency / 1e9);
1661 double loss = std::max(
GetLossLos(a, b), plNlos);
1675 double shadowingStd;
1683 shadowingStd = 8.03;
1690 return shadowingStd;
1700 double correlationDistance;
1704 correlationDistance = 10;
1708 correlationDistance = 6;
1715 return correlationDistance;
1723 static TypeId tid =
TypeId(
"ns3::ThreeGppNTNDenseUrbanPropagationLossModel")
1725 .SetGroupName(
"Propagation")
1755 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1758 auto [elevAngle, elevAngleQuantized] =
1762 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1765 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1768 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1780 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1783 auto [elevAngle, elevAngleQuantized] =
1787 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1793 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1796 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1809 double shadowingStd;
1811 std::string freqBand = (
m_frequency < 13.0e9) ?
"S" :
"Ka";
1812 auto [elevAngle, elevAngleQuantized] =
1837 return shadowingStd;
1845 double correlationDistance;
1850 correlationDistance = 37;
1854 correlationDistance = 50;
1861 return correlationDistance;
1871 static TypeId tid =
TypeId(
"ns3::ThreeGppNTNUrbanPropagationLossModel")
1873 .SetGroupName(
"Propagation")
1902 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1905 auto [elevAngle, elevAngleQuantized] =
1909 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1912 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1915 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1926 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1929 auto [elevAngle, elevAngleQuantized] =
1933 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1939 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1942 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1955 double shadowingStd;
1957 std::string freqBand = (
m_frequency < 13.0e9) ?
"S" :
"Ka";
1958 auto [elevAngle, elevAngleQuantized] =
1983 return shadowingStd;
1991 double correlationDistance;
1996 correlationDistance = 37;
2000 correlationDistance = 50;
2007 return correlationDistance;
2017 static TypeId tid =
TypeId(
"ns3::ThreeGppNTNSuburbanPropagationLossModel")
2019 .SetGroupName(
"Propagation")
2049 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
2052 auto [elevAngle, elevAngleQuantized] =
2056 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
2059 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
2062 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
2075 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
2078 auto [elevAngle, elevAngleQuantized] =
2082 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
2088 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
2091 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
2104 double shadowingStd;
2106 std::string freqBand = (
m_frequency < 13.0e9) ?
"S" :
"Ka";
2107 auto [elevAngle, elevAngleQuantized] =
2132 return shadowingStd;
2140 double correlationDistance;
2145 correlationDistance = 37;
2149 correlationDistance = 50;
2156 return correlationDistance;
2166 static TypeId tid =
TypeId(
"ns3::ThreeGppNTNRuralPropagationLossModel")
2168 .SetGroupName(
"Propagation")
2197 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
2200 auto [elevAngle, elevAngleQuantized] =
2204 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
2207 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
2210 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
2221 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
2224 auto [elevAngle, elevAngleQuantized] =
2228 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
2234 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
2237 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
2250 double shadowingStd;
2252 std::string freqBand = (
m_frequency < 13.0e9) ?
"S" :
"Ka";
2253 auto [elevAngle, elevAngleQuantized] =
2278 return shadowingStd;
2286 double correlationDistance;
2291 correlationDistance = 37;
2295 correlationDistance = 120;
2302 return correlationDistance;
cairo_uint64_t x
_cairo_uint_96by64_32x64_divrem:
AttributeValue implementation for Boolean.
O2iConditionValue
Possible values for Outdoor to Indoor condition.
@ 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.
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 ?
~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 ?
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 ?
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 ?
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.
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 m_meanVehicleO2iLoss
normal cars (9dB), cars with metal coated glass panels (20dB)
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.
Ptr< NormalRandomVariable > m_normalO2iVehicularLossVar
a normal random variable for the calculation of penetration loss for vehicles see TR38....
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...
std::unordered_map< uint32_t, double > m_o2iVehicularUtLossMap
vehicular O2I loss for each individual UT with speed x, such that 30 < x <= 120 km/h.
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.
virtual double GetO2iDistance2dInSub6Ghz() const
Returns a a single, link-specific, uniformly distributed variable value depending on the specific 3GP...
void SetFrequency(double f)
Set the central frequency of the model.
void ClearO2iLossCacheMap()
Clear cached O2I Building Penetration loss.
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
double GetO2iSub6GhzPenetrationLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::LosConditionValue cond) const
Retrieves the o2i building penetration loss value by looking at m_o2iLossMap.
static Vector GetVectorDifference(Ptr< MobilityModel > a, Ptr< MobilityModel > b)
Get the difference between the node position.
bool m_buildingPenLossesEnabled
enable/disable building penetration losses
double GetO2iVehicularLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b, ChannelCondition::O2iConditionValue cond) const
Computes the o2i vehicular penetration loss by looking at m_o2iVehicularUtLossMap.
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 GetO2iDistance2dInSub6Ghz() const override
Returns a a single, link-specific, uniformly distributed variable value depending on the specific 3GP...
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...
double GetO2iDistance2dInSub6Ghz() const override
Returns a a single, link-specific, uniformly distributed variable value depending on the specific 3GP...
~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 AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
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.
double CalculateDistance(const Vector3D &a, const Vector3D &b)
Define a struct for the m_o2iLossMap entries.
Define a struct for the m_shadowingMap entries.