Include pathloss models into BuildingsPropagationLossModel: Okumura Hata, ITU-R P.1411, ITU-R P.1238 and wall penetration loss
This commit is contained in:
@@ -33,7 +33,9 @@ Building::Building (double _xMin, double _xMax,
|
||||
uint8_t _nFloors, uint8_t _nRoomX, uint8_t _nRoomY) :
|
||||
m_floor (_nFloors),
|
||||
m_roomX (_nRoomX),
|
||||
m_roomY (_nRoomY)
|
||||
m_roomY (_nRoomY),
|
||||
m_buildingType (Residential),
|
||||
m_externalWalls (ConcreteWithWindows)
|
||||
|
||||
{
|
||||
m_buldingBounds = Box (_xMin, _xMax, _yMin, _yMax, _zMin, _zMax);
|
||||
@@ -43,9 +45,23 @@ Building::Building (double _xMin, double _xMax,
|
||||
Building::Building ()
|
||||
: m_floor (0),
|
||||
m_roomX (0),
|
||||
m_roomY (0)
|
||||
m_roomY (0),
|
||||
m_buildingType (Residential),
|
||||
m_externalWalls (ConcreteWithWindows)
|
||||
{
|
||||
m_buldingBounds = Box ();
|
||||
}
|
||||
|
||||
Building::BuildingType_t
|
||||
Building::GetBuildingType ()
|
||||
{
|
||||
return (m_buildingType);
|
||||
}
|
||||
|
||||
Building::ExtWallsType_t
|
||||
Building::GetExtWallsType ()
|
||||
{
|
||||
return (m_externalWalls);
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -40,6 +40,10 @@ public:
|
||||
{
|
||||
Residential, Office, Commercial
|
||||
};
|
||||
enum ExtWallsType_t
|
||||
{
|
||||
Wood, ConcreteWithWindows, ConcreteWithoutWindows
|
||||
};
|
||||
/**
|
||||
* \param _xMin x coordinates of left boundary.
|
||||
* \param _xMax x coordinates of right boundary.
|
||||
@@ -64,6 +68,16 @@ public:
|
||||
*/
|
||||
Building ();
|
||||
|
||||
/**
|
||||
* Return the type of building (i.e., Residential, Office, Commercial)
|
||||
*/
|
||||
BuildingType_t GetBuildingType ();
|
||||
|
||||
/**
|
||||
* Return the type of external walls (i.e., Wood, ConcreteWithWindows, ConcreteWithoutWindows)
|
||||
*/
|
||||
ExtWallsType_t GetExtWallsType ();
|
||||
|
||||
private:
|
||||
Box m_buldingBounds;
|
||||
|
||||
@@ -72,6 +86,8 @@ private:
|
||||
uint8_t m_roomY;
|
||||
|
||||
uint8_t m_buildingId;
|
||||
BuildingType_t m_buildingType;
|
||||
ExtWallsType_t m_externalWalls;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ BuildingsPropagationLossModel::GetEnvironment (void) const
|
||||
|
||||
|
||||
double
|
||||
BuildingsPropagationLossModel::OkumuraHata (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
|
||||
BuildingsPropagationLossModel::OkumuraHata (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const
|
||||
{
|
||||
// Hp: a is the rooftop antenna (from GetLoss logic)
|
||||
double loss = 0.0;
|
||||
@@ -182,26 +182,80 @@ BuildingsPropagationLossModel::OkumuraHata (Ptr<MobilityModel> a, Ptr<MobilityMo
|
||||
|
||||
|
||||
double
|
||||
BuildingsPropagationLossModel::ItuR1411 (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
|
||||
BuildingsPropagationLossModel::ItuR1411 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const
|
||||
{
|
||||
double dist = a->GetDistanceFrom (b);
|
||||
double lossLow = 0.0;
|
||||
double lossUp = 0.0;
|
||||
double pi = 3.141592653589793;
|
||||
double Lbp = 20*log10(m_lambda*m_lambda/(8*pi*a->GetPosition ().z*b->GetPosition ().z));
|
||||
double Rbp = (4 * a->GetPosition ().z * b->GetPosition ().z) / m_lambda;
|
||||
|
||||
return (0.0);
|
||||
if (dist <= Rbp)
|
||||
{
|
||||
lossLow = Lbp + 20*log10(dist/Rbp);
|
||||
lossUp = Lbp + 20 + 25*log10(dist/Rbp);
|
||||
}
|
||||
else
|
||||
{
|
||||
lossLow = Lbp + 40*log10(dist/Rbp);
|
||||
lossUp = Lbp + 20 + 40*log10(dist/Rbp);
|
||||
}
|
||||
|
||||
double loss = (lossUp + lossLow) / 2; // CHECK!!!
|
||||
|
||||
return (loss);
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
BuildingsPropagationLossModel::ItuR1238 (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
|
||||
BuildingsPropagationLossModel::ItuR1238 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const
|
||||
{
|
||||
|
||||
return (0.0);
|
||||
double N = 0.0;
|
||||
Ptr<Building> aBuilding = a->GetBuilding ();
|
||||
if (aBuilding->GetBuildingType () == Building::Residential)
|
||||
{
|
||||
N = 28;
|
||||
}
|
||||
else if (aBuilding->GetBuildingType () == Building::Office)
|
||||
{
|
||||
N = 30;
|
||||
}
|
||||
else if (aBuilding->GetBuildingType () == Building::Commercial)
|
||||
{
|
||||
N = 22;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_LOG_ERROR (this << " Unkwnon Wall Type");
|
||||
}
|
||||
|
||||
double loss = 20*log10(m_frequency) + N*log10(a->GetDistanceFrom (b)) - 28.0;
|
||||
|
||||
return (loss);
|
||||
}
|
||||
|
||||
|
||||
double
|
||||
BuildingsPropagationLossModel::BEWPL (Ptr<MobilityModel> a) const
|
||||
BuildingsPropagationLossModel::BEWPL (Ptr<BuildingsMobilityModel> a) const
|
||||
{
|
||||
|
||||
return (0.0);
|
||||
double loss = 0.0;
|
||||
Ptr<Building> aBuilding = a->GetBuilding ();
|
||||
if (aBuilding->GetExtWallsType () == Building::Wood)
|
||||
{
|
||||
loss = 4;
|
||||
}
|
||||
else if (aBuilding->GetExtWallsType () == Building::ConcreteWithWindows)
|
||||
{
|
||||
loss = 7;
|
||||
}
|
||||
else if (aBuilding->GetExtWallsType () == Building::ConcreteWithoutWindows)
|
||||
{
|
||||
loss = 10; // 10 ~ 20 dB
|
||||
}
|
||||
|
||||
return (loss);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#include "ns3/nstime.h"
|
||||
#include "ns3/propagation-loss-model.h"
|
||||
#include <ns3/building.h>
|
||||
#include <ns3/buildings-mobility-model.h>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -82,10 +84,10 @@ public:
|
||||
|
||||
private:
|
||||
virtual double DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
|
||||
double OkumuraHata (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
|
||||
double ItuR1411 (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
|
||||
double ItuR1238 (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
|
||||
double BEWPL (Ptr<MobilityModel> a) const;
|
||||
double OkumuraHata (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
double ItuR1411 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
double ItuR1238 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
|
||||
double BEWPL (Ptr<BuildingsMobilityModel> a) const;
|
||||
|
||||
double C; // OH loss coefficient for the environment
|
||||
double N; // ITU-R P.1238: power loss coefficient
|
||||
|
||||
Reference in New Issue
Block a user