#include "ns3/core-module.h" #include "ns3/mobility-module.h" #include "ns3/ns2-mobility-helper.h" #include "ns3/netanim-module.h" using namespace ns3; int main (int argc, char *argv[]) { // Create Ns2MobilityHelper with the specified trace log file as parameter Ns2MobilityHelper ns2 = Ns2MobilityHelper ("MobisimFreeway.txt"); // Create Moble nodes. NodeContainer MobileNodes; MobileNodes.Create (10); // configure movements for each node, while reading trace file ns2.Install (); AnimationInterface anim ("SimpleNS3SimulationWithMobisimFreeway-mobility-trace.xml"); for(int i=0;i<10;i++) anim.UpdateNodeImage (i, anim.AddResource ("/home/jason/ns-allinone-3.25/ns-3.25/car-icon.png") ); Simulator::Stop (Seconds (100)); Simulator::Run (); return 0; }