Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经使用 TCL 脚本在 NS2 中模拟了一个基于 2 节点 tcp 的双工链路和队列通信。我想在节点通信期间访问当前队列大小。那么如何访问当前队列大小并将其分配给变量?
使用此代码在终端上获取 cwnd 大小。
proc plotWindow {tcpSource outfile} { global ns set now [$ns now] set cwnd [$tcpSource set cwnd_] puts $outfile "$now $cwnd" $ns at [expr $now+0.1] "plotWindow $tcpSource $outfile" } $ns at 0.0 "plotWindow $tcp1 stdout"