src/mobility/random-direction-2d-mobility-model.cc
changeset 4218 debf1a8a96d3
parent 3782 a2375aed06f3
child 4226 a08201e94eb2
equal deleted inserted replaced
4084:dd514b5e0bc6 4218:debf1a8a96d3
    67   MobilityModel::DoDispose ();
    67   MobilityModel::DoDispose ();
    68 }
    68 }
    69 void
    69 void
    70 RandomDirection2dMobilityModel::Start (void)
    70 RandomDirection2dMobilityModel::Start (void)
    71 {
    71 {
    72   double direction = UniformVariable::GetSingleValue (0, 2 * PI);
    72   double direction = UniformVariable().GetValue (0, 2 * PI);
    73   SetDirectionAndSpeed (direction);
    73   SetDirectionAndSpeed (direction);
    74 }
    74 }
    75 
    75 
    76 void
    76 void
    77 RandomDirection2dMobilityModel::BeginPause (void)
    77 RandomDirection2dMobilityModel::BeginPause (void)
   102   NotifyCourseChange ();
   102   NotifyCourseChange ();
   103 }
   103 }
   104 void
   104 void
   105 RandomDirection2dMobilityModel::ResetDirectionAndSpeed (void)
   105 RandomDirection2dMobilityModel::ResetDirectionAndSpeed (void)
   106 {
   106 {
   107   double direction = UniformVariable::GetSingleValue (0, PI);
   107   double direction = UniformVariable().GetValue (0, PI);
   108   
   108   
   109   m_helper.UpdateWithBounds (m_bounds);
   109   m_helper.UpdateWithBounds (m_bounds);
   110   Vector position = m_helper.GetCurrentPosition ();
   110   Vector position = m_helper.GetCurrentPosition ();
   111   switch (m_bounds.GetClosestSide (position))
   111   switch (m_bounds.GetClosestSide (position))
   112     {
   112     {