23 #include "ns3/double.h"
25 #include "ns3/mobility-model.h"
29 #include <ns3/mobility-building-info.h>
41 static TypeId tid =
TypeId (
"ns3::ItuR1238PropagationLossModel")
44 .SetGroupName (
"Buildings")
46 .AddAttribute (
"Frequency",
47 "The Frequency (default is 2.106 GHz).",
50 MakeDoubleChecker<double> ());
61 NS_ASSERT_MSG ((a != 0) && (b != 0),
"ItuR1238PropagationLossModel only works with MobilityBuildingInfo");
62 NS_ASSERT_MSG (a->GetBuilding ()->GetId () == b->GetBuilding ()->GetId (),
"ITU-R 1238 applies only to nodes that are in the same building");
64 int n = std::abs (a->GetFloorNumber () - b->GetFloorNumber ());
65 NS_LOG_LOGIC (
this <<
" A floor " << (uint16_t)a->GetFloorNumber () <<
" B floor " << (uint16_t)b->GetFloorNumber () <<
" n " << n);
82 Lf = 15 + (4 * (n - 1));
91 Lf = 6 + (3 * (n - 1));
111 return (txPowerDbm -
GetLoss (a, b));
This class can be used to hold variables of floating point type such as 'double' or 'float'.
double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
virtual double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
PropagationLossModel.
virtual int64_t DoAssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
static TypeId GetTypeId(void)
Get the type ID.
double m_frequency
frequency in MHz
mobility buildings information (to be used by mobility models)
double GetDistanceFrom(Ptr< const MobilityModel > position) const
Vector GetPosition(void) const
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Models the propagation loss through a transmission medium.
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)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
#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_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#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.