- Home Page of ProjectGuideline.com ›
- Forums ›
- Get Help to do your B.E., and M.E., M.Tech., & M.S., Project in Ns2 ›
- How to get the speed and direction of mobileNode in NS2
Dear everbody,
I’m looking for a way to get the speed and the direction of a mobileNode:
I need this information to modify an existing routing protocole.
I tried to use already existing functions from the class MobileNode.cc :
Mobilenode *node;
double speed = node->speed();
double dx= node->dX(); # direction in the x axis
double dy= node->dY(); # direction in the y axis
but this doesn’t seem to give the right values
Please if someone has any idea of how to add these attributes in a routing protocole: which modification should be done in c++ and tcl files
I’ll be really greateful
Thans in advance
Nadia
Dear Nadia,
I just need a littlt help from you regarding, how can i access the member functions of mobile node e.d dictance(MobileNode *) , dX() etc,
And like how the nodes defined in the main tcl file will be acting as pointer to these functions.
Thanking in anticipation.
Regards,
Mohsin Fayyaz
Nadia,
Did you use Mobilenode * node in routing.cc ?
Make sure when you call the variables of MobileNode.cc file,
First make an instance of the current node.
Then use this to access the variables of the node’s MobileNode.cc file. Otherwise it will give you garbage value.