Update BuildingPropagationLossModel for working in Hybrid and Simple modes
This commit is contained in:
@@ -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
|
||||
+++++++++++++++
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "ns3/mobility-module.h"
|
||||
#include "ns3/lte-module.h"
|
||||
#include "ns3/config-store.h"
|
||||
#include <ns3/buildings-propagation-loss-model.h>
|
||||
#include <ns3/hybrid-buildings-propagation-loss-model.h>
|
||||
|
||||
#include <iomanip>
|
||||
#include <string>
|
||||
@@ -73,7 +73,7 @@ main (int argc, char *argv[])
|
||||
mmEnb->SetIndoor (building1);
|
||||
}
|
||||
|
||||
Ptr<BuildingsPropagationLossModel> propagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
|
||||
Ptr<HybridBuildingsPropagationLossModel> propagationLossModel = CreateObject<HybridBuildingsPropagationLossModel> ();
|
||||
// cancel shadowing effect
|
||||
propagationLossModel->SetAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
|
||||
propagationLossModel->SetAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
|
||||
|
||||
@@ -69,7 +69,7 @@ BuildingsPropagationLossModel::GetTypeId (void)
|
||||
|
||||
.SetParent<PropagationLossModel> ()
|
||||
|
||||
.AddConstructor<BuildingsPropagationLossModel> ()
|
||||
//.AddConstructor<BuildingsPropagationLossModel> ()
|
||||
|
||||
.AddAttribute ("Lambda",
|
||||
"The wavelength (default is 2.106 GHz at 300 000 km/s).",
|
||||
@@ -598,172 +598,210 @@ BuildingsPropagationLossModel::InternalWallsLoss (Ptr<BuildingsMobilityModel> a,
|
||||
return m_lossInternalWall * (dx+dy);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// double
|
||||
// BuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> 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<BuildingsMobilityModel> a1 = DynamicCast<BuildingsMobilityModel> (a);
|
||||
// Ptr<BuildingsMobilityModel> b1 = DynamicCast<BuildingsMobilityModel> (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<double>::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<double>::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<double>::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<Ptr<MobilityModel>, std::map<Ptr<MobilityModel>, ShadowingLoss> >::iterator ait = m_shadowingLossMap.find (a);
|
||||
// if (ait != m_shadowingLossMap.end ())
|
||||
// {
|
||||
// std::map<Ptr<MobilityModel>, 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<MobilityModel> a, Ptr<MobilityModel> b) const
|
||||
BuildingsPropagationLossModel::GetShadowing (Ptr<MobilityModel> a, Ptr<MobilityModel> b)
|
||||
const
|
||||
{
|
||||
NS_ASSERT_MSG ((a->GetPosition ().z > 0) && (b->GetPosition ().z > 0), "BuildingsPropagationLossModel does not support underground nodes (placed at z < 0)");
|
||||
|
||||
Ptr<BuildingsMobilityModel> a1 = DynamicCast<BuildingsMobilityModel> (a);
|
||||
Ptr<BuildingsMobilityModel> b1 = DynamicCast<BuildingsMobilityModel> (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<BuildingsMobilityModel> a1 = DynamicCast<BuildingsMobilityModel> (a);
|
||||
Ptr<BuildingsMobilityModel> b1 = DynamicCast<BuildingsMobilityModel> (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<double>::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<double>::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<double>::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<Ptr<MobilityModel>, std::map<Ptr<MobilityModel>, ShadowingLoss> >::iterator ait = m_shadowingLossMap.find (a);
|
||||
if (ait != m_shadowingLossMap.end ())
|
||||
{
|
||||
std::map<Ptr<MobilityModel>, 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<MobilityModel> a, Ptr<MobilityModel>
|
||||
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<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b)
|
||||
const
|
||||
@@ -808,7 +847,7 @@ const
|
||||
double
|
||||
BuildingsPropagationLossModel::DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
|
||||
{
|
||||
return txPowerDbm - GetLoss (a, b);
|
||||
return txPowerDbm - GetLoss (a, b) - GetShadowing (a, b);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
#include <ns3/building.h>
|
||||
#include <ns3/buildings-mobility-model.h>
|
||||
|
||||
// #include <ns3/jakes-fading-loss-model.h>
|
||||
// #include <ns3/shadowing-loss-model.h>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -80,7 +78,7 @@ public:
|
||||
* \param b the mobility model of the destination
|
||||
* \returns the propagation loss (in dBm)
|
||||
*/
|
||||
double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
|
||||
virtual double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> 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<MobilityModel> a, Ptr<MobilityModel> b) const;
|
||||
double OkumuraHata (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
double ItuR1411 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
double ItuR1411Los (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
double ItuR1411NlosOverRooftop (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
protected:
|
||||
virtual double OkumuraHata (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
virtual double ItuR1411 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
virtual double ItuR1411Los (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
virtual double ItuR1411NlosOverRooftop (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
// double ItuR1411NlosStreetCanyons (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
double ItuR1238 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
|
||||
double ExternalWallLoss (Ptr<BuildingsMobilityModel> a) const;
|
||||
double HeightLoss (Ptr<BuildingsMobilityModel> n) const;
|
||||
double InternalWallsLoss (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
|
||||
double GetShadowing (Ptr<MobilityModel> a, Ptr<MobilityModel> 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<MobilityModel> receiver);
|
||||
double GetLoss () const;
|
||||
Ptr<MobilityModel> GetReceiver (void) const;
|
||||
private:
|
||||
protected:
|
||||
Ptr<MobilityModel> m_receiver;
|
||||
NormalVariable m_randVariable;
|
||||
double m_shadowingValue;
|
||||
@@ -149,4 +150,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif /* COST231PROPAGATIONMODEL_H_ */
|
||||
#endif /* BUILDINGS_PROPAGATION_LOSS_MODEL_H_ */
|
||||
|
||||
@@ -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<BuildingsPropagationLossModel> propagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
|
||||
Ptr<HybridBuildingsPropagationLossModel> propagationLossModel = CreateObject<HybridBuildingsPropagationLossModel> ();
|
||||
propagationLossModel->SetAttribute ("Frequency", DoubleValue (m_freq));
|
||||
propagationLossModel->SetAttribute ("Lambda", DoubleValue (300000000.0 / m_freq));
|
||||
propagationLossModel->SetAttribute ("Environment", EnumValue (m_env));
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <ns3/test.h>
|
||||
#include <ns3/buildings-mobility-model.h>
|
||||
#include <ns3/buildings-propagation-loss-model.h>
|
||||
#include <ns3/hybrid-buildings-propagation-loss-model.h>
|
||||
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "ns3/simulator.h"
|
||||
#include "ns3/log.h"
|
||||
#include "ns3/buildings-shadowing-test.h"
|
||||
#include <ns3/buildings-propagation-loss-model.h>
|
||||
#include <ns3/hybrid-buildings-propagation-loss-model.h>
|
||||
#include "ns3/string.h"
|
||||
#include "ns3/double.h"
|
||||
#include <ns3/building.h>
|
||||
@@ -122,8 +122,8 @@ BuildingsShadowingTestCase::DoRun (void)
|
||||
int samples = 10000;
|
||||
for (int i = 0; i < samples; i++)
|
||||
{
|
||||
Ptr<BuildingsPropagationLossModel> propagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
|
||||
loss.push_back (propagationLossModel->GetLoss (mma, mmb) - m_lossRef);
|
||||
Ptr<HybridBuildingsPropagationLossModel> propagationLossModel = CreateObject<HybridBuildingsPropagationLossModel> ();
|
||||
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));
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "ns3/lte-sinr-chunk-processor.h"
|
||||
|
||||
#include "ns3/lte-test-pathloss-model.h"
|
||||
#include <ns3/buildings-propagation-loss-model.h>
|
||||
#include <ns3/hybrid-buildings-propagation-loss-model.h>
|
||||
#include <ns3/node-container.h>
|
||||
#include <ns3/mobility-helper.h>
|
||||
#include <ns3/lte-helper.h>
|
||||
@@ -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> lteHelper = CreateObject<LteHelper> ();
|
||||
// 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));
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <iostream>
|
||||
#include <ns3/radio-bearer-stats-calculator.h>
|
||||
#include <ns3/buildings-mobility-model.h>
|
||||
#include <ns3/buildings-propagation-loss-model.h>
|
||||
#include <ns3/hybrid-buildings-propagation-loss-model.h>
|
||||
#include "ns3/lte-test-phy-error-model.h"
|
||||
#include <ns3/eps-bearer.h>
|
||||
#include <ns3/node-container.h>
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user