📄 compute_avg_metrics.sh
字号:
#!/bin/csh -f############ Lamia ROMDHANI ###### This script is used to get the latency, goodput, bandwidth, medium utilisation and collision rate #results for each number of nodes. ##### Lamia ##########set max_nodes = 50set increment = 2set nodes = 2set name_file = AEDCF# if you use EDCF#set name_file = EDCFset gfile = $name_file.goodputset latfile = $name_file.latset bwfile = $name_file.bwset lowbwfile = $name_file.lowbwset lowbw1file = $name_file.lowbw1set chfile = $name_file.chrm -f $gfiletouch $gfilerm -f $latfiletouch $latfilerm -f $bwfiletouch $bwfilerm -f $lowbwfiletouch $lowbwfilerm -f $lowbw1filetouch $lowbw1filerm -f $chfiletouch $chfileecho "#nodes channel_use collision_rate " >> $chfile while ( $nodes <= $max_nodes ) 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 main_AEDCF_EDCF.tcl audio-video-Bt.tcl $nodes 5000 80 1 #If you want run EDCF # ns main_AEDCF_EDCF.tcl audio-video-Bt.tcl $nodes 0 0 0 set goodput = `wlan-goodput-normal audio-video-Bt.tcl 0.5` echo "$nodes $goodput " >> $gfile 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 audio-video-Bt.tcl $flow AGT ` echo "$lat_flow" >> mean.dat set bw_flow = `wlan-bw-mean audio-video-Bt.tcl $flow 0.5 ` echo "$bw_flow" >> mean-bw.dat set bw_lowflow = `wlan-bw-mean audio-video-Bt.tcl $lowflow 0.5 ` echo "$bw_lowflow" >> mean-lowbw.dat set bw_lowflow1 = `wlan-bw-mean audio-video-Bt.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 "$nodes $meandelay " >> $latfile echo "$nodes $meanbw " >> $bwfile echo "$nodes $meanlowbw " >> $lowbwfile echo "$nodes $meanlowbw1 " >> $lowbw1file set channel_results = `wlan-chutil-load audio-video-Bt.tcl` echo "$nodes $channel_results " >> $chfile @ nodes = $nodes + $increment endcompute-diff-goodput $name_file.goodput basic_EDCF.goodput Gain-$name_filecompute-bw-normal $name_file.lowbw $name_file.lowbwn 125.168747 compute-bw-normal $name_file.bw $name_file.bwn 7.835compute-bw-normal $name_file.lowbw1 $name_file.lowbw1n 15.653000
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -