diff --git a/samples/main-random-walk.cc b/samples/main-random-walk.cc index b1b542c17..cccd64936 100644 --- a/samples/main-random-walk.cc +++ b/samples/main-random-walk.cc @@ -16,11 +16,13 @@ using namespace ns3; static void -CourseChange (ns3::TraceContext const&, Ptr position) +CourseChange (ns3::TraceContext const&, Ptr mobility) { - Position pos = position->Get (); - std::cout << Simulator::Now () << ", pos=" << position << ", x=" << pos.x << ", y=" << pos.y - << ", z=" << pos.z << std::endl; + Position pos = mobility->Get (); + Speed vel = mobility->GetSpeed (); + std::cout << Simulator::Now () << ", model=" << mobility << ", POS: x=" << pos.x << ", y=" << pos.y + << ", z=" << pos.z << "; VEL:" << vel.dx << ", y=" << vel.dy + << ", z=" << vel.dz << std::endl; } int main (int argc, char *argv[])