Dear Najma, Yes, you can get the node position whenever and where ever you require in ns2. For instance, when you declare the grid in tcl script and read the nodes initial position and movement pattern from a file, all these information is stored in the variables in mobilenode.cc file.
Now lets say, you are working in a routing protocol such as AODV or DSDV, there you can access the nodes position at any time instant by accessing the node object. After that you can give any condition which nodes to discard and which to not. Hope it helps. Mubashir Husain Rehmani https://sites.google.com/site/mshrehmani/ On 5 May 2014 14:09, Najma Ismat <najma_is...@hotmail.com> wrote: > > Hi,I am want to implement grid topology in mobile wsn and before the start > of specific protocol operation i want to identify nodes in a grid so that > routing protocol should only used nodes that exists in that grid. Nodes > initial position and movement pattern is stored and taken from mobility > pattern file. Can anyone guide how to achieve this also how should i run > individual routing solution in every grid. I'll be extremely grateful if > anyone can guide.Regards,Najma Ismat > -- Mubashir Husain Rehmani Assistant Professor, Department of Electrical Engineering, COMSATS Institute of Information Technology, Wah Cantt, Pakistan