nam

ns2 cannot connect to existing nam instance

旧城冷巷雨未停 提交于 2019-12-24 07:37:13
问题 I'm trying to run the below code using nam. set ns [new Simulator] set nf [open lab1.nam w] $ns namtrace-all $nf set f [open lab1.tr w] proc record {} { global sink f set ns [Simulator instance] set time 0.12 set bw [$sink set bytes_] set now [$ns now] puts $f "$now [expr (($bw/$time)*8/1000000)]" $sink set bytes_ 0 $ns at [expr $now+$time] "record" } proc finish {} { global ns nf f $ns flush-trace close $nf close $f exit 0 } set n0 [$ns node] set n1 [$ns node] $ns duplex-link $n0 $n1 4Mb