#!/bin/bash
###############################################################################################
#	Advanced RTI System, ARTÌS			http://pads.cs.unibo.it
#	Large Unstructured NEtwork Simulator (LUNES)
#
#	Description:
#		"quick-and-dirty" script to collect the results obtained by the
#		execution scripts of LUNES and to output data in file that can
#		be used by gnuplot to generate graphs
#
#	Authors:
#		First version by Gabriele D'Angelo <g.dangelo@unibo.it>
#
################################################################################################



FILE="results-list.txt"
RESULTS_DIRECTORY="/srv/lunes/results/"

# Some cleaning
rm -f broadcast.dat fixed.dat adaptive.dat adaptive_specific.dat adaptive_sender.dat


##################################################################################à
find $RESULTS_DIRECTORY -iname broadcast-STATS.dat > results-list.txt
exec < $FILE
while read LINE
do
echo `cat $LINE` >> broadcast.dat
done

rm -f $FILE

##################################################################################à
find $RESULTS_DIRECTORY -iname fixedprob-STATS.dat > results-list.txt
exec < $FILE
while read LINE
do
echo `cat $LINE` >> fixed.dat
done

rm -f $FILE

##################################################################################à
find $RESULTS_DIRECTORY -iname adaptive-STATS.dat > results-list.txt
exec < $FILE
while read LINE
do
echo `cat $LINE` >> adaptive.dat
done

rm -f $FILE

##################################################################################à
find $RESULTS_DIRECTORY -iname adaptive_specific-STATS.dat > results-list.txt
exec < $FILE
while read LINE
do
echo `cat $LINE` >> adaptive_specific.dat
done

rm -f $FILE

##################################################################################à
find $RESULTS_DIRECTORY -iname adaptive_sender-STATS.dat > results-list.txt
exec < $FILE
while read LINE
do
echo `cat $LINE` >> adaptive_sender.dat
done

rm -f $FILE

##################################################################################à

