[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] array and procedure?



Hi!
 
if I have:
 
.....................
for {set i 0} {$i < $number_node} {incr i} {
 set n($i) [$ns node]
       

and after I have
 
proc makeflowmon {} {
    
    global counter  ns    number_flows    ;# i.e. number_flows=3 and number_node=8
    global n($number_flows)  n([expr $number_flows+1])
   
    set counter [$ns makeflowmon Fid]            
    set bottleneck [$ns link $n($number_flows)  $n([expr $number_flows+1])]        
    $ns attach-fmon $bottleneck $counter         
    
     for {set i 0} {$i < $number_flows} {incr i} {
     global  tcp($i)bw 
     set tcp($i)bw  0
     }
   
}
it doesn't work.It can't read n(3) and n(4).........why???
help me!!!
is there any problem with my array?