⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test-suite-friendly.tcl

📁 NS-2.28的802.11e协议扩展源代码
💻 TCL
📖 第 1 页 / 共 3 页
字号:
    set dumpfile_ [open temp.s w]    if {$quiet == "false"} {        set tracefile [open all.tr w]        $ns_ trace-all $tracefile    }    $self runTcp     $self runTcps        $ns_ at $stopTime0 "close $dumpfile_; $self finish_1 $testName_"    #$self traceQueues $node_(r1) [$self openTrace $stopTime $testName_]    $ns_ at $stopTime "$self cleanupAll $testName_"     if {$quiet == "false"} {	$ns_ at $stopTime2 "close $tracefile"    }    $ns_ at $stopTime2 "exec cp temp2.rands temp.rands; exit 0"    # trace only the bottleneck link    $ns_ run}## Random factor added to sending timesClass Test/randomized -superclass TestSuiteTest/randomized instproc init {} {    $self instvar net_ test_    set net_	net2    set test_	randomized    Agent/TFRC set overhead_ 0.5    Test/randomized instproc run {} [Test/slowStart info instbody run]    $self next}## Random factor added to sending timesClass Test/randomizedCA -superclass TestSuiteTest/randomizedCA instproc init {} {    $self instvar net_ test_    set net_	net2    set test_	randomizedCA    Agent/TFRC set overhead_ 0.5    Agent/TFRC set df_ 0.95    Agent/TFRC set ca_ 1    Test/randomizedCA instproc run {} [Test/slowStart info instbody run]    $self next}## Smaller random factor added to sending timesClass Test/randomized1 -superclass TestSuiteTest/randomized1 instproc init {} {    $self instvar net_ test_    set net_	net2    set test_	randomized1    Agent/TFRC set overhead_ 0.1    Test/randomized1 instproc run {} [Test/slowStart info instbody run]    $self next}## Smaller random factor added to sending timesClass Test/randomized1CA -superclass TestSuiteTest/randomized1CA instproc init {} {    $self instvar net_ test_    set net_	net2    set test_	randomized1CA    Agent/TFRC set overhead_ 0.1    Agent/TFRC set df_ 0.95    Agent/TFRC set ca_ 1    Test/randomized1CA instproc run {} [Test/slowStart info instbody run]    $self next}Class Test/slow -superclass TestSuiteTest/slow instproc init {} {    $self instvar net_ test_    set net_	net2a    set test_	slow    Agent/TFRCSink set discount_ 1    Agent/TFRCSink set smooth_ 1    Agent/TFRC set df_ 0.95    Agent/TFRC set ca_ 1    $self next}Test/slow instproc run {} {    global quiet    $self instvar ns_ node_ testName_ interval_ dumpfile_    $self setTopo#    [$ns_ link $node_(r1) $node_(r2)] set bandwidth 0.001Mb#    [$ns_ link $node_(r1) $node_(r2)] set queue-limit 5    set interval_ 100    set stopTime 4000.0    set stopTime0 [expr $stopTime - 0.001]    set stopTime2 [expr $stopTime + 0.001]    set dumpfile_ [open temp.s w]    if {$quiet == "false"} {        set tracefile [open all.tr w]        $ns_ trace-all $tracefile    }    set tf1 [$ns_ create-connection TFRC $node_(s1) TFRCSink $node_(s3) 0]    $ns_ at 0.0 "$tf1 start"    $self tfccDump 1 $tf1 $interval_ $dumpfile_    $ns_ at $stopTime0 "close $dumpfile_; $self finish_1 $testName_"    #$self traceQueues $node_(r1) [$self openTrace $stopTime $testName_]    $ns_ at $stopTime "$self cleanupAll $testName_"     if {$quiet == "false"} {	$ns_ at $stopTime2 "close $tracefile"    }    $ns_ at $stopTime2 "exec cp temp2.rands temp.rands; exit 0"    # trace only the bottleneck link    $ns_ run}Class Test/twoDrops -superclass TestSuiteTest/twoDrops instproc init {} {    $self instvar net_ test_ drops_ stopTime1_    set net_	net2    set test_	twoDrops    Agent/TFRCSink set discount_ 1    Agent/TFRCSink set smooth_ 1    Agent/TFRC set df_ 0.95    Agent/TFRC set ca_ 1    set drops_ " 2 3 "    set stopTime1_ 5.0    $self next}Class Test/manyDrops -superclass TestSuite Test/manyDrops instproc init {} {     $self instvar net_ test_ drops_ stopTime1_    set net_    net2    set test_   manyDrops     Agent/TFRCSink set discount_ 1    Agent/TFRCSink set smooth_ 1    Agent/TFRC set df_ 0.95    Agent/TFRC set ca_ 1##  set stopTime1_ 100.0    set stopTime1_ 100.0#    set drops_ " 0 1 "    set drops_ " 0 1 2 3 4 5 6 "    Test/manyDrops instproc run {} [Test/twoDrops info instbody run ]    $self next}Test/twoDrops instproc run {} {    global quiet    $self instvar ns_ node_ testName_ interval_ dumpfile_ drops_ stopTime1_    $self setTopo    set interval_ 1    set stopTime $stopTime1_    set stopTime0 [expr $stopTime - 0.001]    set stopTime2 [expr $stopTime + 0.001]    set dumpfile_ [open temp.s w]    if {$quiet == "false"} {        set tracefile [open all.tr w]        $ns_ trace-all $tracefile    }    set em [new ErrorModule Fid]    set lossylink_ [$ns_ link $node_(r1) $node_(r2)]    $lossylink_ errormodule $em    $em default pass    set emod [$lossylink_ errormodule]    set errmodel [new ErrorModel/List]    $errmodel unit pkt    $errmodel droplist $drops_    $emod insert $errmodel    $emod bind $errmodel 0    set tf1 [$ns_ create-connection TFRC $node_(s1) TFRCSink $node_(s3) 0]    $ns_ at 0.0 "$tf1 start"    $self tfccDump 1 $tf1 $interval_ $dumpfile_    $ns_ at $stopTime0 "close $dumpfile_; $self finish_1 $testName_"    #$self traceQueues $node_(r1) [$self openTrace $stopTime $testName_]    $ns_ at $stopTime "$self cleanupAll $testName_"     if {$quiet == "false"} {	$ns_ at $stopTime2 "close $tracefile"    }    $ns_ at $stopTime2 "exec cp temp2.rands temp.rands; exit 0"    # trace only the bottleneck link    $ns_ run}Class Test/HighLoss -superclass TestSuiteTest/HighLoss instproc init {} {    $self instvar net_ test_ stopTime1_    set net_	net2    set test_ HighLoss	    Agent/TFRCSink set discount_ 1    Agent/TFRCSink set smooth_ 1    Agent/TFRC set df_ 0.95    Agent/TFRC set ca_ 1    set stopTime1_ 60    $self next}Test/HighLoss instproc run {} {    global quiet    $self instvar ns_ node_ testName_ interval_ dumpfile_ stopTime1_    $self setTopo    set interval_ 1    set stopTime $stopTime1_    set stopTime0 [expr $stopTime - 0.001]    set stopTime2 [expr $stopTime + 0.001]    set dumpfile_ [open temp.s w]    if {$quiet == "false"} {        set tracefile [open all.tr w]        $ns_ trace-all $tracefile    }    set tf1 [$ns_ create-connection TFRC $node_(s1) TFRCSink $node_(s3) 0]    $ns_ at 0.0 "$tf1 start"    set udp1 [$ns_ create-connection UDP $node_(s2) UDP $node_(s4) 1]		set cbr1 [$udp1 attach-app Traffic/CBR]		$cbr1 set rate_ 3Mb		$ns_ at [expr $stopTime1_/3.0] "$cbr1 start"   		$ns_ at [expr 2.0*$stopTime1_/3.0] "$cbr1 stop"       $self tfccDump 1 $tf1 $interval_ $dumpfile_    $ns_ at $stopTime0 "close $dumpfile_; $self finish_1 $testName_"    #$self traceQueues $node_(r1) [$self openTrace $stopTime $testName_]    $ns_ at $stopTime "$self cleanupAll $testName_"     if {$quiet == "false"} {	$ns_ at $stopTime2 "close $tracefile"    }    $ns_ at $stopTime2 "exec cp temp2.rands temp.rands; exit 0"    # trace only the bottleneck link    $ns_ run}Class Test/HighLossConservative -superclass TestSuiteTest/HighLossConservative instproc init {} {    $self instvar net_ test_ stopTime1_    set net_	net2    set test_ HighLossConservative	    Agent/TFRCSink set discount_ 1    Agent/TFRCSink set smooth_ 1    Agent/TFRC set df_ 0.95    Agent/TFRC set ca_ 1    Agent/TFRC set conservative_ true    set stopTime1_ 60    Test/HighLossConservative instproc run {} [Test/HighLoss info instbody run ]    $self next}Class Test/HighLossTCP -superclass TestSuiteTest/HighLossTCP instproc init {} {    $self instvar net_ test_ stopTime1_    set net_	net2    set test_ HighLossTCP	    Agent/TFRCSink set discount_ 1    Agent/TFRCSink set smooth_ 1    Agent/TFRC set df_ 0.95    Agent/TFRC set ca_ 1    set stopTime1_ 60    $self next}Test/HighLossTCP instproc run {} {    global quiet    $self instvar ns_ node_ testName_ interval_ dumpfile_ stopTime1_    $self setTopo    set interval_ 1    set stopTime $stopTime1_    set stopTime0 [expr $stopTime - 0.001]    set stopTime2 [expr $stopTime + 0.001]    set dumpfile_ [open temp.s w]    if {$quiet == "false"} {        set tracefile [open all.tr w]        $ns_ trace-all $tracefile    }    set tcp1 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(s3) 0]    set ftp1 [$tcp1 attach-app FTP]    $ns_ at 0.0 "$ftp1 start"    set udp1 [$ns_ create-connection UDP $node_(s2) UDP $node_(s4) 1]		set cbr1 [$udp1 attach-app Traffic/CBR]		$cbr1 set rate_ 3Mb		$ns_ at [expr $stopTime1_/3.0] "$cbr1 start"   		$ns_ at [expr 2.0*$stopTime1_/3.0] "$cbr1 stop"       $ns_ at $stopTime0 "close $dumpfile_; $self finish_1 $testName_"    #$self traceQueues $node_(r1) [$self openTrace $stopTime $testName_]    $ns_ at $stopTime "$self cleanupAll $testName_"    if {$quiet == "false"} {	$ns_ at $stopTime2 "close $tracefile"    }    $ns_ at $stopTime2 "exec cp temp2.rands temp.rands; exit 0"    # trace only the bottleneck link    $ns_ run}Class Test/printLosses -superclass TestSuiteTest/printLosses instproc init {} {    $self instvar net_ test_    set net_	net2    set test_	printLosses    Agent/TFRCSink set discount_ 1    Agent/TFRCSink set printLosses_ 1    Agent/TFRCSink set printLoss_ 1    $self next}Test/printLosses instproc run {} {    global quiet    $self instvar ns_ node_ testName_ interval_ dumpfile_    $self setTopo    set interval_ 0.1    set stopTime 3.0    set stopTime0 [expr $stopTime - 0.001]    set stopTime2 [expr $stopTime + 0.001]    set dumpfile_ [open temp.s w]    if {$quiet == "false"} {        set tracefile [open all.tr w]        $ns_ trace-all $tracefile    }    set tf1 [$ns_ create-connection TFRC $node_(s1) TFRCSink $node_(s3) 0]    $ns_ at 0.0 "$tf1 start"    $self tfccDump 1 $tf1 $interval_ $dumpfile_    $ns_ at $stopTime0 "close $dumpfile_; $self finish_1 $testName_"    #$self traceQueues $node_(r1) [$self openTrace $stopTime $testName_]    $ns_ at $stopTime "$self cleanupAll $testName_"    if {$quiet == "false"} {	$ns_ at $stopTime2 "close $tracefile"    }    $ns_ at $stopTime2 "exec cp temp2.rands temp.rands; exit 0"    # trace only the bottleneck link    $ns_ run}TestSuite runTest

⌨️ 快捷键说明

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