看n2實(shí)例 #Create a simulator object
set NS [new Simulator]
#Define different colors for data flows
#$NS color 1 Blue
#$NS color 2 Red
#Open the nam trace file
set nf [open out-1.nam w]
$NS namtrace-all $nf
set f0 [open out0.tr w]
set f1 [open out1.tr w]
#Define a finish procedure
proc finish {} {
global NS nf
$NS flush-trace
#Close the trace file
close $nf
#Execute nam on the trace file
exit 0
}
#Create four nodes
set n0 [$NS node]
set n1 [$NS node]
set n2 [$NS node]
set n3 [$NS node]
#Create links between the nodes
$NS duplex-link $n0 $n2 1Mb 10ms
標(biāo)簽:
simulator
Simulator
different
Create
上傳時(shí)間:
2016-07-02
上傳用戶(hù):wfl_yy