[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug in ns-trace.tcl (gen-map)
I don't know why this happens, the code in the latest version of
ns has some strange modifications, here is one of them:
in /tcl/lib/ns-trace.lib, for instproc gen-map(), in old version:
Simulator instproc gen-map {} {
# Did you ever see such uglier code? duh?
#
$self instvar Node_ link_
set nn [Node set nn_]
for {set i 0} {$i < $nn} {incr i} {
set n $Node_($i)
puts "Node [$n tn]"
Make sense to me., but in the new version becomes:
Simulator instproc gen-map {} {
# Did you ever see such uglier code? duh?
#
$self instvar Node_ link_ MobileNode_
set nn [Node set nn_]
for {set i 0} {$i < $nn} {incr i} {
if ![info exists Node($i)] {
~~~~~this is obviously wrong
incr i
continue
}
puts "Node [$n tn]"
~~~ where does this $n come from?
And this difference is not reflected in the CVS record, what happened?
P.S. Thanks to Alton Yu pointing out that "gen-map" is also dead in new
version NS. I bet there must be similar problems in DV routing codes.