From db5fc4fa9bfb63fc1add9812f46452a15f2aa4ec Mon Sep 17 00:00:00 2001 From: Marco Miozzo Date: Tue, 12 Jul 2011 17:21:24 +0200 Subject: [PATCH] LtePathlossModelTestSuite on-going work --- src/lte/test/lte-test-pathloss-model.cc | 9 +++-- .../model/buildings-propagation-loss-model.cc | 37 +++++++++++++++---- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/src/lte/test/lte-test-pathloss-model.cc b/src/lte/test/lte-test-pathloss-model.cc index 4d077219c..badc4fcac 100644 --- a/src/lte/test/lte-test-pathloss-model.cc +++ b/src/lte/test/lte-test-pathloss-model.cc @@ -38,6 +38,7 @@ #include #include "ns3/string.h" #include "ns3/double.h" +#include NS_LOG_COMPONENT_DEFINE ("LtePathlossModelTest"); @@ -86,11 +87,13 @@ LtePathlossModelTestSuite::LtePathlossModelTestSuite () Ptr mm1 = enbNodes.Get (0)->GetObject (); - mm1->SetPosition (Vector (0.0, 0.0, 0.0)); + mm1->SetPosition (Vector (0.0, 0.0, 1.0)); mm1->SetOutdoor (); Ptr mm2 = ueNodes.Get (0)->GetObject (); - mm2->SetPosition (Vector (10.0, 0.0, 0.0)); - mm2->SetOutdoor (); + mm2->SetPosition (Vector (1010.0, 0.0, 1.0)); + //Ptr building = Create (0.0, 10.0, 0.0, 10.0, 0.0, 20.0, 1, 1, 1); + Ptr building = Create (); + mm2->SetIndoor (building); double thrLoss = 0.0; AddTestCase (new LtePathlossModelTestCase (mm1, mm2, thrLoss, "loss = ??")); diff --git a/src/propagation/model/buildings-propagation-loss-model.cc b/src/propagation/model/buildings-propagation-loss-model.cc index 59e185f2b..9bba1750f 100644 --- a/src/propagation/model/buildings-propagation-loss-model.cc +++ b/src/propagation/model/buildings-propagation-loss-model.cc @@ -55,11 +55,19 @@ BuildingsPropagationLossModel::GetTypeId (void) DoubleValue (2.3e9), MakeDoubleAccessor (&BuildingsPropagationLossModel::m_frequency), MakeDoubleChecker ()) + + .AddAttribute ("RooftopLevel", + " The height of the rooftop [m].", + DoubleValue (30.0), + MakeDoubleAccessor (&BuildingsPropagationLossModel::m_rooftopThreshold), + MakeDoubleChecker ()) + .AddAttribute ("MinDistance", "The distance under which the propagation model refuses to give results (m) ", DoubleValue (0.5), MakeDoubleAccessor (&BuildingsPropagationLossModel::SetMinDistance, &BuildingsPropagationLossModel::GetMinDistance), MakeDoubleChecker ()); + return tid; } @@ -119,7 +127,7 @@ BuildingsPropagationLossModel::OkumuraHata (Ptr a, Ptr a, Ptr a, PtrGetDistanceFrom (b))) - log_bHeight; } - else if (m_frequency <= 2690) // max 3GPP freq EUTRA band #1 + else if (m_frequency <= 2.690e9) // max 3GPP freq EUTRA band #1 { // Empirical model from // "Path Loss Models for Suburban Scenario at 2.3GHz, 2.6GHz and 3.5GHz" @@ -192,7 +200,7 @@ BuildingsPropagationLossModel::ItuR1411 (Ptr a, PtrGetPosition ().z*b->GetPosition ().z)); double Rbp = (4 * a->GetPosition ().z * b->GetPosition ().z) / m_lambda; - +// NS_LOG_INFO (this << " Lbp " << Lbp << " Rbp " << Rbp); if (dist <= Rbp) { lossLow = Lbp + 20*log10(dist/Rbp); @@ -204,7 +212,7 @@ BuildingsPropagationLossModel::ItuR1411 (Ptr a, Ptr a, Ptr Ptr b1 = DynamicCast (b); double loss = 0.0; + NS_LOG_INFO (this << " rooftop " << m_rooftopThreshold); if (a1->IsOutdoor ()) { @@ -289,10 +298,12 @@ BuildingsPropagationLossModel::GetLoss (Ptr a, Ptr { if (distance > 1000) { - if (a1->GetPosition ().z > m_rooftopThreshold) + if ((a1->GetPosition ().z > m_rooftopThreshold) + || (b1->GetPosition ().z > m_rooftopThreshold)) { // Over the rooftop tranmission -> Okumura Hata loss = OkumuraHata (a1, b1); + NS_LOG_INFO (this << " O-O (>1000): Over the rooftop -> OH : " << loss); } else { @@ -300,12 +311,14 @@ BuildingsPropagationLossModel::GetLoss (Ptr a, Ptr // short range outdoor communication within street canyon loss = ItuR1411 (a1, b1); + NS_LOG_INFO (this << " 0-0 (>1000): down rooftop -> ITUR1411 : " << loss); } } else { // short range outdoor communication within street canyon loss = ItuR1411 (a1, b1); + NS_LOG_INFO (this << " 0-0 (<1000) Street canyon -> ITUR1411 : " << loss); } } else @@ -314,10 +327,12 @@ BuildingsPropagationLossModel::GetLoss (Ptr a, Ptr if (distance > 1000) { loss = OkumuraHata (a1, b1) + BEWPL(b1); + NS_LOG_INFO (this << " 0-I (>1000) OH + BEL : " << loss); } else { loss = ItuR1411 (a1, b1) + BEWPL(b1); + NS_LOG_INFO (this << " 0-I (<1000) ITUR1411 + BEL : " << loss); } } // end b1->isIndoor () } @@ -330,10 +345,14 @@ BuildingsPropagationLossModel::GetLoss (Ptr a, Ptr { // nodes are in same building -> indoor communication ITU-R P.1238 loss = ItuR1238 (a1, b1); + NS_LOG_INFO (this << " I-I (same building) ITUR1238 + BEL : " << loss); + } else { + // nodes are in different buildings loss = ItuR1411 (a1, b1) + BEWPL(a1) + BEWPL(b1); + NS_LOG_INFO (this << " I-I (different) ITUR1238 + BEL : " << loss); } } else @@ -341,18 +360,22 @@ BuildingsPropagationLossModel::GetLoss (Ptr a, Ptr // b is outdoor if (distance > 1000) { - if (b1->GetPosition ().z > m_rooftopThreshold) + if ((a1->GetPosition ().z > m_rooftopThreshold) + || (b1->GetPosition ().z > m_rooftopThreshold)) { loss = OkumuraHata (a1, b1) + BEWPL(a1); + NS_LOG_INFO (this << " I-0 (>1000) over rooftop OH + BEL : " << loss); } else { loss = ItuR1411 (a1, b1) + BEWPL(a1); + NS_LOG_INFO (this << " I-0 (>1000) down rooftop ITUR1411 + BEL : " << loss); } } else { loss = ItuR1411 (a1, b1) + BEWPL(a1); + NS_LOG_INFO (this << " I-0 (<1000) ITUR1411 + BEL : " << loss); } } // end b1->IsIndoor () } // end a1->IsOutdoor ()