23 #include "ns3/double.h"
25 #include "ns3/mobility-model.h"
41 static TypeId tid =
TypeId (
"ns3::ItuR1411NlosOverRooftopPropagationLossModel")
45 .AddAttribute (
"Frequency",
46 "The Frequency (default is 2.106 GHz).",
49 MakeDoubleChecker<double> ())
52 .AddAttribute (
"Environment",
53 "Environment Scenario",
60 .AddAttribute (
"CitySize",
61 "Dimension of the city",
68 .AddAttribute (
"RooftopLevel",
69 "The height of the rooftop level in meters",
72 MakeDoubleChecker<double> (0.0, 90.0))
74 .AddAttribute (
"StreetsOrientation",
75 "The orientation of streets in degrees [0,90] with respect to the direction of propagation",
78 MakeDoubleChecker<double> (0.0, 90.0))
80 .AddAttribute (
"StreetsWidth",
81 "The width of streets",
84 MakeDoubleChecker<double> (0.0, 1000.0))
86 .AddAttribute (
"BuildingsExtend",
87 "The distance over which the buildings extend",
90 MakeDoubleChecker<double> ())
92 .AddAttribute (
"BuildingSeparation",
93 "The separation between buildings",
96 MakeDoubleChecker<double> ());
110 " Street Orientation must be in [0,90]");
127 NS_ASSERT_MSG (hm > 0 && hb > 0,
"nodes' height must be greater then 0");
129 double ds = (
m_lambda * distance * distance) / (Dhb * Dhb);
138 if (hb > m_rooftopHeight)
140 Lbsh = -18 * std::log10 (1 + Dhb);
141 ka = (fmhz > 2000 ? 71.4 : 54.0);
150 ka = 54.0 - 1.6 * Dhb * distance / 1000;
154 ka = 54.0 - 0.8 * Dhb;
163 kf = -4 + 0.7 * (fmhz / 925.0 - 1);
167 kf = -4 + 1.5 * (fmhz / 925.0 - 1);
170 Lmsd = Lbsh + ka + kd * std::log10 (distance / 1000.0) + kf * std::log10 (fmhz) - 9.0 * std::log10 (
m_buildingSeparation);
177 if ((hb > m_rooftopHeight - 1.0) && (hb < m_rooftopHeight + 1.0))
179 Qm = m_buildingSeparation / distance;
181 else if (hb > m_rooftopHeight)
183 Qm = 2.35 * pow (Dhb / distance * std::sqrt (m_buildingSeparation /
m_lambda), 0.9);
187 Qm = m_buildingSeparation / (2 * M_PI * distance) * std::sqrt (
m_lambda / rho) * (1 / theta - (1 / (2 * M_PI + theta)));
189 Lmsd = -10 * std::log10 (Qm * Qm);
191 double Lbf = 32.4 + 20 * std::log10 (distance / 1000) + 20 * std::log10 (fmhz);
192 double Dhm = m_rooftopHeight - hm;
193 double Lrts = -8.2 - 10 * std::log10 (
m_streetsWidth) + 10 * std::log10 (fmhz) + 20 * std::log10 (Dhm) + Lori;
194 NS_LOG_LOGIC (
this <<
" Lbf " << Lbf <<
" Lrts " << Lrts <<
" Dhm" << Dhm <<
" Lmsd " << Lmsd);
198 loss = Lbf + Lrts + Lmsd;
221 return (txPowerDbm -
GetLoss (a, b));
#define NS_LOG_FUNCTION(parameters)
Ptr< const AttributeChecker > MakeEnumChecker(int v1, std::string n1, int v2, std::string n2, int v3, std::string n3, int v4, std::string n4, int v5, std::string n5, int v6, std::string n6, int v7, std::string n7, int v8, std::string n8, int v9, std::string n9, int v10, std::string n10, int v11, std::string n11, int v12, std::string n12, int v13, std::string n13, int v14, std::string n14, int v15, std::string n15, int v16, std::string n16, int v17, std::string n17, int v18, std::string n18, int v19, std::string n19, int v20, std::string n20, int v21, std::string n21, int v22, std::string n22)
double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
static TypeId GetTypeId(void)
double GetDistanceFrom(Ptr< const MobilityModel > position) const
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
Vector GetPosition(void) const
double m_frequency
frequency in MHz
double m_rooftopHeight
in meters
double m_streetsWidth
in meters
EnvironmentType m_environment
hold variables of type 'enum'
NS_LOG_COMPONENT_DEFINE("ItuR1411NlosOverRooftopPropagationLossModel")
#define NS_LOG_LOGIC(msg)
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero. ...
double m_streetsOrientation
in degrees [0,90]
void SetFrequency(double freq)
Set the operating frequency.
double m_buildingsExtend
in meters
double m_buildingSeparation
in meters
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
#define NS_ASSERT_MSG(condition, message)
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Modelize the propagation loss through a transmission medium.
double m_lambda
wavelength
Hold a floating point type.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
double z
z coordinate of vector