23 #include "ns3/double.h"
25 #include "ns3/mobility-model.h"
28 #include "itu-r-1411-nlos-over-rooftop-propagation-loss-model.h"
34 NS_OBJECT_ENSURE_REGISTERED (ItuR1411NlosOverRooftopPropagationLossModel);
38 ItuR1411NlosOverRooftopPropagationLossModel::GetTypeId (
void)
40 static TypeId tid = TypeId (
"ns3::ItuR1411NlosOverRooftopPropagationLossModel")
42 .SetParent<PropagationLossModel> ()
44 .AddAttribute (
"Frequency",
45 "The Frequency (default is 2.106 GHz).",
48 MakeDoubleChecker<double> ())
51 .AddAttribute (
"Environment",
52 "Environment Scenario",
53 EnumValue (UrbanEnvironment),
54 MakeEnumAccessor (&ItuR1411NlosOverRooftopPropagationLossModel::m_environment),
55 MakeEnumChecker (UrbanEnvironment,
"Urban",
56 SubUrbanEnvironment,
"SubUrban",
57 OpenAreasEnvironment,
"OpenAreas"))
59 .AddAttribute (
"CitySize",
60 "Dimension of the city",
61 EnumValue (LargeCity),
62 MakeEnumAccessor (&ItuR1411NlosOverRooftopPropagationLossModel::m_citySize),
63 MakeEnumChecker (SmallCity,
"Small",
67 .AddAttribute (
"RooftopLevel",
68 "The height of the rooftop level in meters",
71 MakeDoubleChecker<double> (0.0, 90.0))
73 .AddAttribute (
"StreetsOrientation",
74 "The orientation of streets in degrees [0,90] with respect to the direction of propagation",
77 MakeDoubleChecker<double> (0.0, 90.0))
79 .AddAttribute (
"StreetsWidth",
80 "The width of streets",
83 MakeDoubleChecker<double> (0.0, 1000.0))
85 .AddAttribute (
"BuildingsExtend",
86 "The distance over which the buildings extend",
89 MakeDoubleChecker<double> ())
91 .AddAttribute (
"BuildingSeparation",
92 "The separation between buildings",
95 MakeDoubleChecker<double> ());
109 " Street Orientation must be in [0,90]");
126 NS_ASSERT_MSG (hm > 0 && hb > 0,
"nodes' height must be greater then 0");
128 double ds = (
m_lambda * distance * distance) / (Dhb * Dhb);
137 if (hb > m_rooftopHeight)
139 Lbsh = -18 * std::log10 (1 + Dhb);
140 ka = (fmhz > 2000 ? 71.4 : 54.0);
149 ka = 54.0 - 1.6 * Dhb * distance / 1000;
153 ka = 54.0 - 0.8 * Dhb;
160 else if ((m_environment == UrbanEnvironment)&&(m_citySize == LargeCity))
162 kf = -4 + 0.7 * (fmhz / 925.0 - 1);
166 kf = -4 + 1.5 * (fmhz / 925.0 - 1);
169 Lmsd = Lbsh + ka + kd * std::log10 (distance / 1000.0) + kf * std::log10 (fmhz) - 9.0 * std::log10 (
m_buildingSeparation);
176 if ((hb > m_rooftopHeight - 1.0) && (hb < m_rooftopHeight + 1.0))
178 Qm = m_buildingSeparation / distance;
180 else if (hb > m_rooftopHeight)
182 Qm = 2.35 * pow (Dhb / distance * std::sqrt (m_buildingSeparation /
m_lambda), 0.9);
186 Qm = m_buildingSeparation / (2 * M_PI * distance) * std::sqrt (
m_lambda / rho) * (1 / theta - (1 / (2 * M_PI + theta)));
188 Lmsd = -10 * std::log10 (Qm * Qm);
190 double Lbf = 32.4 + 20 * std::log10 (distance / 1000) + 20 * std::log10 (fmhz);
191 double Dhm = m_rooftopHeight - hm;
192 double Lrts = -8.2 - 10 * std::log10 (
m_streetsWidth) + 10 * std::log10 (fmhz) + 20 * std::log10 (Dhm) + Lori;
193 NS_LOG_LOGIC (
this <<
" Lbf " << Lbf <<
" Lrts " << Lrts <<
" Dhm" << Dhm <<
" Lmsd " << Lmsd);
197 loss = Lbf + Lrts + Lmsd;
216 ItuR1411NlosOverRooftopPropagationLossModel::DoCalcRxPower (
double txPowerDbm,
220 return (txPowerDbm -
GetLoss (a, b));
#define NS_LOG_FUNCTION(parameters)
double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
double GetDistanceFrom(Ptr< const MobilityModel > position) const
#define NS_LOG_COMPONENT_DEFINE(name)
Vector GetPosition(void) const
double m_frequency
frequency in MHz
double m_rooftopHeight
in meters
double m_streetsWidth
in meters
#define NS_LOG_LOGIC(msg)
virtual int64_t DoAssignStreams(int64_t stream)
double m_streetsOrientation
in degrees [0,90]
void SetFrequency(double freq)
double m_buildingsExtend
in meters
double m_buildingSeparation
in meters
#define NS_ASSERT_MSG(condition, message)
double m_lambda
wavelength