55 #include "ns3/core-module.h" 
   56 #include "ns3/mobility-module.h" 
   57 #include "ns3/mobility-module.h" 
   58 #include "ns3/ns2-mobility-helper.h" 
   71       << 
", z=" << pos.z << 
"; VEL:" << vel.x << 
", y=" << vel.y
 
   72       << 
", z=" << vel.z << std::endl;
 
   76 int main (
int argc, 
char *argv[])
 
   78   std::string traceFile;
 
   89   cmd.
AddValue (
"traceFile", 
"Ns2 movement trace file", traceFile);
 
   90   cmd.
AddValue (
"nodeNum", 
"Number of nodes", nodeNum);
 
   91   cmd.
AddValue (
"duration", 
"Duration of Simulation", duration);
 
   92   cmd.
AddValue (
"logFile", 
"Log file", logFile);
 
   93   cmd.
Parse (argc,argv);
 
   96   if (traceFile.empty () || nodeNum <= 0 || duration <= 0 || logFile.empty ())
 
   98       std::cout << 
"Usage of " << argv[0] << 
" :\n\n" 
   99       "./waf --run \"ns2-mobility-trace" 
  100       " --traceFile=src/mobility/examples/default.ns_movements" 
  101       " --nodeNum=2 --duration=100.0 --logFile=ns2-mob.log\" \n\n" 
  102       "NOTE: ns2-traces-file could be an absolute or relative path. You could use the file default.ns_movements\n" 
  103       "      included in the same directory of this example file.\n\n" 
  104       "NOTE 2: Number of nodes present in the trace file must match with the command line argument and must\n" 
  105       "        be a positive number. Note that you must know it before to be able to load it.\n\n" 
  106       "NOTE 3: Duration must be a positive number. Note that you must know it before to be able to load it.\n\n";
 
  116   os.open (logFile.c_str ());
 
Smart pointer class similar to boost::intrusive_ptr. 
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument. 
static void Run(void)
Run the simulation. 
Vector GetPosition(void) const 
void Connect(std::string path, const CallbackBase &cb)
Vector GetVelocity(void) const 
static void CourseChange(std::ostream *os, std::string foo, Ptr< const MobilityModel > mobility)
void Install(void) const 
Read the ns2 trace file and configure the movement patterns of all nodes contained in the global ns3:...
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component. 
Helper class which can read ns-2 movement files and configure nodes mobility. 
Parse command-line arguments. 
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy(). 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
keep track of a set of node pointers. 
static Time Now(void)
Return the current simulation virtual time. 
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD. 
static void Stop(void)
Tell the Simulator the calling event should be the last one executed. 
Time Seconds(double value)
Construct a Time in the indicated unit. 
void Parse(int argc, char *argv[])
Parse the program arguments. 
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.