Sir,
I am getting the error "can't read "node_(0)": no such variable" while I was trying to add mobility.I set the no.of nodes as 5 and defined for loop from 0 to <val(n) .Parts of my code is given below.Can you help me to resolve my error.
-------------------------------------------------------------------------------------------------
set val(rp) AOMDV ; # routing protocol
set val(n) 5.0 ;
-------------------------------------------------------
for {set i 0} {$i < $val(n) } {incr i} {
set node($i) [$ns node]
$node($i) random-motion 0; # disable random motion
}
-------------------------------------------------------------------------------------------------------
$ns at 0.0 "$n(0) setdest 91.7 68.0 10000.0"
$ns at 0.5 "$n(1) setdest 28.4 168.3 10000.0"
$ns at 0.7 "$n(2) setdest 27.3 227.4 10000.0"
$ns at 5.0 "$n(3) setdest 20.05 3.98 10000.0"
$ns at 0.0 "$n(4) setdest 30.8 435.3 10000.0"
-----------------------------------------------------------------------------------------------------
for {set i 0} {$i < $val(n) } {incr i} {
$ns at $val(end) "$node($i) reset";
}