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

📄 compute_avg_metrics.sh

📁 对IEEE 802.11e里的分布式信道接入算法EDCA进行改进
💻 SH
字号:
#!/bin/csh -fset max_nodes = 50set max_simulations = 5set increment = 2set nodes = 2set name_file = basic_EDCF#set name_file = ni_adaptive+PF#set name_file = ni_adaptive#set name_file = lamia_adaptive+PF#set name_file = lamia_adaptive#set name_file = slow_decrease#set name_file = slow_decreas+PF#set name_file = per-classe+CWdelta+PF#set name_file = per-classe+CWdelta#set name_file = per-classe+CWdelta+PF+condition#set name_file = lamia_adaptive+diff-PF#set name_file = total_coll_rateset gfile = $name_file.goodputset latfile = $name_file.latset bwfile = $name_file.bwset lowbwfile = $name_file.lowbwset lowbw1file = $name_file.lowbw1set chfile = $name_file.chset collfile = $name_file.collrm -f $gfiletouch $gfilerm -f $latfiletouch $latfilerm -f $bwfiletouch $bwfilerm -f $lowbwfiletouch $lowbwfilerm -f $lowbw1filetouch $lowbw1filerm -f $chfiletouch $chfilerm -f $collfiletouch $collfile#echo "#nodes  channel_use 	collision_rate "  >> $chfilewhile ( $nodes <= $max_nodes ) echo "nodes $nodes"   rm -f "gfile_many" touch "gfile_many" rm -f "latfile_many" touch "latfile_many" rm -f "bwfile_many" touch "bwfile_many" rm -f "lowbwfile_many" touch "lowbwfile_many" rm -f "lowbw1file_many" touch "lowbw1file_many" rm -f "chfile_many" touch "chfile_many"     set simulations = 1  while ( $simulations <= $max_simulations )  echo "simulation $simulations"   	rm -f "mean.dat"	touch "mean.dat"	rm -f "mean-bw.dat"	touch "mean-bw.dat"		rm -f "mean-lowbw.dat"	touch "mean-lowbw.dat"			rm -f "mean-lowbw1.dat"	touch "mean-lowbw1.dat"		        #ns lamia_test1.tcl scen_heterogen.tcl $nodes         #ns ni_test1.tcl scen_heterogen.tcl $nodes 5000 80        #ns ni_test1.tcl test_three.tcl $nodes 5000 80        #ns lamia_test1.tcl test_three.tcl $nodes 	    ns ni_test1.tcl test_three.tcl $nodes 0 0		    #set goodput = `wlan-goodput-normal scen_heterogen.tcl 0.5`	 set goodput = `wlan-goodput-normal test_three.tcl 0.5`	 	 	 echo "$goodput "  >> gfile_many	 set lowflow = $nodes	 @ lowflow1 = $nodes + $nodes 	 	 #echo "$lowflow1 "	 set flow = 0	 	 set lat_flow = 0	 set bw_flow = 0	 set bw_lowflow = 0	 set bw_lowflow1 = 0	 	   while ( $flow < $nodes )	      	      #set lat_flow = `wlan-lat-mean  scen_heterogen.tcl $flow AGT `				  set lat_flow = `wlan-lat-mean test_three.tcl $flow AGT `				echo "$lat_flow"  >> mean.dat					      #set bw_flow = `wlan-bw-mean  scen_heterogen.tcl $flow 0.5 `				set bw_flow = `wlan-bw-mean  test_three.tcl $flow 0.5 `				echo "$bw_flow"  >> mean-bw.dat								#set bw_lowflow = `wlan-bw-mean  scen_heterogen.tcl $lowflow 0.5 `				 set bw_lowflow = `wlan-bw-mean  test_three.tcl $lowflow 0.5 `				echo "$bw_lowflow"  >> mean-lowbw.dat								set bw_lowflow1 = `wlan-bw-mean  test_three.tcl $lowflow1 0.5 `				echo "$bw_lowflow1"  >> mean-lowbw1.dat					       @ flow = $flow + 1				 @ lowflow = $lowflow + 1				 @ lowflow1 = $lowflow1 + 1	   end		 	 set meandelay = `compute-mean mean.dat $nodes`	 set meanbw = `compute-mean mean-bw.dat $nodes`	 set meanlowbw = `compute-mean mean-lowbw.dat $nodes`	 set meanlowbw1 = `compute-mean mean-lowbw1.dat $nodes`	 	 echo "$meandelay "  >> latfile_many	 echo "$meanbw "  >> bwfile_many	 echo "$meanlowbw "  >> lowbwfile_many	 echo "$meanlowbw1 "  >> lowbw1file_many	 	 #set channel_results = `wlan-chutil-load scen_heterogen.tcl` 	  set channel_results = `wlan-chutil-load test_three.tcl`  	  echo "$channel_results "  >> chfile_many		         @ simulations = $simulations + 1	   end  set avg_good = `compute-mean gfile_many 5`	  echo "$nodes $avg_good" >> $gfile  set avg_delay = `compute-mean latfile_many 5`	  echo "$nodes $avg_delay" >> $latfile  set avg_bw = `compute-mean bwfile_many 5`	  echo "$nodes $avg_bw" >> $bwfile  set avg_lowbw = `compute-mean lowbwfile_many 5`	  echo "$nodes $avg_lowbw" >> $lowbwfile  set avg_lowbw1 = `compute-mean lowbw1file_many 5`	  echo "$nodes $avg_lowbw1" >> $lowbw1file	  set avg_ch = `compute-mean-ch chfile_many 5`	  echo "$nodes $avg_ch" >> $chfile  set avg_coll = `compute-mean-coll chfile_many 5`	  echo "$nodes $avg_coll" >> $collfile  @ nodes = $nodes  +  $increment  end compute-diff-goodput $name_file.goodput  basic_EDCF.goodput Gain-$name_file#compute-bw-normal $name_file.lowbw $name_file.lowbwn 125.168747 #compute-bw-normal $name_file.bw $name_file.bwn 7.835#compute-bw-normal $name_file.lowbw1 $name_file.lowbw1n 15.653000

⌨️ 快捷键说明

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