25 #include "ns3/double.h"
27 #include "ns3/mobility-model.h"
28 #include "ns3/pointer.h"
43 TypeId(
"ns3::Cost231PropagationLossModel")
45 .SetGroupName(
"Propagation")
47 .AddAttribute(
"Lambda",
48 "The wavelength (default is 2.3 GHz at 300 000 km/s).",
51 MakeDoubleChecker<double>())
52 .AddAttribute(
"Frequency",
53 "The Frequency (default is 2.3 GHz).",
56 MakeDoubleChecker<double>())
57 .AddAttribute(
"BSAntennaHeight",
58 "BS Antenna Height (default is 50m).",
61 MakeDoubleChecker<double>())
62 .AddAttribute(
"SSAntennaHeight",
63 "SS Antenna Height (default is 3m).",
66 MakeDoubleChecker<double>())
69 "The distance under which the propagation model refuses to give results (m).",
73 MakeDoubleChecker<double>());
159 double logFrequencyMhz = std::log10(
m_frequency * 1e-6);
160 double logDistanceKm = std::log10(distance * 1e-3);
164 0.8 + ((1.11 * logFrequencyMhz) - 0.7) *
m_SSAntennaHeight - (1.56 * logFrequencyMhz);
170 double loss_in_db = 46.3 + (33.9 * logFrequencyMhz) - (13.82 * logBSAntennaHeight) - C_H +
171 ((44.9 - 6.55 * logBSAntennaHeight) * logDistanceKm) +
m_shadowing;
173 NS_LOG_DEBUG(
"dist =" << distance <<
", Path Loss = " << loss_in_db);
175 return (0 - loss_in_db);
183 return txPowerDbm +
GetLoss(a, b);
The COST-Hata-Model is the most often cited of the COST 231 models.
double GetShadowing() const
Get the shadowing value.
void SetShadowing(double shadowing)
Set the shadowing value.
double m_SSAntennaHeight
SS Antenna Height [m].
double GetLambda() const
Get the wavelength.
double m_lambda
The wavelength.
void SetBSAntennaHeight(double height)
Set the BS antenna height.
static TypeId GetTypeId()
Get the type ID.
int64_t DoAssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
double m_frequency
frequency [Hz]
double GetBSAntennaHeight() const
Get the BS antenna height.
Cost231PropagationLossModel()
double GetSSAntennaHeight() const
Get the SS antenna height.
double GetMinDistance() const
Get the minimum model distance.
void SetSSAntennaHeight(double height)
Set the SS antenna height.
void SetLambda(double lambda)
Set the wavelength.
double m_minDistance
minimum distance [m]
void SetMinDistance(double minDistance)
Set the minimum model distance.
double m_BSAntennaHeight
BS Antenna Height [m].
double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Get the propagation loss.
double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
PropagationLossModel.
double m_shadowing
Shadowing loss [dB].
This class can be used to hold variables of floating point type such as 'double' or 'float'.
double GetDistanceFrom(Ptr< const MobilityModel > position) const
Models the propagation loss through a transmission medium.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#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 AttributeAccessor > MakeDoubleAccessor(T1 a1)