24#include "ns3/double.h"
26#include "ns3/itu-r-1238-propagation-loss-model.h"
27#include "ns3/itu-r-1411-los-propagation-loss-model.h"
28#include "ns3/itu-r-1411-nlos-over-rooftop-propagation-loss-model.h"
29#include "ns3/kun-2600-mhz-propagation-loss-model.h"
31#include "ns3/mobility-model.h"
32#include "ns3/okumura-hata-propagation-loss-model.h"
33#include "ns3/pointer.h"
34#include <ns3/mobility-building-info.h>
47 m_okumuraHata = CreateObject<OkumuraHataPropagationLossModel>();
48 m_ituR1411Los = CreateObject<ItuR1411LosPropagationLossModel>();
50 m_ituR1238 = CreateObject<ItuR1238PropagationLossModel>();
51 m_kun2600Mhz = CreateObject<Kun2600MhzPropagationLossModel>();
62 TypeId(
"ns3::HybridBuildingsPropagationLossModel")
66 .AddConstructor<HybridBuildingsPropagationLossModel>()
67 .SetGroupName(
"Buildings")
69 .AddAttribute(
"Frequency",
70 "The Frequency (default is 2.106 GHz).",
73 MakeDoubleChecker<double>())
77 " Threshold from LoS to NLoS in ITU 1411 [m].",
80 MakeDoubleChecker<double>())
82 .AddAttribute(
"Environment",
83 "Environment Scenario",
95 "Dimension of the city",
102 "The height of the rooftop level in meters",
105 MakeDoubleChecker<double>(0.0, 90.0))
147 (a->GetPosition().z >= 0) && (b->GetPosition().z >= 0),
148 "HybridBuildingsPropagationLossModel does not support underground nodes (placed at z < 0)");
150 double distance = a->GetDistanceFrom(b);
156 "HybridBuildingsPropagationLossModel only works with MobilityBuildingInfo");
159 bool isAIndoor = a1->IsIndoor();
160 bool isBIndoor = b1->IsIndoor();
173 NS_LOG_INFO(
this <<
" 0-0 (>1000): below rooftop -> ITUR1411 : " << loss);
179 NS_LOG_INFO(
this <<
" O-O (>1000): above rooftop -> OH : " << loss);
186 NS_LOG_INFO(
this <<
" 0-0 (<1000) Street canyon -> ITUR1411 : " << loss);
198 NS_LOG_INFO(
this <<
" 0-I (>1000): below rooftop -> ITUR1411 : " << loss);
203 NS_LOG_INFO(
this <<
" O-I (>1000): above the rooftop -> OH : " << loss);
209 NS_LOG_INFO(
this <<
" 0-I (<1000) ITUR1411 + BEL : " << loss);
218 if (a1->GetBuilding() == b1->GetBuilding())
222 NS_LOG_INFO(
this <<
" I-I (same building) ITUR1238 : " << loss);
228 NS_LOG_INFO(
this <<
" I-I (different) ITUR1238 + 2*BEL : " << loss);
240 NS_LOG_INFO(
this <<
" I-O (>1000): down rooftop -> ITUR1411 : " << loss);
246 NS_LOG_INFO(
this <<
" =I-O (>1000) over rooftop OH + BEL + HG: " << loss);
252 NS_LOG_INFO(
this <<
" I-O (<1000) ITUR1411 + BEL + HG: " << loss);
257 loss = std::max(loss, 0.0);
This model provides means for simulating the following propagation phenomena in the presence of build...
double HeightLoss(Ptr< MobilityBuildingInfo > n) const
Calculate the height loss.
double ExternalWallLoss(Ptr< MobilityBuildingInfo > a) const
Calculate the external wall loss.
double InternalWallsLoss(Ptr< MobilityBuildingInfo > a, Ptr< MobilityBuildingInfo > b) const
Calculate the internal wall loss.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Hold variables of type enum.
void SetCitySize(CitySize size)
set the size of the city
double OkumuraHata(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Compute the path loss using either OkumuraHataPropagationLossModel or Kun2600MhzPropagationLossModel.
double m_rooftopHeight
Roof Height (in meters)
static TypeId GetTypeId()
Get the type ID.
Ptr< ItuR1411NlosOverRooftopPropagationLossModel > m_ituR1411NlosOverRooftop
ItuR1411NlosOverRooftopPropagationLossModel.
void SetFrequency(double freq)
set the propagation frequency
void SetRooftopHeight(double rooftopHeight)
set the rooftop height
Ptr< ItuR1411LosPropagationLossModel > m_ituR1411Los
ItuR1411LosPropagationLossModel.
double m_frequency
Operation frequency.
HybridBuildingsPropagationLossModel()
double m_itu1411NlosThreshold
in meters (switch Los -> NLoS)
double ItuR1411(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Compute the path loss using either ItuR1411LosPropagationLossModel or ItuR1411NlosOverRooftopPropagat...
~HybridBuildingsPropagationLossModel() override
Ptr< Kun2600MhzPropagationLossModel > m_kun2600Mhz
Kun2600MhzPropagationLossModel.
double ItuR1238(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Compute the path loss using ItuR1238PropagationLossModel.
Ptr< OkumuraHataPropagationLossModel > m_okumuraHata
OkumuraHataPropagationLossModel.
void SetEnvironment(EnvironmentType env)
set the environment type
double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const override
Compute the path loss according to the nodes position using the appropriate model.
Ptr< ItuR1238PropagationLossModel > m_ituR1238
ItuR1238PropagationLossModel.
mobility buildings information (to be used by mobility models)
Smart pointer class similar to boost::intrusive_ptr.
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)
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
#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.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
EnvironmentType
The type of propagation environment.
CitySize
The size of the city in which propagation takes place.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.