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 ());
double x
x coordinate of vector
smart pointer class similar to boost::intrusive_ptr
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Build bound Callbacks which take varying numbers of arguments, and potentially returning a value...
static void Run(void)
Run the simulation until one of:
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:...
Helper class which can read ns-2 movement files and configure nodes mobility.
Parse command-line arguments.
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
int main(int argc, char *argv[])
keep track of a set of node pointers.
double y
y coordinate of vector
static Time Now(void)
Return the "current simulation time".
void AddValue(const std::string &name, const std::string &help, T &value)
Add a program argument, assigning to POD.
static void Stop(void)
If an event invokes this method, it will be the last event scheduled by the Simulator::run method bef...
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.
void LogComponentEnable(char const *name, enum LogLevel level)
double z
z coordinate of vector