23 #include "ns3/double.h"    25 #include "ns3/mobility-model.h"    40   static TypeId tid = 
TypeId (
"ns3::OkumuraHataPropagationLossModel")
    42     .SetGroupName (
"Propagation")
    44     .AddAttribute (
"Frequency",
    45                    "The propagation frequency in Hz",
    48                    MakeDoubleChecker<double> ())
    49     .AddAttribute (
"Environment",
    50                    "Environment Scenario",
    56     .AddAttribute (
"CitySize",
    57                    "Dimension of the city",
    85       double log_f = std::log10 (fmhz);
    88       NS_ASSERT_MSG (hb > 0 && hm > 0, 
"nodes' height must be greater then 0");
    89       double log_aHeight = 13.82 * std::log10 (hb);
    90       double log_bHeight = 0.0;
    95               log_bHeight = 8.29 * std::pow (log10 (1.54 * hm), 2) -  1.1;
    99               log_bHeight = 3.2 * std::pow (log10 (11.75 * hm), 2) - 4.97;
   104           log_bHeight = 0.8 + (1.1 * log_f - 0.7) * hm - 1.56 * log_f;
   107       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);
   108       loss = 69.55 + (26.16 * log_f) - log_aHeight + (((44.9 - (6.55 * std::log10 (hb)) )) * std::log10 (dist)) - log_bHeight;
   111           loss += -2 * (std::pow (std::log10 (fmhz / 28), 2)) - 5.4;
   115           loss += -4.70 * std::pow (std::log10 (fmhz),2) + 18.33 * std::log10 (fmhz) - 40.94;
   124       double log_f = std::log10 (fmhz);
   127       NS_ASSERT_MSG (hb > 0 && hm > 0, 
"nodes' height must be greater then 0");
   128       double log_aHeight = 13.82 * std::log10 (hb);
   129       double log_bHeight = 0.0;
   134           log_bHeight = 3.2 * std::pow ((std::log10 (11.75 * hm)), 2);
   139           log_bHeight = (1.1 * log_f - 0.7) * hm - (1.56 * log_f - 0.8);
   142       loss = 46.3 + (33.9 * log_f) - log_aHeight + (((44.9 - (6.55 * std::log10 (hb)) )) * std::log10 (dist)) - log_bHeight + C;
   152   return (txPowerDbm - 
GetLoss (a, b));
 this class implements the Okumura Hata propagation loss model 
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system. 
static TypeId GetTypeId(void)
Get the type ID. 
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name. 
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO. 
OkumuraHataPropagationLossModel()
Hold variables of type enum. 
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
 Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
double GetDistanceFrom(Ptr< const MobilityModel > position) const
double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account only the particular PropagationLossModel. 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
EnvironmentType m_environment
Environment Scenario. 
double m_frequency
frequency in Hz 
#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)
 Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Vector GetPosition(void) const
Models the propagation loss through a transmission medium. 
CitySize m_citySize
Size of the city. 
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero. ...
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name. 
This class can be used to hold variables of floating point type such as 'double' or 'float'...
a unique identifier for an interface. 
TypeId SetParent(TypeId tid)
Set the parent TypeId. 
virtual ~OkumuraHataPropagationLossModel()