add some debugging output. initialize the time argument correctly.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 02 Jul 2007 15:27:53 +0200
changeset 1557 0e9a6c0c833c
parent 1556 2d5363ef077f
child 1558 1f31bc245f55
add some debugging output. initialize the time argument correctly.
src/node/random-walk-position.cc
--- a/src/node/random-walk-position.cc	Mon Jul 02 15:15:25 2007 +0200
+++ b/src/node/random-walk-position.cc	Mon Jul 02 15:27:53 2007 +0200
@@ -22,8 +22,11 @@
 #include "ns3/default-value.h"
 #include "ns3/time-default-value.h"
 #include "ns3/simulator.h"
+#include "ns3/debug.h"
 #include <cmath>
 
+NS_DEBUG_COMPONENT_DEFINE ("RandomWalk");
+
 namespace ns3 {
 
 static IntegerDefaultValue<double> g_minSpeed ("RandomWalkMinSpeed", 
@@ -51,7 +54,7 @@
     m_maxSpeed (g_maxSpeed.GetValue ()),
     m_mode (g_mode.GetValue ()),
     m_modeDistance (g_modeDistance.GetValue ()),
-    m_modeTime (g_modeDistance.GetValue ())
+    m_modeTime (g_modeTime.GetValue ())
 {}
 bool 
 RandomWalkPositionParameters::IsDefault (void) const
@@ -122,6 +125,7 @@
       delay = Seconds (distance / sqrt (m_dx * m_dx + m_dy * m_dy));
     }
   NotifyCourseChange ();
+  NS_DEBUG ("change speed at " << Simulator::Now () << " in " << delay);
   Simulator::Schedule (delay, &RandomWalkPosition::Reset, this);
 }