example1a.tcl

来自「NS-2.28的802.11e协议扩展源代码」· TCL 代码 · 共 33 行

TCL
33
字号
#Create a simulator objectset ns [new Simulator]#Open the nam trace fileset nf [open out.nam w]$ns namtrace-all $nf#Define a 'finish' procedureproc finish {} {        global ns nf        $ns flush-trace	#Close the trace file        close $nf	#Execute nam on the trace file        exec nam out.nam &        exit 0}# Insert your own code for topology creation# and agent definitions, etc. hereset n0 [$ns node]set n1 [$ns node]$ns duplex-link $n0 $n1 1Mb 10ms DropTail#Call the finish procedure after 5 seconds simulation time$ns at 5.0 "finish"#Run the simulation$ns run

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?