In C++ code you can access to the node position simply by calling the
getLoc() method of the MobileNode class (see common/mobilenode.h,
common/mobilenode.cc for more informations)
For example:
double x, y, z;
node-getLoc(x, y, z);
You can ignore the z value since height is not yet supported in ns-2.
regards
Fabio
Hi ,
Can we find the position of the node in C program?
I'll assign the node with its position in tcl file
statically.then i have to find the position(x and y
dimension) of the node in C coding.is there any
command for getting the positions directly? If anyone
knows,tell me how to find the position of the node in
C file or tell me how to find logically?
Dheepa
Send instant messages to your online friends http://in.messenger.yahoo.com