View | Details | Raw Unified | Return to bug 461
Collapse All | Expand All

(-)ns-3.3/src/mobility/random-waypoint-mobility-model.cc (-2 / +3 lines)
 Lines 56-62    Link Here 
56
56
57
RandomWaypointMobilityModel::RandomWaypointMobilityModel ()
57
RandomWaypointMobilityModel::RandomWaypointMobilityModel ()
58
{
58
{
59
  Simulator::ScheduleNow (&RandomWaypointMobilityModel::Start, this);
59
  m_event = Simulator::ScheduleNow (&RandomWaypointMobilityModel::Start, this);
60
}
60
}
61
61
62
void
62
void
 Lines 72-77    Link Here 
72
  double k = speed / std::sqrt (dx*dx + dy*dy + dz*dz);
72
  double k = speed / std::sqrt (dx*dx + dy*dy + dz*dz);
73
73
74
  m_helper.SetVelocity (Vector (k*dx, k*dy, k*dz));
74
  m_helper.SetVelocity (Vector (k*dx, k*dy, k*dz));
75
  m_helper.Unpause ();
75
  Time travelDelay = Seconds (CalculateDistance (destination, m_current) / speed);
76
  Time travelDelay = Seconds (CalculateDistance (destination, m_current) / speed);
76
  m_event = Simulator::Schedule (travelDelay,
77
  m_event = Simulator::Schedule (travelDelay,
77
				 &RandomWaypointMobilityModel::Start, this);
78
				 &RandomWaypointMobilityModel::Start, this);
 Lines 99-105    Link Here 
99
{
100
{
100
  m_helper.SetPosition (position);
101
  m_helper.SetPosition (position);
101
  Simulator::Remove (m_event);
102
  Simulator::Remove (m_event);
102
  Simulator::ScheduleNow (&RandomWaypointMobilityModel::Start, this);
103
  m_event = Simulator::ScheduleNow (&RandomWaypointMobilityModel::Start, this);
103
}
104
}
104
Vector
105
Vector
105
RandomWaypointMobilityModel::DoGetVelocity (void) const
106
RandomWaypointMobilityModel::DoGetVelocity (void) const

Return to bug 461