]> rtime.felk.cvut.cz Git - frescor/fwp.git/blob - wme_test/plot
Added scripts for running multiple experiments in batch manner and plot their results.
[frescor/fwp.git] / wme_test / plot
1 #!/bin/sh
2
3 while getopts esp opt
4 do
5     case $opt in
6         e) SET_TERM_TEMPLATE='set term postscript color eps size 12cm,9cm; set output "${FILE}.eps"';;
7         s) SET_TERM_TEMPLATE='set term svg; set output "${FILE}.svg"';;
8         p) SET_TERM_TEMPLATE='set term png; set output "${FILE}.png"';;
9     esac
10 done
11
12 shift $(($OPTIND - 1)) 
13
14 while [ $# -gt 0 ];
15 do
16     FILE=`basename "$1" .dat`
17     shift
18
19     COMMAND="Results of: $(grep 'Invoked as' ${FILE}.dat|grep -o 'wclient.*'|sed -e 's/ -o [^ ]*//' -e 's/ [^ ]* ?$//')"
20     STREAMS="$(grep -o 'Stream.*' ${FILE}.dat|sort|while read LINE; do echo $LINE\\n; done|tr -d '\n')"
21
22     TITLE="${COMMAND}\n\n${STREAMS}"
23
24     SET_TERM=$(echo $SET_TERM_TEMPLATE|sed -e s/\${FILE}/$FILE/)
25     cat <<EOF | gnuplot -persist
26 ${SET_TERM}
27 set xlabel "Delay [ms]"
28 set ylabel "Probability distribution function [%]"
29 set title "${TITLE}"
30 set key right bottom nobox
31 set style data linespoints
32 set grid
33 plot [0:*] [0.01:99.9999] "${FILE}.dat" index 1 using 1:2 title "AC_VO",\
34                     "${FILE}.dat" index 1 using 1:3 title "AC_VI",\
35                     "${FILE}.dat" index 1 using 1:4 title "AC_BE",\
36                     "${FILE}.dat" index 1 using 1:5 title "AC_BK"
37 EOF
38 done