[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] A confused problem about tcl syntax
Hi!
I have one weird problem about using tcl. At first, I have set up Vegas
connections successfully. While I add a procedure "record" like the following,
it can't be executed for "vegas($i)" not found. Is it not allowable to add
brackets in the proc or do I use the wrong way?
Hope someone would give me a hint or I have to repeat coding for numerous
connections.
Thanks in advance
Best regard
Robert
############# Set up TCP/Vegas Agent #############
for {set i 1} {$i <= $node_no} {incr i} {
set vegas($i) [new Agent/TCP/Vegas]
puts stdout "vegas($i) init"
$vegas($i) set class_ $i
$vegas($i) set fid_ $i
$vegas($i) set v_alpha_ 1
$vegas($i) set v_beta_ 3
set sink($i) [new Agent/TCPSink]
$ns attach-agent $src($i) $vegas($i)
$ns attach-agent $dst($i) $sink($i)
$ns connect $vegas($i) $sink($i)
set ftp($i) [new Application/FTP]
$ftp($i) attach-agent $vegas($i)
}