--- samples-a/main-random-walk.cc 2008-05-14 17:29:58.000000000 -0400 +++ samples/main-random-walk.cc 2008-05-14 17:28:44.000000000 -0400 @@ -7,22 +7,12 @@ using namespace ns3; -static void -CourseChange (ns3::TraceContext const&, Ptr mobility) -{ - Vector pos = mobility->GetPosition (); - Vector vel = mobility->GetVelocity (); - std::cout << Simulator::Now () << ", model=" << mobility << ", POS: x=" << pos.x << ", y=" << pos.y - << ", z=" << pos.z << "; VEL:" << vel.x << ", y=" << vel.y - << ", z=" << vel.z << std::endl; -} - int main (int argc, char *argv[]) { Config::SetDefault ("ns3::RandomWalk2dMobilityModel::Mode", StringValue ("Time")); Config::SetDefault ("ns3::RandomWalk2dMobilityModel::Time", StringValue ("2s")); Config::SetDefault ("ns3::RandomWalk2dMobilityModel::Speed", StringValue ("Constant:1.0")); - Config::SetDefault ("ns3::RandomWalk2dMobilityModel::Bounds", StringValue ("0:200:0:100")); + Config::SetDefault ("ns3::RandomWalk2dMobilityModel::Bounds", RectangleValue (Rectangle(0, 200, 0, 200))); CommandLine cmd; cmd.Parse (argc, argv); @@ -40,10 +30,8 @@ "Mode", StringValue ("Time"), "Time", StringValue ("2s"), "Speed", StringValue ("Constant:1.0"), - "Bounds", StringValue ("0:200:0:100")); + "Bounds", RectangleValue (Rectangle(0, 200, 0, 200))); mobility.InstallAll (); - Config::Connect ("/NodeList/*/$ns3::MobilityModelNotifier/CourseChange", - MakeCallback (&CourseChange)); Simulator::StopAt (Seconds (100.0));