- Home Page of ProjectGuideline.com ›
- Forums ›
- Help for Ns2 Projects, Ns2 Code, Matlab Projects, Matlab Code, etc., ›
- Getting Coordinates of a node in ns2 using tcl
Participant
Hi i am a beginner in NS2. In my project I am creating various nodes in a network and they get deployed at random positions when i don’t set them positions. Now, I want to find the position of these nodes. I want to get the X Y and Z coordinates of these nodes as i want to use these coordinates to do further processing. Is there any simple way in tcl to get the coordinates of the nodes deployed. Any help ll be appreciated..
Keymaster
It is very simple.
set Locationx [$node(1) set X_ ]
set Locationy [$node(1) set Y_ ]
set Locationz [$node(1) set Z_ ]