Hi,

I would like to to get a mobile node coordinates at a given time in TCL
script. I have a procedure like this:

proc getLocations { node_a tstart tend }  {

        set time-step 0.1
        set t $tstart
        set x -1
        set y -1
        while {$t <= $tend} {
        
                puts "t is $t----x=[$node_a set X_] ----y=[$node_a set Y_] "
                set t [expr {$t + $time-step}]
                }
        
}
$ns at 0 "getLocations $n(0) 0 $val(stop)";




But  -x=[$node_a set X_] ----y=[$node_a set Y_] always return the initial
values of X_ and Y_ even if the node moves.

Do you know what should I do?

I see that by setting "Movement trace ON " in node configuration you can
print nodes positions in the trace file but how can I access them via TCL, I
think I should use the GOD object, but not sure how can I do it using only
TCL script.

Thanks for your help,
Best,
Behnaz
-- 
View this message in context: 
http://old.nabble.com/Get-a-mobile-node-coordinates-at-a-given-time-%28in-TCL-%29-tp34670605p34670605.html
Sent from the ns-users mailing list archive at Nabble.com.

Reply via email to