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));
 virtual int64_t DoAssignStreams(int64_t stream)
Subclasses must implement this; those not using random variables can return zero. ...
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system. 
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
#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. 
double GetDistanceFrom(Ptr< const MobilityModel > position) const
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object. 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
static TypeId GetTypeId(void)
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. 
double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
mobility buildings information (to be used by mobility models) 
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR. 
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 double DoCalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account only the particular PropagationLossModel. 
double m_frequency
frequency in MHz