26 #include "ns3/mobility-model.h"
27 #include "ns3/double.h"
28 #include "ns3/pointer.h"
29 #include "ns3/okumura-hata-propagation-loss-model.h"
30 #include "ns3/itu-r-1411-los-propagation-loss-model.h"
31 #include "ns3/itu-r-1411-nlos-over-rooftop-propagation-loss-model.h"
32 #include "ns3/itu-r-1238-propagation-loss-model.h"
33 #include "ns3/kun-2600-mhz-propagation-loss-model.h"
34 #include <ns3/mobility-building-info.h>
50 m_okumuraHata = CreateObject<OkumuraHataPropagationLossModel> ();
51 m_ituR1411Los = CreateObject<ItuR1411LosPropagationLossModel> ();
53 m_ituR1238 = CreateObject<ItuR1238PropagationLossModel> ();
54 m_kun2600Mhz = CreateObject<Kun2600MhzPropagationLossModel> ();
64 static TypeId tid =
TypeId (
"ns3::HybridBuildingsPropagationLossModel")
68 .AddConstructor<HybridBuildingsPropagationLossModel> ()
70 .AddAttribute (
"Frequency",
71 "The Frequency (default is 2.106 GHz).",
74 MakeDoubleChecker<double> ())
76 .AddAttribute (
"Los2NlosThr",
77 " Threshold from LoS to NLoS in ITU 1411 [m].",
80 MakeDoubleChecker<double> ())
82 .AddAttribute (
"Environment",
83 "Environment Scenario",
90 .AddAttribute (
"CitySize",
91 "Dimension of the city",
98 .AddAttribute (
"RooftopLevel",
99 "The height of the rooftop level in meters",
102 MakeDoubleChecker<double> (0.0, 90.0))
152 NS_ASSERT_MSG ((a1 != 0) && (b1 != 0),
"HybridBuildingsPropagationLossModel only works with MobilityBuildingInfo");
156 if (a1->IsOutdoor ())
158 if (b1->IsOutdoor ())
167 NS_LOG_INFO (
this <<
" 0-0 (>1000): below rooftop -> ITUR1411 : " << loss);
173 NS_LOG_INFO (
this <<
" O-O (>1000): above rooftop -> OH : " << loss);
180 NS_LOG_INFO (
this <<
" 0-0 (<1000) Street canyon -> ITUR1411 : " << loss);
192 NS_LOG_INFO (
this <<
" 0-I (>1000): below rooftop -> ITUR1411 : " << loss);
197 NS_LOG_INFO (
this <<
" O-I (>1000): above the rooftop -> OH : " << loss);
203 NS_LOG_INFO (
this <<
" 0-I (<1000) ITUR1411 + BEL : " << loss);
212 if (a1->GetBuilding () == b1->GetBuilding ())
216 NS_LOG_INFO (
this <<
" I-I (same building) ITUR1238 : " << loss);
223 NS_LOG_INFO (
this <<
" I-I (different) ITUR1238 + 2*BEL : " << loss);
235 NS_LOG_INFO (
this <<
" I-O (>1000): down rooftop -> ITUR1411 : " << loss);
241 NS_LOG_INFO (
this <<
" =I-O (>1000) over rooftop OH + BEL + HG: " << loss);
247 NS_LOG_INFO (
this <<
" I-O (<1000) ITUR1411 + BEL + HG: " << loss);
252 loss = std::max (loss, 0.0);
Ptr< const AttributeChecker > MakeEnumChecker(int v1, std::string n1, int v2, std::string n2, int v3, std::string n3, int v4, std::string n4, int v5, std::string n5, int v6, std::string n6, int v7, std::string n7, int v8, std::string n8, int v9, std::string n9, int v10, std::string n10, int v11, std::string n11, int v12, std::string n12, int v13, std::string n13, int v14, std::string n14, int v15, std::string n15, int v16, std::string n16, int v17, std::string n17, int v18, std::string n18, int v19, std::string n19, int v20, std::string n20, int v21, std::string n21, int v22, std::string n22)
void SetEnvironment(EnvironmentType env)
set the environment type
EnvironmentType
The type of propagation environment.
void SetFrequency(double freq)
set the propagation frequency
double GetDistanceFrom(Ptr< const MobilityModel > position) const
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
double ItuR1411(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
virtual double GetLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Vector GetPosition(void) const
double HeightLoss(Ptr< MobilityBuildingInfo > n) const
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Ptr< ItuR1238PropagationLossModel > m_ituR1238
static TypeId GetTypeId(void)
This model provides means for simulating the following propagation phenomena in the presence of build...
double OkumuraHata(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
hold variables of type 'enum'
Ptr< ItuR1411NlosOverRooftopPropagationLossModel > m_ituR1411NlosOverRooftop
double ItuR1238(Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
void SetRooftopHeight(double rooftopHeight)
set the rooftop height
HybridBuildingsPropagationLossModel()
void SetCitySize(CitySize size)
set the size of the city
Ptr< OkumuraHataPropagationLossModel > m_okumuraHata
double m_itu1411NlosThreshold
in meters (switch Los -> NLoS)
Ptr< ItuR1411LosPropagationLossModel > m_ituR1411Los
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
CitySize
The size of the city in which propagation takes place.
mobility buildings information (to be used by mobility models)
Ptr< Kun2600MhzPropagationLossModel > m_kun2600Mhz
~HybridBuildingsPropagationLossModel()
double ExternalWallLoss(Ptr< MobilityBuildingInfo > a) const
Hold a floating point type.
Ptr< T > GetObject(void) const
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
double InternalWallsLoss(Ptr< MobilityBuildingInfo > a, Ptr< MobilityBuildingInfo > b) const
double z
z coordinate of vector