Finalized pathloss model compound test: passed
This commit is contained in:
@@ -79,9 +79,9 @@ LtePathlossModelTestSuite::LtePathlossModelTestSuite ()
|
||||
NodeContainer ueNodes;
|
||||
NodeContainer hueNodes;
|
||||
enbNodes.Create (1);
|
||||
henbNodes.Create (1);
|
||||
ueNodes.Create (3);
|
||||
hueNodes.Create (1);
|
||||
henbNodes.Create (2);
|
||||
ueNodes.Create (5);
|
||||
hueNodes.Create (3);
|
||||
|
||||
// Install Mobility Model
|
||||
MobilityHelper mobility;
|
||||
@@ -124,11 +124,9 @@ LtePathlossModelTestSuite::LtePathlossModelTestSuite ()
|
||||
Ptr<BuildingsMobilityModel> mm2 = ueNodes.Get (0)->GetObject<BuildingsMobilityModel> ();
|
||||
mm2->SetPosition (Vector (distance, 0.0, hm));
|
||||
Ptr<Building> building = Create<Building> (0.0, 10.0, 0.0, 10.0, 0.0, 20.0/*, 1, 1, 1*/);
|
||||
// mm2->SetOutdoor ();
|
||||
// mm2->SetIndoor (building1);
|
||||
// mm2->SetFloorNumber (3);
|
||||
|
||||
// Test Okumura Hata Model (150 < freq < 1500 MHz)
|
||||
building->SetBuildingType(Building::Office);
|
||||
|
||||
// Test #1 Okumura Hata Model (150 < freq < 1500 MHz) (Macro<->UE)
|
||||
|
||||
freq = 869e6; // E_UTRA BAND #5 see table 5.5-1 of 36.101
|
||||
AddTestCase (new LtePathlossModelTestCase (freq, mm1, mm2, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 243.61, "OH Urban Large city = ??"));
|
||||
@@ -139,7 +137,7 @@ LtePathlossModelTestSuite::LtePathlossModelTestSuite ()
|
||||
|
||||
AddTestCase (new LtePathlossModelTestCase (freq, mm1, mm2, BuildingsPropagationLossModel::OpenAreas, BuildingsPropagationLossModel::Large, 215.89, "loss OH OpenAreas"));
|
||||
|
||||
// Test COST231 Model (1500 < freq < 2000~2170 MHz)
|
||||
// Test #2 COST231 Model (1500 < freq < 2000~2170 MHz) (Macro<->UE)
|
||||
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
|
||||
@@ -147,21 +145,21 @@ LtePathlossModelTestSuite::LtePathlossModelTestSuite ()
|
||||
|
||||
AddTestCase (new LtePathlossModelTestCase (freq, mm1, mm2, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Small, 256.32, "COST231 Urban small city and suburban"));
|
||||
|
||||
// Test 2.6 GHz model
|
||||
// Test #3 2.6 GHz model (Macro<->UE)
|
||||
|
||||
freq = 2.620e9; // E_UTRA BAND #7 see table 5.5-1 of 36.101
|
||||
|
||||
AddTestCase (new LtePathlossModelTestCase (freq, mm1, mm2, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Small, 121.83, "2.6GHz model"));
|
||||
|
||||
// Test ITU1411 LOS model
|
||||
// Test #4 ITU1411 LOS model (Macro<->UE)
|
||||
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
distance = 100;
|
||||
Ptr<BuildingsMobilityModel> mm3 = ueNodes.Get (1)->GetObject<BuildingsMobilityModel> ();
|
||||
mm3->SetPosition (Vector (distance, 0.0, hm));
|
||||
AddTestCase (new LtePathlossModelTestCase (freq, mm1, mm3, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 80.605, "ITU1411 LOS"));
|
||||
AddTestCase (new LtePathlossModelTestCase (freq, mm1, mm3, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 81.00, "ITU1411 LOS"));
|
||||
|
||||
// Test ITU1411 NLOS model
|
||||
// Test #5 ITU1411 NLOS model (Macro<->UE)
|
||||
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
distance = 900;
|
||||
@@ -170,7 +168,7 @@ LtePathlossModelTestSuite::LtePathlossModelTestSuite ()
|
||||
mm4->SetPosition (Vector (distance, 0.0, hm));
|
||||
AddTestCase (new LtePathlossModelTestCase (freq, mm1, mm4, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 143.69, "ITU1411 NLOS"));
|
||||
|
||||
// Test ITUP1238
|
||||
// Test #6 ITUP1238 (HeNB <-> UE)
|
||||
|
||||
distance = 30;
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
@@ -178,12 +176,61 @@ LtePathlossModelTestSuite::LtePathlossModelTestSuite ()
|
||||
Ptr<BuildingsMobilityModel> mm5 = henbNodes.Get (0)->GetObject<BuildingsMobilityModel> ();
|
||||
mm5->SetPosition (Vector (0.0, 0.0, henbHeight));
|
||||
Ptr<Building> building1 = Create<Building> (0.0, 10.0, 0.0, 10.0, 0.0, 20.0/*, 1, 1, 1*/);
|
||||
building1->SetBuildingType (Building::Residential);
|
||||
mm5->SetIndoor (building1);
|
||||
Ptr<BuildingsMobilityModel> mm6 = hueNodes.Get (0)->GetObject<BuildingsMobilityModel> ();
|
||||
mm6->SetPosition (Vector (distance, 0.0, hm));
|
||||
mm6->SetIndoor (building1);
|
||||
mm6->SetFloorNumber (3);
|
||||
mm6->SetFloorNumber (2);
|
||||
AddTestCase (new LtePathlossModelTestCase (freq, mm5, mm6, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 88.3855, "ITUP1238"));
|
||||
|
||||
// Test #7 Outdoor -> Indoor OkumuraHata (Macro<->UE)
|
||||
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
distance = 2000;
|
||||
// The loss is as in test #2 (large city) plus the building penetration loss
|
||||
// which for ConcreteWithWindows is equal to 7 dB -> 254.22 + 7 = 261.22
|
||||
Ptr<BuildingsMobilityModel> mm7 = ueNodes.Get (3)->GetObject<BuildingsMobilityModel> ();
|
||||
mm7->SetPosition (Vector (distance, 0.0, hm));
|
||||
mm7->SetIndoor (building1);
|
||||
AddTestCase (new LtePathlossModelTestCase (freq, mm1, mm7, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 261.22, "Okumura Hata Outdoor -> Indoor"));
|
||||
|
||||
// Test #8 Outdoor -> Indoor ITU1411 (Macro<->UE)
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
distance = 100;
|
||||
Ptr<BuildingsMobilityModel> mm8 = ueNodes.Get (4)->GetObject<BuildingsMobilityModel> ();
|
||||
mm8->SetPosition (Vector (distance, 0.0, hm));
|
||||
mm8->SetIndoor (building1);
|
||||
// The loss is as in test #4 plus the building penetration loss
|
||||
// which for ConcreteWithWindows is equal to 7 dB -> 81.000 + 7 = 88.000
|
||||
AddTestCase (new LtePathlossModelTestCase (freq, mm1, mm8, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 88.000, "ITU1411 LOS Outdoor -> Indoor"));
|
||||
|
||||
// Test #9 Indoor -> Outdoor LOS (HeNB <-> UE)
|
||||
|
||||
distance = 100;
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
Ptr<BuildingsMobilityModel> mm9 = henbNodes.Get (1)->GetObject<BuildingsMobilityModel> ();
|
||||
mm9->SetPosition (Vector (0.0, 0.0, henbHeight));
|
||||
mm9->SetIndoor (building1);
|
||||
mm9->SetFloorNumber (2);
|
||||
Ptr<BuildingsMobilityModel> mm10 = hueNodes.Get (1)->GetObject<BuildingsMobilityModel> ();
|
||||
mm10->SetPosition (Vector (distance, 0.0, hm));
|
||||
// The loss is similar of test #4 plus the building penetration loss
|
||||
// which for ConcreteWithWindows is equal to 7 dB and the height gain
|
||||
// (2 floors x 2 dB/floor = 4) -> 81.838 + 7 - 4 = 84.838
|
||||
AddTestCase (new LtePathlossModelTestCase (freq, mm9, mm10, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 84.838, "ITU1411 LOS Indoor -> Outdoor"));
|
||||
|
||||
// Test #9 Indoor -> Outdoor NLOS (HeNB <-> UE)
|
||||
|
||||
distance = 500;
|
||||
freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
Ptr<BuildingsMobilityModel> mm11 = hueNodes.Get (2)->GetObject<BuildingsMobilityModel> ();
|
||||
mm11->SetPosition (Vector (distance, 0.0, hm));
|
||||
// The loss is as in test #4 plus the building penetration loss
|
||||
// which for ConcreteWithWindows is equal to 7 dB and the height gain
|
||||
// (2 floors x 2 dB/floor = 4) -> 180.90 + 7 - 4 = 183.90
|
||||
AddTestCase (new LtePathlossModelTestCase (freq, mm9, mm11, BuildingsPropagationLossModel::Urban, BuildingsPropagationLossModel::Large, 183.90, "ITU1411 NLOS Indoor -> Outdoor"));
|
||||
|
||||
}
|
||||
|
||||
static LtePathlossModelTestSuite ltePathlossModelTestSuite;
|
||||
@@ -245,13 +292,13 @@ LtePathlossModelTestCase::DoRun (void)
|
||||
Ptr<SpectrumChannel> m_downlinkChannel = CreateObject<SingleModelSpectrumChannel> ();
|
||||
Ptr<SpectrumChannel> m_uplinkChannel = CreateObject<SingleModelSpectrumChannel> ();
|
||||
Ptr<BuildingsPropagationLossModel> m_downlinkPropagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
|
||||
m_downlinkPropagationLossModel->SetAttribute ("Frequency", DoubleValue (m_freq)); // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
m_downlinkPropagationLossModel->SetAttribute ("Lambda", DoubleValue (300000000.0 /m_freq)); // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
m_downlinkPropagationLossModel->SetAttribute ("Frequency", DoubleValue (m_freq));
|
||||
m_downlinkPropagationLossModel->SetAttribute ("Lambda", DoubleValue (300000000.0 /m_freq));
|
||||
m_downlinkPropagationLossModel->SetAttribute ("Environment", EnumValue (m_env));
|
||||
m_downlinkPropagationLossModel->SetAttribute ("CitySize", EnumValue (m_city));
|
||||
Ptr<BuildingsPropagationLossModel> m_uplinkPropagationLossModel = CreateObject<BuildingsPropagationLossModel> ();
|
||||
m_uplinkPropagationLossModel->SetAttribute ("Frequency", DoubleValue (m_freq)); // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
m_uplinkPropagationLossModel->SetAttribute ("Lambda", DoubleValue (300000000.0 /m_freq)); // E_UTRA BAND #1 see table 5.5-1 of 36.101
|
||||
m_uplinkPropagationLossModel->SetAttribute ("Frequency", DoubleValue (m_freq));
|
||||
m_uplinkPropagationLossModel->SetAttribute ("Lambda", DoubleValue (300000000.0 /m_freq));
|
||||
m_downlinkChannel->AddPropagationLossModel (m_downlinkPropagationLossModel);
|
||||
m_uplinkChannel->AddPropagationLossModel (m_uplinkPropagationLossModel);
|
||||
|
||||
|
||||
@@ -18,17 +18,13 @@ function g = loss_ITU1238 (d, f, n_floors, build_t)
|
||||
N = 28;
|
||||
Lf = 4*n_floors;
|
||||
elseif (build_t==2)
|
||||
N = 20
|
||||
N = 30
|
||||
Lf = 15+4*(n_floors-1);
|
||||
else
|
||||
N = 22;
|
||||
Lf = 6 + 3*(n_floors-1);
|
||||
endif
|
||||
|
||||
N
|
||||
Lf
|
||||
d
|
||||
log10(f)
|
||||
g(find(d > 0)) = 20*log10(f) + (N*log10(d)) + Lf - 28;
|
||||
|
||||
g(find(d <= 0)) = 1;
|
||||
@@ -21,9 +21,6 @@ function g = loss_ITU1411_LOS (d, hb, hm, hr, f)
|
||||
Lu = Lbp + 20 + 40.*log10(d./Rbp);
|
||||
endif
|
||||
|
||||
Lbp
|
||||
Rbp
|
||||
lambda
|
||||
g = zeros(size(d));
|
||||
g(find(d > 0)) = (Ll.+Lu)./2;
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ function g = loss_ITU1411_NLOS_over_rooftop (d, hb, hm, hr, f, l, b, st_w, phi,
|
||||
fmhz = f/1e6;
|
||||
Dhb = hb - hr;
|
||||
ds = (lambda*d*d)/(Dhb*Dhb);
|
||||
ds
|
||||
if (l>ds)
|
||||
if (fmhz>2000)
|
||||
kf = -8;
|
||||
@@ -45,15 +46,17 @@ function g = loss_ITU1411_NLOS_over_rooftop (d, hb, hm, hr, f, l, b, st_w, phi,
|
||||
else
|
||||
theta = atan (Dhb /b);
|
||||
rho = sqrt(Dhb^2 + b^2);
|
||||
if (hb-hr<1)
|
||||
if (abs(hb-hr)<1)
|
||||
Qm = b./d;
|
||||
elseif (hb>hr)
|
||||
Qm = 2.35*((Dhb./d)*sqrt(b/lambda))^0.9;
|
||||
else
|
||||
Qm = (b/2*pi.*d)*sqrt(lambda/rho)*((1/theta)-(1/(2*pi+theta)));
|
||||
Qm = (b/(2*pi.*d))*sqrt(lambda/rho)*((1/theta)-(1/(2*pi+theta)));
|
||||
b
|
||||
endif
|
||||
Lmsd = -10*log10(Qm*Qm);
|
||||
endif
|
||||
Lmsd
|
||||
Dhm = hr-hm;
|
||||
if (phi<35)
|
||||
Lori = -10+(0.354*phi);
|
||||
|
||||
@@ -14,6 +14,7 @@ hm = 1;
|
||||
hr = 20;
|
||||
fmhz = f/1e6;
|
||||
|
||||
% Test #1
|
||||
g = loss_OH_large_cities_urban (d, hb, hm, fmhz);
|
||||
disp ("The value of OH for large cities is:"), disp (g)
|
||||
|
||||
@@ -26,6 +27,7 @@ disp ("The value of OH in suburban is:"), disp (g)
|
||||
g = loss_OH_openareas (d, hb, hm, fmhz);
|
||||
disp ("The value of OH in openareas is:"), disp (g)
|
||||
|
||||
% Test #2 and #7
|
||||
fmhz = 2114;
|
||||
g = loss_COST231_large_cities_urban (d, hb, hm, fmhz);
|
||||
disp ("The value of COST231 for large cities is:"), disp (g)
|
||||
@@ -33,14 +35,17 @@ disp ("The value of COST231 for large cities is:"), disp (g)
|
||||
g = loss_COST231_small_cities_urban (d, hb, hm, fmhz);
|
||||
disp ("The value of COST231 for small cities is:"), disp (g)
|
||||
|
||||
% Test #3
|
||||
g = loss_OH_2_6GHz (d);
|
||||
disp ("The value of OH at 2.6 GHz is:"), disp (g)
|
||||
|
||||
d = 100;
|
||||
% Test #4
|
||||
d = 104.12;
|
||||
f = 2114e6;
|
||||
g = loss_ITU1411_LOS (d, hb, hm, hr, f);
|
||||
disp ("The value of ITU1411 in LOS is:"), disp (g)
|
||||
|
||||
% Test #5
|
||||
d = 900;
|
||||
l = 80;
|
||||
b = 50;
|
||||
@@ -50,12 +55,33 @@ big = 1; % metropolitan centre
|
||||
g = loss_ITU1411_NLOS_over_rooftop (d, hb, hm, hr, f, l, b, st_w, phi, big);
|
||||
disp ("The value of ITU1411 in NLOS over the roof-top is:"), disp (g)
|
||||
|
||||
% Test #6
|
||||
n_floors = 2;
|
||||
built_t = 1;
|
||||
built_t = 2;
|
||||
d = 31.3209;
|
||||
g = loss_ITU1238 (d, fmhz, n_floors, built_t);
|
||||
disp ("The value of ITU1238 is:"), disp (g)
|
||||
|
||||
% Test #9
|
||||
d = 100.404;
|
||||
f = 2114e6;
|
||||
hb = 10;
|
||||
g = loss_ITU1411_LOS (d, hb, hm, hr, f);
|
||||
disp ("The value of ITU1411 in LOS is:"), disp (g)
|
||||
|
||||
|
||||
|
||||
% Test #10
|
||||
d = 500;
|
||||
l = 80;
|
||||
b = 50;
|
||||
st_w = 20;
|
||||
phi = 45;
|
||||
big = 1; % metropolitan centre
|
||||
hb = 10;
|
||||
g = loss_ITU1411_NLOS_over_rooftop (d, hb, hm, hr, f, l, b, st_w, phi, big);
|
||||
disp ("The value of ITU1411 in NLOS over the roof-top is:"), disp (g)
|
||||
|
||||
|
||||
%%snr = txPsd + g - kT - nf ; % dB
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
|
||||
|
||||
#include <ns3/building.h>
|
||||
// #include <ns3/box.h>
|
||||
#include <ns3/enum.h>
|
||||
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
|
||||
Building::Building (double _xMin, double _xMax,
|
||||
double _yMin, double _yMax,
|
||||
double _zMin, double _zMax/*,
|
||||
@@ -43,9 +43,9 @@ Building::Building (double _xMin, double _xMax,
|
||||
|
||||
|
||||
Building::Building ()
|
||||
: m_floor (0),
|
||||
m_roomX (0),
|
||||
m_roomY (0),
|
||||
: m_floor (1),
|
||||
m_roomX (1),
|
||||
m_roomY (1),
|
||||
m_buildingType (Residential),
|
||||
m_externalWalls (ConcreteWithWindows)
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <ns3/box.h>
|
||||
#include <ns3/simple-ref-count.h>
|
||||
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
@@ -36,6 +37,7 @@ namespace ns3 {
|
||||
class Building : public SimpleRefCount<Building>
|
||||
{
|
||||
public:
|
||||
|
||||
enum BuildingType_t
|
||||
{
|
||||
Residential, Office, Commercial
|
||||
@@ -144,7 +146,10 @@ public:
|
||||
|
||||
private:
|
||||
Box m_buldingBounds;
|
||||
|
||||
/**
|
||||
* number of floors must be greater then 0 and 1 means only one floor
|
||||
* (i.e., groundfloor)
|
||||
*/
|
||||
uint8_t m_floor;
|
||||
uint8_t m_roomX;
|
||||
uint8_t m_roomY;
|
||||
|
||||
@@ -49,7 +49,7 @@ BuildingsMobilityModel::GetTypeId (void)
|
||||
BuildingsMobilityModel::BuildingsMobilityModel ()
|
||||
{
|
||||
m_indoor = false;
|
||||
m_nFloor = 1;
|
||||
m_nFloor = 0;
|
||||
m_roomX = 1;
|
||||
m_roomY = 1;
|
||||
}
|
||||
|
||||
@@ -85,6 +85,9 @@ class BuildingsMobilityModel : public MobilityModel
|
||||
std::list < Ptr<Building> > m_surroudingBuildings; // buildings blocks
|
||||
Ptr<Building> m_myBuilding;
|
||||
bool m_indoor;
|
||||
/**
|
||||
* floors numbering starts from 0 (basement)
|
||||
*/
|
||||
uint8_t m_nFloor;
|
||||
uint8_t m_roomX;
|
||||
uint8_t m_roomY;
|
||||
|
||||
@@ -284,9 +284,9 @@ BuildingsPropagationLossModel::ItuR1411Los (Ptr<BuildingsMobilityModel> a, Ptr<B
|
||||
double lossLow = 0.0;
|
||||
double lossUp = 0.0;
|
||||
double pi = 3.141592653589793;
|
||||
double Lbp = abs(20*log10((m_lambda*m_lambda)/(8*pi*a->GetPosition ().z*b->GetPosition ().z)));
|
||||
double Lbp = fabs (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;
|
||||
NS_LOG_INFO (this << " Lbp " << Lbp << " Rbp " << Rbp << " lambda " << m_lambda);
|
||||
// NS_LOG_INFO (this << " Lbp " << Lbp << " Rbp " << Rbp << " lambda " << m_lambda);
|
||||
if (dist <= Rbp)
|
||||
{
|
||||
lossLow = Lbp + 20*log10(dist/Rbp);
|
||||
@@ -333,7 +333,7 @@ BuildingsPropagationLossModel::ItuR1411NlosOverRooftop (Ptr<BuildingsMobilityMod
|
||||
double ds = (m_lambda * distance * distance) / (Dhb * Dhb);
|
||||
double Lmsd = 0.0;
|
||||
double pi = 3.141592653589793;
|
||||
//NS_LOG_INFO (this << " build " << m_buildingsExtend << " ds " << ds << " roof " << m_rooftopHeight << " hb " << hb << " lambda " << m_lambda);
|
||||
// NS_LOG_INFO (this << " build " << m_buildingsExtend << " ds " << ds << " roof " << m_rooftopHeight << " hb " << hb << " lambda " << m_lambda);
|
||||
if (ds < m_buildingsExtend)
|
||||
{
|
||||
double Lbsh = 0.0;
|
||||
@@ -391,13 +391,12 @@ BuildingsPropagationLossModel::ItuR1411NlosOverRooftop (Ptr<BuildingsMobilityMod
|
||||
{
|
||||
Qm = m_buildingSeparation/(2*pi*distance)*sqrt(m_lambda/rho)*(1/theta-(1/(2*pi+theta)));
|
||||
}
|
||||
|
||||
Lmsd = -10*log10(Qm*Qm);
|
||||
}
|
||||
double Lbf = 32.4 + 20*log10(distance/1000) + 20*log10(fmhz);
|
||||
double Dhm = m_rooftopHeight - hm;
|
||||
double Lrts = -8.2 -10*log10 (m_streetsWidth) + 10*log10 (fmhz) + 20*log10 (Dhm) + Lori;
|
||||
//NS_LOG_INFO (this << " Lbf " << Lbf << " Lrts " << Lrts << " Dhm" << Dhm);
|
||||
// NS_LOG_INFO (this << " Lbf " << Lbf << " Lrts " << Lrts << " Dhm" << Dhm << " Lmsd " << Lmsd);
|
||||
double loss = 0.0;
|
||||
if (Lrts + Lmsd > 0)
|
||||
{
|
||||
@@ -512,7 +511,7 @@ BuildingsPropagationLossModel::HeightGain (Ptr<BuildingsMobilityModel> node) con
|
||||
double loss = 0.0;
|
||||
|
||||
int nfloors = node->GetFloorNumber ();
|
||||
loss = -2*nfloors;
|
||||
loss = -2*(nfloors);
|
||||
return (loss);
|
||||
}
|
||||
|
||||
@@ -538,6 +537,7 @@ BuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel>
|
||||
{
|
||||
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))
|
||||
{
|
||||
@@ -575,23 +575,29 @@ BuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel>
|
||||
if (distance > 1000)
|
||||
{
|
||||
if ((a1->GetPosition ().z < m_rooftopHeight)
|
||||
|| (b1->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) + BEWPL(a1) + HeightGain (a1);
|
||||
NS_LOG_INFO (this << " 0-0 (>1000): down rooftop -> ITUR1411 : " << loss);
|
||||
loss = ItuR1411 (a1, b1) + BEWPL(b1) + HeightGain (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-0 (>2000): down rooftop -> ITUR1411 : " << loss);
|
||||
NS_LOG_INFO (this << " 0-I (>2000): down rooftop -> ITUR1411 : " << loss);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Over the rooftop tranmission -> Okumura Hata
|
||||
loss = OkumuraHata (a1, b1) + BEWPL(b1);
|
||||
NS_LOG_INFO (this << " O-I (>1000): Over the rooftop -> OH : " << loss);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -625,7 +631,7 @@ BuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel>
|
||||
if (distance > 1000)
|
||||
{
|
||||
if ((a1->GetPosition ().z < m_rooftopHeight)
|
||||
|| (b1->GetPosition ().z < m_rooftopHeight))
|
||||
&& (b1->GetPosition ().z < m_rooftopHeight))
|
||||
{
|
||||
|
||||
// ITU limit in distance (i.e., < 2000 for small cells)
|
||||
@@ -633,26 +639,26 @@ BuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel>
|
||||
{
|
||||
// short range communication
|
||||
loss = ItuR1411 (a1, b1) + BEWPL(a1) + HeightGain (a1);
|
||||
NS_LOG_INFO (this << " 0-0 (>1000): down rooftop -> ITUR1411 : " << loss);
|
||||
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 << " 0-0 (>2000): down rooftop -> ITUR1411 : " << loss);
|
||||
NS_LOG_INFO (this << " I-O (>2000): down rooftop -> ITUR1411 : " << loss);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// above rooftop -> OH
|
||||
loss = OkumuraHata (a1, b1) + BEWPL(a1) + HeightGain (a1);
|
||||
NS_LOG_INFO (this << " I-0 (>1000) over rooftop OH + BEL : " << loss);
|
||||
NS_LOG_INFO (this << " =I-O (>1000) over rooftop OH + BEL + HG: " << loss);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
loss = ItuR1411 (a1, b1) + BEWPL(a1) + HeightGain (a1);
|
||||
NS_LOG_INFO (this << " I-0 (<1000) ITUR1411 + BEL : " << loss);
|
||||
NS_LOG_INFO (this << " I-O (<1000) ITUR1411 + BEL + HG: " << loss);
|
||||
}
|
||||
} // end b1->IsIndoor ()
|
||||
} // end a1->IsOutdoor ()
|
||||
|
||||
Reference in New Issue
Block a user