23#include "ns3/double.h"
26#include "ns3/mobility-model.h"
41 TypeId(
"ns3::ItuR1411NlosOverRooftopPropagationLossModel")
43 .SetGroupName(
"Propagation")
47 "The Frequency (default is 2.106 GHz).",
50 MakeDoubleChecker<double>())
53 "Environment Scenario",
64 "Dimension of the city",
70 "The height of the rooftop level in meters",
73 MakeDoubleChecker<double>(0.0, 90.0))
74 .AddAttribute(
"StreetsOrientation",
75 "The orientation of streets in degrees [0,90] with respect to the "
76 "direction of propagation",
80 MakeDoubleChecker<double>(0.0, 90.0))
83 "The width of streets",
86 MakeDoubleChecker<double>(0.0, 1000.0))
89 "The distance over which the buildings extend",
92 MakeDoubleChecker<double>())
93 .AddAttribute(
"BuildingSeparation",
94 "The separation between buildings",
98 MakeDoubleChecker<double>());
121 " Street Orientation must be in [0,90]");
135 double distance = a->GetDistanceFrom(b);
136 double hb = (a->GetPosition().z > b->GetPosition().z ? a->GetPosition().z : b->GetPosition().z);
137 double hm = (a->GetPosition().z < b->GetPosition().z ? a->GetPosition().z : b->GetPosition().z);
138 NS_ASSERT_MSG(hm > 0 && hb > 0,
"nodes' height must be greater then 0");
140 double ds = (
m_lambda * distance * distance) / (Dhb * Dhb);
152 Lbsh = -18 * std::log10(1 + Dhb);
153 ka = (fmhz > 2000 ? 71.4 : 54.0);
159 kd = 18.0 - 15 * Dhb / a->GetPosition().z;
162 ka = 54.0 - 1.6 * Dhb * distance / 1000;
166 ka = 54.0 - 0.8 * Dhb;
175 kf = -4 + 0.7 * (fmhz / 925.0 - 1);
179 kf = -4 + 1.5 * (fmhz / 925.0 - 1);
182 Lmsd = Lbsh + ka + kd * std::log10(distance / 1000.0) + kf * std::log10(fmhz) -
201 (1 / theta - (1 / (2 * M_PI + theta)));
203 Lmsd = -10 * std::log10(Qm * Qm);
205 double Lbf = 32.4 + 20 * std::log10(distance / 1000) + 20 * std::log10(fmhz);
207 double Lrts = -8.2 - 10 * std::log10(
m_streetsWidth) + 10 * std::log10(fmhz) +
208 20 * std::log10(Dhm) + Lori;
209 NS_LOG_LOGIC(
this <<
" Lbf " << Lbf <<
" Lrts " << Lrts <<
" Dhm" << Dhm <<
" Lmsd " << Lmsd);
213 loss = Lbf + Lrts + Lmsd;
234 return (txPowerDbm -
GetLoss(a, b));
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Hold variables of type enum.
the ITU-R 1411 NLOS over rooftop propagation model
double m_buildingSeparation
in meters
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
~ItuR1411NlosOverRooftopPropagationLossModel() override
void SetFrequency(double freq)
Set the operating frequency.
double m_buildingsExtend
in meters
double m_streetsWidth
in meters
CitySize m_citySize
Dimension of the city.
double m_rooftopHeight
in meters
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
static TypeId GetTypeId()
Get the type ID.
EnvironmentType m_environment
Environment Scenario.
double m_frequency
frequency in MHz
ItuR1411NlosOverRooftopPropagationLossModel()
double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
double m_lambda
wavelength
double m_streetsOrientation
in degrees [0,90]
Models the propagation loss through a transmission medium.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#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 > MakeDoubleAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.