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.",
375 "Frequency should be between 0.5 and 100 GHz but is " << f);
406 double rxPow = txPowerDbm;
451 switch (cond->GetLosCondition())
477 double o2iLossValue = 0;
480 double lossNormalVariate = 0;
485 bool notFound =
false;
486 bool newCondition =
false;
493 newCondition = (it->second.m_condition != cond);
500 it =
m_o2iLossMap.insert(it, std::make_pair(key, newItem));
503 if (notFound || newCondition)
513 lossIn = 0.5 * distance2dIn;
516 lossNormalVariate = 0;
518 o2iLossValue = lossTw + lossIn + lossNormalVariate;
521 it->second.m_o2iLoss = o2iLossValue;
522 it->second.m_condition = cond;
526 o2iLossValue = it->second.m_o2iLoss;
540 double o2iLossValue = 0;
541 double lowLossTw = 0;
543 double lowlossNormalVariate = 0;
545 double lConcrete = 0;
550 bool notFound =
false;
551 bool newCondition =
false;
558 newCondition = (it->second.m_condition != cond);
565 it =
m_o2iLossMap.insert(it, std::make_pair(key, newItem));
568 if (notFound || newCondition)
580 5 - 10 * log10(0.3 * std::pow(10, -lGlass / 10) + 0.7 * std::pow(10, -lConcrete / 10));
583 lossIn = 0.5 * distance2dIn;
588 o2iLossValue = lowLossTw + lossIn + lowlossNormalVariate;
591 it->second.m_o2iLoss = o2iLossValue;
592 it->second.m_condition = cond;
596 o2iLossValue = it->second.m_o2iLoss;
610 double o2iLossValue = 0;
611 double highLossTw = 0;
613 double highlossNormalVariate = 0;
614 double lIIRGlass = 0;
615 double lConcrete = 0;
620 bool notFound =
false;
621 bool newCondition =
false;
628 newCondition = (it->second.m_condition != cond);
635 it =
m_o2iLossMap.insert(it, std::make_pair(key, newItem));
638 if (notFound || newCondition)
651 highLossTw = 5 - 10 * log10(0.7 * std::pow(10, -lIIRGlass / 10) +
652 0.3 * std::pow(10, -lConcrete / 10));
655 lossIn = 0.5 * distance2dIn;
660 o2iLossValue = highLossTw + lossIn + highlossNormalVariate;
663 it->second.m_o2iLoss = o2iLossValue;
664 it->second.m_condition = cond;
668 o2iLossValue = it->second.m_o2iLoss;
687 NS_ABORT_MSG(
"If we have set the O2I condition, we shouldn't be here");
706 double shadowingValue;
711 bool notFound =
false;
712 bool newCondition =
false;
720 newCondition = (it->second.m_condition != cond);
731 if (notFound || newCondition)
739 Vector2D displacement(newDistance.x - it->second.m_distance.x,
740 newDistance.y - it->second.m_distance.y);
742 shadowingValue = R * it->second.m_shadowing + sqrt(1 - R * R) *
748 it->second.m_shadowing = shadowingValue;
749 it->second.m_distance = newDistance;
751 it->second.m_condition = cond;
753 return shadowingValue;
773 double x = a.x - b.x;
774 double y = a.y - b.y;
775 double distance2D = sqrt(
x *
x + y * y);
789 uint32_t key = (((x1 + x2) * (x1 + x2 + 1)) / 2) + x2;
802 return b->GetPosition() - a->GetPosition();
806 return a->GetPosition() - b->GetPosition();
830 double o2iVehicularLoss = 0.0;
835 for (
const auto& mob : {a, b})
837 auto velocityKmH = mob->GetVelocity().GetLength() * 3.6;
838 auto idNode = mob->GetObject<
Node>()->GetId();
840 if (velocityKmH < 30)
846 else if (velocityKmH >= 30 && velocityKmH <= 120)
857 "O2I loss for high-speed (>120 km/h) transit and satellites not implemented");
867 return o2iVehicularLoss;
877 static TypeId tid =
TypeId(
"ns3::ThreeGppRmaPropagationLossModel")
879 .SetGroupName(
"Propagation")
881 .AddAttribute(
"AvgBuildingHeight",
882 "The average building height in meters.",
886 .AddAttribute(
"AvgStreetWidth",
887 "The average street width in meters.",
918 [[maybe_unused]])
const
930 "RMa scenario is valid for frequencies between 0.5 and 30 GHz.");
932 auto [distance2D, distance3D, hBs, hUt] = GetBsUtDistancesAndHeights(a, b);
935 if (hUt < 1.0 || hUt > 10.0)
939 "The height of the UT should be between 1 and 10 m (see TR 38.901, Table 7.4.1-1)");
942 if (hBs < 10.0 || hBs > 150.0)
946 "The height of the BS should be between 10 and 150 m (see TR 38.901, Table 7.4.1-1)");
960 "Breakpoint distance is zero (divide-by-zero below); are either hBs or hUt = 0?");
963 if (distance2D < 10.0 || distance2D > 10.0e3)
966 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
972 if (distance2D <= distanceBp)
993 "RMa scenario is valid for frequencies between 0.5 and 30 GHz.");
995 auto [distance2D, distance3D, hBs, hUt] = GetBsUtDistancesAndHeights(a, b);
998 if (hUt < 1.0 || hUt > 10.0)
1002 "The height of the UT should be between 1 and 10 m (see TR 38.901, Table 7.4.1-1)");
1005 if (hBs < 10.0 || hBs > 150.0)
1009 "The height of the BS should be between 10 and 150 m (see TR 38.901, Table 7.4.1-1)");
1020 if (distance2D < 10.0 || distance2D > 5.0e3)
1023 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1028 double plNlos = 161.04 - 7.1 * log10(
m_w) + 7.5 * log10(
m_h) -
1029 (24.37 - 3.7 * pow((
m_h / hBs), 2)) * log10(hBs) +
1030 (43.42 - 3.1 * log10(hBs)) * (log10(distance3D) - 3.0) +
1031 20.0 * log10(
m_frequency / 1e9) - (3.2 * pow(log10(11.75 * hUt), 2) - 4.97);
1033 double loss = std::max(
GetLossLos(a, b), plNlos);
1046 double shadowingStd;
1056 if (distance2d <= distanceBp)
1074 return shadowingStd;
1082 double correlationDistance;
1087 correlationDistance = 37;
1091 correlationDistance = 120;
1098 return correlationDistance;
1104 double loss = 20.0 * log10(40.0 * M_PI * distance3D * frequency / 1e9 / 3.0) +
1105 std::min(0.03 * pow(h, 1.72), 10.0) * log10(distance3D) -
1106 std::min(0.044 * pow(h, 1.72), 14.77) + 0.002 * log10(h) * distance3D;
1113 double distanceBp = 2.0 * M_PI * hA * hB * frequency / M_C;
1124 static TypeId tid =
TypeId(
"ns3::ThreeGppUmaPropagationLossModel")
1126 .SetGroupName(
"Propagation")
1152 if (distance2D > 18.0)
1154 g = 5.0 / 4.0 * pow(distance2D / 100.0, 3) * exp(-distance2D / 150.0);
1161 c = pow((hUt - 13.0) / 10.0, 1.5) * g;
1165 double prob = 1.0 / (1.0 + c);
1173 int random =
m_uniformVar->GetInteger(12, std::max(12, (
int)(hUt - 1.5)));
1174 hE = (
double)floor(random / 3.0) * 3.0;
1178 double distanceBp = 4 * (hBs - hE) * (hUt - hE) *
m_frequency / M_C;
1188 auto [distance2D, distance3D, hBs, hUt] = GetBsUtDistancesAndHeights(a, b);
1191 if (hUt < 1.5 || hUt > 22.5)
1195 "The height of the UT should be between 1.5 and 22.5 m (see TR 38.901, Table 7.4.1-1)");
1201 NS_LOG_WARN(
"The height of the BS should be equal to 25 m (see TR 38.901, Table 7.4.1-1)");
1216 if (distance2D < 10.0 || distance2D > 5.0e3)
1219 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1225 if (distance2D <= distanceBp)
1228 loss = 28.0 + 22.0 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9);
1233 loss = 28.0 + 40.0 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9) -
1234 9.0 * log10(pow(distanceBp, 2) + pow(hBs - hUt, 2));
1262 auto [distance2D, distance3D, hBs, hUt] = GetBsUtDistancesAndHeights(a, b);
1265 if (hUt < 1.5 || hUt > 22.5)
1269 "The height of the UT should be between 1.5 and 22.5 m (see TR 38.901, Table 7.4.1-1)");
1275 NS_LOG_WARN(
"The height of the BS should be equal to 25 m (see TR 38.901, Table 7.4.1-1)");
1286 if (distance2D < 10.0 || distance2D > 5.0e3)
1289 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1295 13.54 + 39.08 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9) - 0.6 * (hUt - 1.5);
1296 double loss = std::max(
GetLossLos(a, b), plNlos);
1308 double shadowingStd;
1328 return shadowingStd;
1336 double correlationDistance;
1341 correlationDistance = 37;
1345 correlationDistance = 50;
1352 return correlationDistance;
1372 static TypeId tid =
TypeId(
"ns3::ThreeGppUmiStreetCanyonPropagationLossModel")
1374 .SetGroupName(
"Propagation")
1404 double distanceBp = 4 * (hBs - hE) * (hUt - hE) *
m_frequency / M_C;
1432 auto [hBs, hUt] = GetBsUtHeightsUmiStreetCanyon(a->GetPosition().z, b->GetPosition().z);
1435 if (hUt < 1.5 || hUt >= 10.0)
1439 "The height of the UT should be between 1.5 and 22.5 m (see TR 38.901, Table 7.4.1-1). "
1440 "We further assume hUT < hBS, then hUT is upper bounded by hBS, which should be 10 m");
1446 NS_LOG_WARN(
"The height of the BS should be equal to 10 m (see TR 38.901, Table 7.4.1-1)");
1461 if (distance2D < 10.0 || distance2D > 5.0e3)
1464 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1470 if (distance2D <= distanceBp)
1473 loss = 32.4 + 21.0 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9);
1478 loss = 32.4 + 40.0 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9) -
1479 9.5 * log10(pow(distanceBp, 2) + pow(hBs - hUt, 2));
1495 auto [hBs, hUt] = GetBsUtHeightsUmiStreetCanyon(a->GetPosition().z, b->GetPosition().z);
1498 if (hUt < 1.5 || hUt >= 10.0)
1502 "The height of the UT should be between 1.5 and 22.5 m (see TR 38.901, Table 7.4.1-1). "
1503 "We further assume hUT < hBS, then hUT is upper bounded by hBS, which should be 10 m");
1509 NS_LOG_WARN(
"The height of the BS should be equal to 10 m (see TR 38.901, Table 7.4.1-1)");
1520 if (distance2D < 10.0 || distance2D > 5.0e3)
1523 NS_LOG_WARN(
"The 2D distance is outside the validity range, the pathloss value may not be "
1529 22.4 + 35.3 * log10(distance3D) + 21.3 * log10(
m_frequency / 1e9) - 0.3 * (hUt - 1.5);
1530 double loss = std::max(
GetLossLos(a, b), plNlos);
1543 double shadowingStd;
1557 shadowingStd = 7.82;
1564 return shadowingStd;
1572 double correlationDistance;
1577 correlationDistance = 10;
1581 correlationDistance = 13;
1588 return correlationDistance;
1598 static TypeId tid =
TypeId(
"ns3::ThreeGppIndoorOfficePropagationLossModel")
1600 .SetGroupName(
"Propagation")
1634 if (distance3D < 1.0 || distance3D > 150.0)
1637 NS_LOG_WARN(
"The 3D distance is outside the validity range, the pathloss value may not be "
1642 double loss = 32.4 + 17.3 * log10(distance3D) + 20.0 * log10(
m_frequency / 1e9);
1658 if (distance3D < 1.0 || distance3D > 150.0)
1661 NS_LOG_WARN(
"The 3D distance is outside the validity range, the pathloss value may not be "
1666 double plNlos = 17.3 + 38.3 * log10(distance3D) + 24.9 * log10(
m_frequency / 1e9);
1667 double loss = std::max(
GetLossLos(a, b), plNlos);
1681 double shadowingStd;
1689 shadowingStd = 8.03;
1696 return shadowingStd;
1706 double correlationDistance;
1710 correlationDistance = 10;
1714 correlationDistance = 6;
1721 return correlationDistance;
1729 static TypeId tid =
TypeId(
"ns3::ThreeGppNTNDenseUrbanPropagationLossModel")
1731 .SetGroupName(
"Propagation")
1761 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1764 auto [elevAngle, elevAngleQuantized] =
1768 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1771 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1774 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1786 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1789 auto [elevAngle, elevAngleQuantized] =
1793 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1799 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1802 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1815 double shadowingStd;
1817 std::string freqBand = (
m_frequency < 13.0e9) ?
"S" :
"Ka";
1818 auto [elevAngle, elevAngleQuantized] =
1843 return shadowingStd;
1851 double correlationDistance;
1856 correlationDistance = 37;
1860 correlationDistance = 50;
1867 return correlationDistance;
1877 static TypeId tid =
TypeId(
"ns3::ThreeGppNTNUrbanPropagationLossModel")
1879 .SetGroupName(
"Propagation")
1908 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1911 auto [elevAngle, elevAngleQuantized] =
1915 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1918 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1921 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1932 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
1935 auto [elevAngle, elevAngleQuantized] =
1939 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
1945 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
1948 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
1961 double shadowingStd;
1963 std::string freqBand = (
m_frequency < 13.0e9) ?
"S" :
"Ka";
1964 auto [elevAngle, elevAngleQuantized] =
1989 return shadowingStd;
1997 double correlationDistance;
2002 correlationDistance = 37;
2006 correlationDistance = 50;
2013 return correlationDistance;
2023 static TypeId tid =
TypeId(
"ns3::ThreeGppNTNSuburbanPropagationLossModel")
2025 .SetGroupName(
"Propagation")
2055 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
2058 auto [elevAngle, elevAngleQuantized] =
2062 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
2065 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
2068 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
2081 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
2084 auto [elevAngle, elevAngleQuantized] =
2088 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
2094 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
2097 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
2110 double shadowingStd;
2112 std::string freqBand = (
m_frequency < 13.0e9) ?
"S" :
"Ka";
2113 auto [elevAngle, elevAngleQuantized] =
2138 return shadowingStd;
2146 double correlationDistance;
2151 correlationDistance = 37;
2155 correlationDistance = 50;
2162 return correlationDistance;
2172 static TypeId tid =
TypeId(
"ns3::ThreeGppNTNRuralPropagationLossModel")
2174 .SetGroupName(
"Propagation")
2203 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
2206 auto [elevAngle, elevAngleQuantized] =
2210 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
2213 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
2216 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
2227 "NTN communications are valid for frequencies between 0.5 and 100 GHz.");
2230 auto [elevAngle, elevAngleQuantized] =
2234 double loss = ComputeNtnPathloss(
m_frequency, distance3D);
2240 loss += ComputeAtmosphericAbsorptionLoss(
m_frequency, elevAngle);
2243 loss += ComputeIonosphericPlusTroposphericScintillationLoss(
m_frequency, elevAngleQuantized);
2256 double shadowingStd;
2258 std::string freqBand = (
m_frequency < 13.0e9) ?
"S" :
"Ka";
2259 auto [elevAngle, elevAngleQuantized] =
2284 return shadowingStd;
2292 double correlationDistance;
2297 correlationDistance = 37;
2301 correlationDistance = 120;
2308 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.
void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
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.