23 #include "ns3/double.h"
25 #include "ns3/mobility-model.h"
40 static TypeId tid =
TypeId (
"ns3::OkumuraHataPropagationLossModel")
43 .AddConstructor<OkumuraHataPropagationLossModel> ()
45 .AddAttribute (
"Frequency",
46 "The propagation frequency in Hz",
49 MakeDoubleChecker<double> ())
51 .AddAttribute (
"Environment",
52 "Environment Scenario",
59 .AddAttribute (
"CitySize",
60 "Dimension of the city",
89 double log_f = std::log10 (fmhz);
92 NS_ASSERT_MSG (hb > 0 && hm > 0,
"nodes' height must be greater then 0");
93 double log_aHeight = 13.82 * std::log10 (hb);
94 double log_bHeight = 0.0;
99 log_bHeight = 8.29 * std::pow (log10 (1.54 * hm), 2) - 1.1;
103 log_bHeight = 3.2 * std::pow (log10 (11.75 * hm), 2) - 4.97;
108 log_bHeight = 0.8 + (1.1 * log_f - 0.7) * hm - 1.56 * log_f;
111 NS_LOG_INFO (
this <<
" logf " << 26.16 * log_f <<
" loga " << log_aHeight <<
" X " << (((44.9 - (6.55 * std::log10 (hb)) )) * std::log10 (a->
GetDistanceFrom (b))) <<
" logb " << log_bHeight);
112 loss = 69.55 + (26.16 * log_f) - log_aHeight + (((44.9 - (6.55 * std::log10 (hb)) )) * std::log10 (dist)) - log_bHeight;
115 loss += -2 * (std::pow (std::log10 (fmhz / 28), 2)) - 5.4;
119 loss += -4.70 * std::pow (std::log10 (fmhz),2) + 18.33 * std::log10 (fmhz) - 40.94;
128 double log_f = std::log10 (fmhz);
131 NS_ASSERT_MSG (hb > 0 && hm > 0,
"nodes' height must be greater then 0");
132 double log_aHeight = 13.82 * std::log10 (hb);
133 double log_bHeight = 0.0;
138 log_bHeight = 3.2 * std::pow ((std::log10 (11.75 * hm)), 2);
143 log_bHeight = 1.1 * log_f - 0.7 * hm - (1.56 * log_f - 0.8);
146 loss = 46.3 + (33.9 * log_f) - log_aHeight + (((44.9 - (6.55 * std::log10 (hb)) )) * std::log10 (dist)) - log_bHeight + C;
156 return (txPowerDbm -
GetLoss (a, b));
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 GetDistanceFrom(Ptr< const MobilityModel > position) const
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
static TypeId GetTypeId(void)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Vector GetPosition(void) const
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
OkumuraHataPropagationLossModel()
double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
hold variables of type 'enum'
EnvironmentType m_environment
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Modelize the propagation loss through a transmission medium.
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero. ...
Hold a floating point type.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
double z
z coordinate of vector
virtual ~OkumuraHataPropagationLossModel()