Welcome to LQ!
Please place your code snippets inside [CODE]...[/CODE]
tags for better readability. You may type those yourself or click the "
#" button in the edit controls.
A quick search for "localization ns2" using the search link in the sidebar of this page turns up several useful threads, including these...
https://www.linuxquestions.org/quest...s2-4175609915/
https://www.linuxquestions.org/quest...s2-4175538215/
If you can't find what you are looking for there, perhaps one of our NS2 gurus will stop by with more information. Unfortunately I am not familiar with NS2 at this level.
Good luck!