diff --git a/src/buildings/doc/source/buildings-design.rst b/src/buildings/doc/source/buildings-design.rst index beaa1c310..08af2bddf 100644 --- a/src/buildings/doc/source/buildings-design.rst +++ b/src/buildings/doc/source/buildings-design.rst @@ -11,13 +11,18 @@ Overview The Buildings module provides: - #. a new class (Building) that models the presence of a building in a simulation scenario; - #. a new mobility model (BuildingsMobilityModel) that allows to specify the location, size and characteristics of buildings present in the simulated area, and allows the placement of nodes inside those buildings; - #. a new propagation model (BuildingsPropagationLossModel) working with the mobility model just introduced, that allows to model the phenomenon of indoor/outdoor propagation in the presence of buildings. + #. a new class (``Building``) that models the presence of a building in a simulation scenario; + #. a new mobility model (``BuildingsMobilityModel``) that allows to specify the location, size and characteristics of buildings present in the simulated area, and allows the placement of nodes inside those buildings; + #. a container class with the definition of the most useful pathloss models and the correspondent variables called ``BuildingsPropagationLossModel``. + #. a new propagation model (``HybridBuildingsPropagationLossModel``) working with the mobility model just introduced, that allows to model the phenomenon of indoor/outdoor propagation in the presence of buildings. + #. a simplified model working only with Okumura Hata (``OhBuildingsPropagationLossModel``) considering the phenomenon of indoor/outdoor propagation in the presence of buildings. -Both models have been designed with LTE in mind, though their implementation is in fact independent from any LTE-specific code, and can be used with other ns-3 wireless technologies as well (e.g., wifi). +The models have been designed with LTE in mind, though their implementation is in fact independent from any LTE-specific code, and can be used with other ns-3 wireless technologies as well (e.g., wifi). + +The ``HybridBuildingsPropagationLossModel`` pathloss model included is obtained through a combination of several well known pathloss models in order to mimic different environmental scenarios such as urban, suburban and open areas. Moreover, the model considers both outdoor and indoor indoor and outdoor communication has to be included since HeNB might be installed either within building and either outside. In case of indoor communication, the model has to consider also the type of building in outdoor <-> indoor communication according to some general criteria such as the wall penetration losses of the common materials; moreover it includes some general configuration for the internal walls in indoor communications. Finally, the frequency also represent an important parameter since it spans from 600 MHz up to 2600 MHz according to [TS36.101]_. + +The ``OhBuildingsPropagationLossModel`` pathloss model has been created for simplifying the previous one removing the thresholds for switching from one model to other. For doing this it has been used only one propagation model from the one available (i.e., the Okumura Hata). The presence of building is still considered in the model; therefore all the considerations of above regarding the building type are still valid. The same consideration can be done for what concern the environmental scenario and frequency since both of them are parameters of the model considered. -The pathloss model included is obtained through a combination of several well known pathloss models in order to mimic different environmental scenarios such as urban, suburban and open areas. Moreover, the model considers both outdoor and indoor indoor and outdoor communication has to be included since HeNB might be installed either within building and either outside. In case of indoor communication, the model has to consider also the type of building in outdoor <-> indoor communication according to some general criteria such as the wall penetration losses of the common materials; moreover it includes some general configuration for the internal walls in indoor communications. Finally, the frequency also represent an important parameter since it spans from 600 MHz up to 2600 MHz according to [TS36.101]_. The Building class ++++++++++++++++++ @@ -47,8 +52,8 @@ The ``Building`` class is included in ``BuildingsMobilityModel`` class, which in The class ``BuildingsMobilityModel`` is used by ``BuildingsPropagationLossModel`` class, which inherits from the ns3 class ``PropagationLossModel`` and manages the pathloss computation of the single components and their composition according to the nodes' positions. Moreover, it implements also the shadowing, that is the loss due to obstacles in the main path (i.e., vegetation, buildings, etc.). -Pathloss models used in BuildingsPropagationLossModel -+++++++++++++++++++++++++++++++++++++++++++++++++++++ +Pathloss models available in BuildingsPropagationLossModel +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ In the following we present the pathloss models that are included in the BuildingsPropagationLossModel @@ -333,10 +338,10 @@ The pathloss model characterizes the hybrid cases (i.e., when an outdoor node tr -Pathloss Model Logic of BuildingsPropagationLossModel -+++++++++++++++++++++++++++++++++++++++++++++++++++++ +Pathloss Model Logic of HybridBuildingsPropagationLossModel ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -The following pseudo-code illustrates how the different pathloss models described above are integrated in the BuildingsPropagationLossModel:: +The following pseudo-code illustrates how the different pathloss models described above are integrated in the ``HybridBuildingsPropagationLossModel``:: if (txNode is outdoor) then @@ -382,6 +387,31 @@ The following pseudo-code illustrates how the different pathloss models describe We note that, for the case of communication between two nodes below rooftop level with distance is greater then 1 km, we still consider the I1411 model, since OH is specifically designed for macro cells and therefore for antennas above the roof-top level. Finally, we introduced a threshold called ``m_itu1411DistanceThreshold``) for pruning the communications between nodes below rooftop when the distance is too large (the default values is 2 km). +Pathloss Model Logic of OhBuildingsPropagationLossModel ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +The following pseudo-code illustrates how the different pathloss models described above are integrated in the ``OhBuildingsPropagationLossModel``:: + + if (txNode is outdoor) + then + if (rxNode is outdoor) + then + L = OH + else (rxNode is indoor) + L = OH + BEL + else (txNode is indoor) + if (rxNode is indoor) + then + if (same building) + then + L = OH + else + L = OH + 2*BEL + else (rxNode is outdoor) + L = OH + BEL + + + Shadowing Model +++++++++++++++ diff --git a/src/buildings/doc/source/buildings-user.rst b/src/buildings/doc/source/buildings-user.rst index dee709ca2..fa3d5f3f3 100644 --- a/src/buildings/doc/source/buildings-user.rst +++ b/src/buildings/doc/source/buildings-user.rst @@ -18,13 +18,13 @@ The ``Building`` class has the following configurable parameters: * number of floors. * number of rooms in x-axis and y-axis (rooms can be placed only in a grid way). -The ``BuildingMobilityModel`` parameter configurable with the ns3 attribute system is represented by the bound (string ``Bounds``) of the simulation area by providing a ``Box`` class with the area bounds. Moreover, by means of its methos the following parameters can be configured: +The ``BuildingMobilityLossModel`` parameter configurable with the ns3 attribute system is represented by the bound (string ``Bounds``) of the simulation area by providing a ``Box`` class with the area bounds. Moreover, by means of its methos the following parameters can be configured: * the number of floor the node is placed (default 0). * the position in the rooms grid. -The ``BuildingPropagationModel`` class has the following configurable parameters configurable with the attribute system: +The ``BuildingPropagationLossModel`` class has the following configurable parameters configurable with the attribute system: * ``Frequency``: reference frequency (default 2160 MHz), note that by setting the frequency the wavelength is set accordingly automatically and viceversa). * ``Lambda``: the wavelength (0.139 meters, considering the above frequency). @@ -38,6 +38,9 @@ The ``BuildingPropagationModel`` class has the following configurable parameters * ``Environment``: the environment scenario among Urban, SubUrban and OpenAreas (default Urban). * ``CitySize``: the dimension of the city among Small, Medium, Large (default Large). +In order to use the hybrid mode, the class to be used is the ``HybridBuildingMobilityLossModel``, which allows the selection of the proper pathloss model according to the pathloss logic presented in the design chapter. However, this solution has the problem that the pathloss model switching points might present discontinuities due to the different characteristics of the model. This implies that according to the specific scenario, the threshold used for switching have to be properly tuned. +The simple ``OhBuildingMobilityLossModel`` overcome this problem by using only the Okumura Hata model and the wall penetration losses. + diff --git a/src/buildings/examples/buildings-pathloss-profiler.cc b/src/buildings/examples/buildings-pathloss-profiler.cc index 8455e5120..000d84060 100644 --- a/src/buildings/examples/buildings-pathloss-profiler.cc +++ b/src/buildings/examples/buildings-pathloss-profiler.cc @@ -23,7 +23,7 @@ #include "ns3/mobility-module.h" #include "ns3/lte-module.h" #include "ns3/config-store.h" -#include +#include #include #include @@ -73,7 +73,7 @@ main (int argc, char *argv[]) mmEnb->SetIndoor (building1); } - Ptr propagationLossModel = CreateObject (); + Ptr propagationLossModel = CreateObject (); // cancel shadowing effect propagationLossModel->SetAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0)); propagationLossModel->SetAttribute ("ShadowSigmaIndoor", DoubleValue (0.0)); diff --git a/src/buildings/model/buildings-propagation-loss-model.cc b/src/buildings/model/buildings-propagation-loss-model.cc index 098d23492..028500194 100644 --- a/src/buildings/model/buildings-propagation-loss-model.cc +++ b/src/buildings/model/buildings-propagation-loss-model.cc @@ -69,7 +69,7 @@ BuildingsPropagationLossModel::GetTypeId (void) .SetParent () - .AddConstructor () + //.AddConstructor () .AddAttribute ("Lambda", "The wavelength (default is 2.106 GHz at 300 000 km/s).", @@ -598,172 +598,210 @@ BuildingsPropagationLossModel::InternalWallsLoss (Ptr a, return m_lossInternalWall * (dx+dy); } + + +// double +// BuildingsPropagationLossModel::GetLoss (Ptr a, Ptr b) const +// { +// NS_ASSERT_MSG ((a->GetPosition ().z > 0) && (b->GetPosition ().z > 0), "BuildingsPropagationLossModel does not support underground nodes (placed at z < 0)"); +// +// +// double distance = a->GetDistanceFrom (b); +// if (distance <= m_minDistance) +// { +// return 0.0; +// } +// +// // get the BuildingsMobilityModel pointers +// Ptr a1 = DynamicCast (a); +// Ptr b1 = DynamicCast (b); +// NS_ASSERT_MSG ((a1 != 0) && (b1 != 0), "BuildingsPropagationLossModel only works with BuildingsMobilityModel"); +// +// double loss = 0.0; +// +// if (a1->IsOutdoor ()) +// { +// if (b1->IsOutdoor ()) +// { +// if (distance > 1000) +// { +// NS_LOG_INFO (this << a1->GetPosition ().z << b1->GetPosition ().z << m_rooftopHeight); +// if ((a1->GetPosition ().z < m_rooftopHeight) +// && (b1->GetPosition ().z < m_rooftopHeight)) +// { +// // ITU limit in distance (i.e., < 2000 for small cells) +// if (distance < m_itu1411DistanceThreshold) +// { +// // short range communication +// loss = ItuR1411 (a1, b1); +// NS_LOG_INFO (this << " 0-0 (>1000): down rooftop -> ITUR1411 : " << loss); +// } +// else +// { +// // out of bound +// loss = std::numeric_limits::infinity (); +// NS_LOG_INFO (this << " 0-0 (>2000): down rooftop -> Infinity (out of bound) : " << loss); +// } +// } +// else +// { +// // Over the rooftop tranmission -> Okumura Hata +// loss = OkumuraHata (a1, b1); +// NS_LOG_INFO (this << " O-O (>1000): Over the rooftop -> OH : " << loss); +// } +// } +// else +// { +// // short range outdoor communication +// loss = ItuR1411 (a1, b1); +// NS_LOG_INFO (this << " 0-0 (<1000) Street canyon -> ITUR1411 : " << loss); +// } +// } +// else +// { +// // b indoor +// if (distance > 1000) +// { +// if ((a1->GetPosition ().z < m_rooftopHeight) +// && (b1->GetPosition ().z < m_rooftopHeight)) +// { +// +// // ITU limit in distance (i.e., < 2000 for small cells) +// if (distance < m_itu1411DistanceThreshold) +// { +// // short range communication +// loss = ItuR1411 (a1, b1) + ExternalWallLoss (b1) + HeightLoss (a1); +// NS_LOG_INFO (this << " 0-I (>1000): down rooftop -> ITUR1411 : " << loss); +// } +// else +// { +// // out of bound +// loss = std::numeric_limits::infinity (); +// NS_LOG_INFO (this << " 0-I (>2000): down rooftop -> ITUR1411 : " << loss); +// } +// } +// else +// { +// // Over the rooftop tranmission -> Okumura Hata +// loss = OkumuraHata (a1, b1) + ExternalWallLoss (b1); +// NS_LOG_INFO (this << " O-I (>1000): Over the rooftop -> OH : " << loss); +// } +// } +// else +// { +// loss = ItuR1411 (a1, b1) + ExternalWallLoss (b1) + HeightLoss (b1); +// NS_LOG_INFO (this << " 0-I (<1000) ITUR1411 + BEL : " << loss); +// } +// } // end b1->isIndoor () +// } +// else +// { +// // a is indoor +// if (b1->IsIndoor ()) +// { +// if (a1->GetBuilding () == b1->GetBuilding ()) +// { +// // nodes are in same building -> indoor communication ITU-R P.1238 +// loss = ItuR1238 (a1, b1) + InternalWallsLoss (a1, b1);; +// NS_LOG_INFO (this << " I-I (same building) ITUR1238 : " << loss); +// +// } +// else +// { +// // nodes are in different buildings +// loss = ItuR1411 (a1, b1) + ExternalWallLoss (a1) + ExternalWallLoss (b1); +// NS_LOG_INFO (this << " I-I (different) ITUR1238 + 2*BEL : " << loss); +// } +// } +// else +// { +// // b is outdoor +// if (distance > 1000) +// { +// if ((a1->GetPosition ().z < m_rooftopHeight) +// && (b1->GetPosition ().z < m_rooftopHeight)) +// { +// +// // ITU limit in distance (i.e., < 2000 for small cells) +// if (distance < m_itu1411DistanceThreshold) +// { +// // short range communication +// loss = ItuR1411 (a1, b1) + ExternalWallLoss (a1) + HeightLoss (a1); +// NS_LOG_INFO (this << " I-O (>1000): down rooftop -> ITUR1411 : " << loss); +// } +// else +// { +// // out of bound +// loss = std::numeric_limits::infinity (); +// NS_LOG_INFO (this << " I-O (>2000): down rooftop -> ITUR1411 : " << loss); +// } +// } +// else +// { +// // above rooftop -> OH +// loss = OkumuraHata (a1, b1) + ExternalWallLoss (a1) + HeightLoss (a1); +// NS_LOG_INFO (this << " =I-O (>1000) over rooftop OH + BEL + HG: " << loss); +// } +// } +// else +// { +// loss = ItuR1411 (a1, b1) + ExternalWallLoss (a1) + HeightLoss (a1); +// NS_LOG_INFO (this << " I-O (<1000) ITUR1411 + BEL + HG: " << loss); +// } +// } // end b1->IsIndoor () +// } // end a1->IsOutdoor () +// +// // Evaluate the shadowing +// std::map, std::map, ShadowingLoss> >::iterator ait = m_shadowingLossMap.find (a); +// if (ait != m_shadowingLossMap.end ()) +// { +// std::map, ShadowingLoss>::iterator bit = ait->second.find (b); +// if (bit != ait->second.end ()) +// { +// return loss + bit->second.GetLoss (); +// } +// else +// { +// double sigma = EvaluateSigma (a1, b1); +// // side effect: will create new entry +// ait->second[b] = ShadowingLoss (0.0, sigma, b); +// return loss + ait->second[b].GetLoss (); +// } +// } +// else +// { +// double sigma = EvaluateSigma (a1, b1); +// // side effect: will create new entries in both maps +// m_shadowingLossMap[a][b] = ShadowingLoss (0.0, sigma, b); +// return loss + m_shadowingLossMap[a][b].GetLoss (); +// } +// +// } + + + double -BuildingsPropagationLossModel::GetLoss (Ptr a, Ptr b) const +BuildingsPropagationLossModel::GetShadowing (Ptr a, Ptr b) +const { - NS_ASSERT_MSG ((a->GetPosition ().z > 0) && (b->GetPosition ().z > 0), "BuildingsPropagationLossModel does not support underground nodes (placed at z < 0)"); - + Ptr a1 = DynamicCast (a); + Ptr b1 = DynamicCast (b); + NS_ASSERT_MSG ((a1 != 0) && (b1 != 0), "BuildingsPropagationLossModel only works with BuildingsMobilityModel"); - double distance = a->GetDistanceFrom (b); - if (distance <= m_minDistance) - { - return 0.0; - } - - // get the BuildingsMobilityModel pointers - Ptr a1 = DynamicCast (a); - Ptr b1 = DynamicCast (b); - NS_ASSERT_MSG ((a1 != 0) && (b1 != 0), "BuildingsPropagationLossModel only works with BuildingsMobilityModel"); - - double loss = 0.0; - - if (a1->IsOutdoor ()) - { - if (b1->IsOutdoor ()) - { - if (distance > 1000) - { - NS_LOG_INFO (this << a1->GetPosition ().z << b1->GetPosition ().z << m_rooftopHeight); - if ((a1->GetPosition ().z < m_rooftopHeight) - && (b1->GetPosition ().z < m_rooftopHeight)) - { - // ITU limit in distance (i.e., < 2000 for small cells) - if (distance < m_itu1411DistanceThreshold) - { - // short range communication - loss = ItuR1411 (a1, b1); - NS_LOG_INFO (this << " 0-0 (>1000): down rooftop -> ITUR1411 : " << loss); - } - else - { - // out of bound - loss = std::numeric_limits::infinity (); - NS_LOG_INFO (this << " 0-0 (>2000): down rooftop -> Infinity (out of bound) : " << loss); - } - } - else - { - // Over the rooftop tranmission -> Okumura Hata - loss = OkumuraHata (a1, b1); - NS_LOG_INFO (this << " O-O (>1000): Over the rooftop -> OH : " << loss); - } - } - else - { - // short range outdoor communication - loss = ItuR1411 (a1, b1); - NS_LOG_INFO (this << " 0-0 (<1000) Street canyon -> ITUR1411 : " << loss); - } - } - else - { - // b indoor - if (distance > 1000) - { - if ((a1->GetPosition ().z < m_rooftopHeight) - && (b1->GetPosition ().z < m_rooftopHeight)) - { - - // ITU limit in distance (i.e., < 2000 for small cells) - if (distance < m_itu1411DistanceThreshold) - { - // short range communication - loss = ItuR1411 (a1, b1) + ExternalWallLoss (b1) + HeightLoss (a1); - NS_LOG_INFO (this << " 0-I (>1000): down rooftop -> ITUR1411 : " << loss); - } - else - { - // out of bound - loss = std::numeric_limits::infinity (); - NS_LOG_INFO (this << " 0-I (>2000): down rooftop -> ITUR1411 : " << loss); - } - } - else - { - // Over the rooftop tranmission -> Okumura Hata - loss = OkumuraHata (a1, b1) + ExternalWallLoss (b1); - NS_LOG_INFO (this << " O-I (>1000): Over the rooftop -> OH : " << loss); - } - } - else - { - loss = ItuR1411 (a1, b1) + ExternalWallLoss (b1) + HeightLoss (b1); - NS_LOG_INFO (this << " 0-I (<1000) ITUR1411 + BEL : " << loss); - } - } // end b1->isIndoor () - } - else - { - // a is indoor - if (b1->IsIndoor ()) - { - if (a1->GetBuilding () == b1->GetBuilding ()) - { - // nodes are in same building -> indoor communication ITU-R P.1238 - loss = ItuR1238 (a1, b1) + InternalWallsLoss (a1, b1); - NS_LOG_INFO (this << " I-I (same building) ITUR1238 + internal walls: " << loss); - - } - else - { - // nodes are in different buildings - loss = ItuR1411 (a1, b1) + ExternalWallLoss (a1) + ExternalWallLoss (b1); - NS_LOG_INFO (this << " I-I (different) ITUR1238 + 2*BEL : " << loss); - } - } - else - { - // b is outdoor - if (distance > 1000) - { - if ((a1->GetPosition ().z < m_rooftopHeight) - && (b1->GetPosition ().z < m_rooftopHeight)) - { - - // ITU limit in distance (i.e., < 2000 for small cells) - if (distance < m_itu1411DistanceThreshold) - { - // short range communication - loss = ItuR1411 (a1, b1) + ExternalWallLoss (a1) + HeightLoss (a1); - NS_LOG_INFO (this << " I-O (>1000): down rooftop -> ITUR1411 : " << loss); - } - else - { - // out of bound - loss = std::numeric_limits::infinity (); - NS_LOG_INFO (this << " I-O (>2000): down rooftop -> ITUR1411 : " << loss); - } - } - else - { - // above rooftop -> OH - loss = OkumuraHata (a1, b1) + ExternalWallLoss (a1) + HeightLoss (a1); - NS_LOG_INFO (this << " =I-O (>1000) over rooftop OH + BEL + HG: " << loss); - } - } - else - { - loss = ItuR1411 (a1, b1) + ExternalWallLoss (a1) + HeightLoss (a1); - NS_LOG_INFO (this << " I-O (<1000) ITUR1411 + BEL + HG: " << loss); - } - } // end b1->IsIndoor () - } // end a1->IsOutdoor () - - // Evaluate the shadowing std::map, std::map, ShadowingLoss> >::iterator ait = m_shadowingLossMap.find (a); if (ait != m_shadowingLossMap.end ()) { std::map, ShadowingLoss>::iterator bit = ait->second.find (b); if (bit != ait->second.end ()) { - return loss + bit->second.GetLoss (); + return (bit->second.GetLoss ()); } else { double sigma = EvaluateSigma (a1, b1); // side effect: will create new entry ait->second[b] = ShadowingLoss (0.0, sigma, b); - return loss + ait->second[b].GetLoss (); + return (ait->second[b].GetLoss ()); } } else @@ -771,11 +809,12 @@ BuildingsPropagationLossModel::GetLoss (Ptr a, Ptr double sigma = EvaluateSigma (a1, b1); // side effect: will create new entries in both maps m_shadowingLossMap[a][b] = ShadowingLoss (0.0, sigma, b); - return loss + m_shadowingLossMap[a][b].GetLoss (); + return (m_shadowingLossMap[a][b].GetLoss ()); } - } + + double BuildingsPropagationLossModel::EvaluateSigma (Ptr a, Ptr b) const @@ -808,7 +847,7 @@ const double BuildingsPropagationLossModel::DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const { - return txPowerDbm - GetLoss (a, b); + return txPowerDbm - GetLoss (a, b) - GetShadowing (a, b); } diff --git a/src/buildings/model/buildings-propagation-loss-model.h b/src/buildings/model/buildings-propagation-loss-model.h index 8c7db13f7..f6ca189e0 100644 --- a/src/buildings/model/buildings-propagation-loss-model.h +++ b/src/buildings/model/buildings-propagation-loss-model.h @@ -27,8 +27,6 @@ #include #include -// #include -// #include namespace ns3 { @@ -80,7 +78,7 @@ public: * \param b the mobility model of the destination * \returns the propagation loss (in dBm) */ - double GetLoss (Ptr a, Ptr b) const; + virtual double GetLoss (Ptr a, Ptr b) const = 0; void SetEnvironment (Environment env); void SetCitySize (CitySize size); void SetLambda (double lambda); @@ -94,18 +92,21 @@ public: // void SetLambda (double frequency, double speed); -private: virtual double DoCalcRxPower (double txPowerDbm, Ptr a, Ptr b) const; - double OkumuraHata (Ptr a, Ptr b) const; - double ItuR1411 (Ptr a, Ptr b) const; - double ItuR1411Los (Ptr a, Ptr b) const; - double ItuR1411NlosOverRooftop (Ptr a, Ptr b) const; +protected: + virtual double OkumuraHata (Ptr a, Ptr b) const; + virtual double ItuR1411 (Ptr a, Ptr b) const; + virtual double ItuR1411Los (Ptr a, Ptr b) const; + virtual double ItuR1411NlosOverRooftop (Ptr a, Ptr b) const; // double ItuR1411NlosStreetCanyons (Ptr a, Ptr b) const; double ItuR1238 (Ptr a, Ptr b) const; double ExternalWallLoss (Ptr a) const; double HeightLoss (Ptr n) const; double InternalWallsLoss (Ptr a, Ptr b) const; + + double GetShadowing (Ptr a, Ptr b) + const; double C; // OH loss coefficient for the environment double N; // ITU-R P.1238: power loss coefficient @@ -131,7 +132,7 @@ private: ShadowingLoss (double mean, double sigma, Ptr receiver); double GetLoss () const; Ptr GetReceiver (void) const; - private: + protected: Ptr m_receiver; NormalVariable m_randVariable; double m_shadowingValue; @@ -149,4 +150,4 @@ private: } -#endif /* COST231PROPAGATIONMODEL_H_ */ +#endif /* BUILDINGS_PROPAGATION_LOSS_MODEL_H_ */ diff --git a/src/buildings/test/buildings-pathloss-test.cc b/src/buildings/test/buildings-pathloss-test.cc index 344936c78..b20c61127 100644 --- a/src/buildings/test/buildings-pathloss-test.cc +++ b/src/buildings/test/buildings-pathloss-test.cc @@ -178,6 +178,7 @@ BuildingsPathlossTestCase::DoRun (void) // LogComponentEnable ("LteEnbNetDevice", logLevel); LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL); + LogComponentEnable ("HybridBuildingsPropagationLossModel", LOG_LEVEL_ALL); NS_LOG_FUNCTION (this); @@ -187,7 +188,7 @@ BuildingsPathlossTestCase::DoRun (void) - Ptr propagationLossModel = CreateObject (); + Ptr propagationLossModel = CreateObject (); propagationLossModel->SetAttribute ("Frequency", DoubleValue (m_freq)); propagationLossModel->SetAttribute ("Lambda", DoubleValue (300000000.0 / m_freq)); propagationLossModel->SetAttribute ("Environment", EnumValue (m_env)); diff --git a/src/buildings/test/buildings-pathloss-test.h b/src/buildings/test/buildings-pathloss-test.h index 306fbbfe0..3dfc9c1c0 100644 --- a/src/buildings/test/buildings-pathloss-test.h +++ b/src/buildings/test/buildings-pathloss-test.h @@ -23,7 +23,7 @@ #include #include -#include +#include namespace ns3 { diff --git a/src/buildings/test/buildings-shadowing-test.cc b/src/buildings/test/buildings-shadowing-test.cc index 1bd6aa5d4..ddb3162f7 100644 --- a/src/buildings/test/buildings-shadowing-test.cc +++ b/src/buildings/test/buildings-shadowing-test.cc @@ -21,7 +21,7 @@ #include "ns3/simulator.h" #include "ns3/log.h" #include "ns3/buildings-shadowing-test.h" -#include +#include #include "ns3/string.h" #include "ns3/double.h" #include @@ -122,8 +122,8 @@ BuildingsShadowingTestCase::DoRun (void) int samples = 10000; for (int i = 0; i < samples; i++) { - Ptr propagationLossModel = CreateObject (); - loss.push_back (propagationLossModel->GetLoss (mma, mmb) - m_lossRef); + Ptr propagationLossModel = CreateObject (); + loss.push_back (propagationLossModel->DoCalcRxPower (0.0, mma, mmb) + m_lossRef); sum += loss.at (loss.size () - 1); sumSquared += (loss.at (loss.size () - 1) * loss.at (loss.size () - 1)); } diff --git a/src/buildings/wscript b/src/buildings/wscript index b02f4d0d7..c6dcde802 100644 --- a/src/buildings/wscript +++ b/src/buildings/wscript @@ -8,6 +8,8 @@ def build(bld): 'model/building-list.cc', 'model/buildings-mobility-model.cc', 'model/buildings-propagation-loss-model.cc', + 'model/hybrid-buildings-propagation-loss-model.cc', + 'model/oh-buildings-propagation-loss-model.cc', 'helper/buildings-helper.cc', ] @@ -25,6 +27,8 @@ def build(bld): 'model/building-list.h', 'model/buildings-mobility-model.h', 'model/buildings-propagation-loss-model.h', + 'model/hybrid-buildings-propagation-loss-model.h', + 'model/oh-buildings-propagation-loss-model.h', 'helper/buildings-helper.h', 'test/buildings-pathloss-test.h', 'test/buildings-shadowing-test.h', diff --git a/src/lte/test/lte-test-pathloss-model.cc b/src/lte/test/lte-test-pathloss-model.cc index b1599c8d2..0e0a5c705 100644 --- a/src/lte/test/lte-test-pathloss-model.cc +++ b/src/lte/test/lte-test-pathloss-model.cc @@ -29,7 +29,7 @@ #include "ns3/lte-sinr-chunk-processor.h" #include "ns3/lte-test-pathloss-model.h" -#include +#include #include #include #include @@ -200,14 +200,15 @@ LtePathlossModelSystemTestCase::DoRun (void) // LogComponentEnable ("LteUePhy", LOG_LEVEL_ALL); // LogComponentEnable ("SingleModelSpectrumChannel", LOG_LEVEL_ALL); LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL); + LogComponentEnable ("HybridBuildingsPropagationLossModel", LOG_LEVEL_ALL); // LogComponentEnable ("LteHelper", LOG_LEVEL_ALL); -// LogComponentDisable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL); + // Ptr lteHelper = CreateObject (); // lteHelper->EnableLogComponents (); lteHelper->EnableMacTraces (); lteHelper->EnableRlcTraces (); - lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::BuildingsPropagationLossModel")); + lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::HybridBuildingsPropagationLossModel")); // set frequency. This is important because it changes the behavior of the pathloss model lteHelper->SetEnbDeviceAttribute ("DlEarfcn", UintegerValue (200)); diff --git a/src/lte/test/lte-test-phy-error-model.cc b/src/lte/test/lte-test-phy-error-model.cc index bb50071fa..2a0c694f1 100644 --- a/src/lte/test/lte-test-phy-error-model.cc +++ b/src/lte/test/lte-test-phy-error-model.cc @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "ns3/lte-test-phy-error-model.h" #include #include @@ -175,7 +175,7 @@ LenaPhyErrorModelTestCase::DoRun (void) mobility.Install (ueNodes); // remove random shadowing component - lena->SetAttribute ("PathlossModel", StringValue ("ns3::BuildingsPropagationLossModel")); + lena->SetAttribute ("PathlossModel", StringValue ("ns3::HybridBuildingsPropagationLossModel")); lena->SetPathlossModelAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0)); lena->SetPathlossModelAttribute ("ShadowSigmaIndoor", DoubleValue (0.0)); lena->SetPathlossModelAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));