wifi: Fix noise interference calculation
authorSébastien Deronne <sebastien.deronne@gmail.com>
Sat, 08 Dec 2018 19:31:47 +0100
changeset 13894 1a2c58d8f84f
parent 13893 83b0217cbb13
child 13895 5df69eea72d6
wifi: Fix noise interference calculation
src/wifi/model/interference-helper.cc
--- a/src/wifi/model/interference-helper.cc	Sat Dec 08 16:56:04 2018 +0100
+++ b/src/wifi/model/interference-helper.cc	Sat Dec 08 19:31:47 2018 +0100
@@ -245,7 +245,7 @@
         {
           continue;
         }
-      if (it->first > Simulator::Now ())
+      if (it->first >= Simulator::Now ())
         {
           break;
         }
@@ -259,6 +259,7 @@
       ni->insert (*it);
     }
   ni->emplace (event->GetEndTime (), NiChange (0, event));
+  NS_ASSERT_MSG (noiseInterferenceW >= 0, "CalculateNoiseInterferenceW returns negative value " << noiseInterferenceW);
   return noiseInterferenceW;
 }