R. Lo Cigno, P. Larcheri 802.11e closed-loop scheduling Description: ns-2 package for 802.11e clo

源代码在线查看: rng-test.tcl

软件大小: 9951 K
上传用户: C69222090
关键词: 802.11 R. P. Description
下载地址: 免注册下载 普通下载 VIP

相关代码

				#				# Usage: ns rng-test.tcl [replication number]				#								if {$argc > 1} {				    puts "Usage: ns rng-test.tcl \[replication number\]"				    exit				}				set run 1				if {$argc == 1} {				    set run [lindex $argv 0]				}				if {$run < 1} {				    set run 1				}								# seed the default RNG				global defaultRNG				$defaultRNG seed 9999								# create the RNGs and set them to the correct substream				set arrivalRNG [new RNG]				set sizeRNG [new RNG]				for {set j 1} {$j < $run} {incr j} {				    $arrivalRNG next-substream				    $sizeRNG next-substream				}								# arrival_ is a exponential random variable describing the time between				# consecutive packet arrivals				set arrival_ [new RandomVariable/Exponential]				$arrival_ set avg_ 5				$arrival_ use-rng $arrivalRNG								# size_ is a uniform random variable describing packet sizes				set size_ [new RandomVariable/Uniform]				$size_ set min_ 100				$size_ set max_ 5000				$size_ use-rng $sizeRNG								# print the first 5 arrival times and sizes				for {set j 0} {$j < 5} {incr j} {				    puts [format "%-8.3f  %-4d" [$arrival_ value] \					    [expr round([$size_ value])]]				}							

相关资源