buildings: Stop using deprecated method IsOutdoor

This commit is contained in:
ZorazeAli
2020-01-29 13:02:18 +01:00
parent e7d5951846
commit 49e727e8ed
3 changed files with 22 additions and 13 deletions

View File

@@ -188,9 +188,12 @@ double
BuildingsPropagationLossModel::EvaluateSigma (Ptr<MobilityBuildingInfo> a, Ptr<MobilityBuildingInfo> b)
const
{
if (a->IsOutdoor ())
bool isAIndoor = a->IsIndoor ();
bool isBIndoor = b->IsIndoor ();
if (!isAIndoor) // a is outdoor
{
if (b->IsOutdoor ())
if (!isBIndoor) // b is outdoor
{
return (m_shadowingSigmaOutdoor);
}
@@ -201,7 +204,7 @@ const
}
}
else
if (b->IsIndoor ())
if (isBIndoor) // b is indoor
{
return (m_shadowingSigmaIndoor);
}

View File

@@ -153,10 +153,13 @@ HybridBuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<Mobility
NS_ASSERT_MSG ((a1 != 0) && (b1 != 0), "HybridBuildingsPropagationLossModel only works with MobilityBuildingInfo");
double loss = 0.0;
bool isAIndoor = a1->IsIndoor ();
bool isBIndoor = b1->IsIndoor ();
if (a1->IsOutdoor ())
if (!isAIndoor) // a is outdoor
{
if (b1->IsOutdoor ())
if (!isBIndoor) // b is outdoor
{
if (distance > 1000)
{
@@ -208,7 +211,7 @@ HybridBuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<Mobility
else
{
// a is indoor
if (b1->IsIndoor ())
if (isBIndoor) // b is indoor
{
if (a1->GetBuilding () == b1->GetBuilding ())
{
@@ -247,8 +250,8 @@ HybridBuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<Mobility
loss = ItuR1411 (a, b) + ExternalWallLoss (a1) + HeightLoss (a1);
NS_LOG_INFO (this << " I-O (<1000) ITUR1411 + BEL + HG: " << loss);
}
} // end b1->IsIndoor ()
} // end a1->IsOutdoor ()
} // end if (isBIndoor)
} // end if (!isAIndoor)
loss = std::max (loss, 0.0);

View File

@@ -74,9 +74,12 @@ OhBuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityMode
double loss = 0.0;
if (a1->IsOutdoor ())
bool isAIndoor = a1->IsIndoor ();
bool isBIndoor = b1->IsIndoor ();
if (!isAIndoor) // a is outdoor
{
if (b1->IsOutdoor ())
if (!isBIndoor) // b is outdoor
{
loss = m_okumuraHata->GetLoss (a, b);
NS_LOG_INFO (this << " O-O : " << loss);
@@ -91,7 +94,7 @@ OhBuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityMode
else
{
// a is indoor
if (b1->IsIndoor ())
if (isBIndoor) // b is indoor
{
if (a1->GetBuilding () == b1->GetBuilding ())
{
@@ -111,8 +114,8 @@ OhBuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityMode
{
loss = m_okumuraHata->GetLoss (a, b) + ExternalWallLoss (a1);
NS_LOG_INFO (this << " I-O : " << loss);
} // end b1->IsIndoor ()
} // end a1->IsOutdoor ()
} // end if (isBIndoor)
} // end if (!isAIndoor)
loss = std::max (0.0, loss);
return loss;