Handle co-located NetDevices in propagation models
authorGetachew Redieteab <redieteab.orange@gmail.com>
Sat, 09 Dec 2017 11:41:12 -0800
changeset 85 69856faa7f5b
parent 84 f88bdc99a277
child 86 fb0495e70736
Handle co-located NetDevices in propagation models There is a RxPower issue for LAA nodes since they have both WifiNetDevice and LteNetDevice NetDevices and that the latter are by definition co-located.
src/propagation/model/ieee-80211ax-indoor-propagation-loss-model.cc
src/propagation/model/itu-inh-propagation-loss-model.cc
--- a/src/propagation/model/ieee-80211ax-indoor-propagation-loss-model.cc	Tue Mar 14 12:24:12 2017 -0700
+++ b/src/propagation/model/ieee-80211ax-indoor-propagation-loss-model.cc	Sat Dec 09 11:41:12 2017 -0800
@@ -78,6 +78,11 @@
 						Ptr<MobilityModel> a,
 						Ptr<MobilityModel> b) const
 {
+  if (a->GetDistanceFrom (b) == 0.0)
+    {
+      NS_LOG_LOGIC ("Co-located NetDevices. No path loss nor shadowing loss to consider");
+      return txPowerDbm;
+    }
   return (txPowerDbm - GetPathLossDb (a, b) - m_shadowing.GetLossDb (a, b));
 }
 
--- a/src/propagation/model/itu-inh-propagation-loss-model.cc	Tue Mar 14 12:24:12 2017 -0700
+++ b/src/propagation/model/itu-inh-propagation-loss-model.cc	Sat Dec 09 11:41:12 2017 -0800
@@ -110,6 +110,11 @@
 						Ptr<MobilityModel> b) const
 {
   NS_LOG_FUNCTION (this << txPowerDbm);
+  if (a->GetDistanceFrom (b) == 0.0)
+    {
+      NS_LOG_LOGIC ("Co-located NetDevices. No path loss nor shadowing loss to consider");
+      return txPowerDbm;
+    }
   double pathLossDb = 0.0;
   if (m_losNlosClassifier.IsLos (a, b))
     {