22 #include "ns3/propagation-loss-model.h"
24 #include "ns3/mobility-model.h"
25 #include "ns3/double.h"
26 #include "ns3/pointer.h"
38 static TypeId tid =
TypeId (
"ns3::Cost231PropagationLossModel")
42 .AddConstructor<Cost231PropagationLossModel> ()
44 .AddAttribute (
"Lambda",
45 "The wavelength (default is 2.3 GHz at 300 000 km/s).",
48 MakeDoubleChecker<double> ())
50 .AddAttribute (
"Frequency",
51 "The Frequency (default is 2.3 GHz).",
54 MakeDoubleChecker<double> ())
56 .AddAttribute (
"BSAntennaHeight",
57 " BS Antenna Height (default is 50m).",
60 MakeDoubleChecker<double> ())
62 .AddAttribute (
"SSAntennaHeight",
63 " SS Antenna Height (default is 3m).",
66 MakeDoubleChecker<double> ())
68 .AddAttribute (
"MinDistance",
69 "The distance under which the propagation model refuses to give results (m) ",
72 MakeDoubleChecker<double> ());
171 double distance_km = distance * 1e-3;
173 double C_H = 0.8 + ((1.11 * std::log10(frequency_MHz)) - 0.7) *
m_SSAntennaHeight - (1.56 * std::log10(frequency_MHz));
179 double loss_in_db = 46.3 + (33.9 * std::log10(frequency_MHz)) - (13.82 * std::log10 (
m_BSAntennaHeight)) - C_H
182 NS_LOG_DEBUG (
"dist =" << distance <<
", Path Loss = " << loss_in_db);
184 return (0 - loss_in_db);
191 return txPowerDbm +
GetLoss (a, b);
double GetMinDistance(void) const
double GetDistanceFrom(Ptr< const MobilityModel > position) const
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
Cost231PropagationLossModel()
void SetShadowing(double shadowing)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Environment GetEnvironment(void) const
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
static TypeId GetTypeId(void)
Environment m_environment
void SetEnvironment(Environment env)
double GetBSAntennaHeight(void) const
virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero. ...
double GetShadowing(void)
void SetBSAntennaHeight(double height)
void SetSSAntennaHeight(double height)
void SetMinDistance(double minDistance)
Modelize the propagation loss through a transmission medium.
double GetSSAntennaHeight(void) const
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
void SetLambda(double lambda)
double GetLambda(void) const
double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Hold a floating point type.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)