# ======================================== # ============= EXPERIMENTATION 5 ======== # Compute the quality by the threshold # parameters NT=8 NP=8 TCU=50 NHI=50 NME=25 coef=2 R=1 TQ=2 echo "=========> data recover" chaine="" worst="" best="" quality="" for i in 50; do # iterate on quality threshold for TQ in 1 2 3 4; do # iteration for ((iter=1; iter<=1000; ++iter)); do if (( iter < 10 )) then var='0'$iter else var=$iter fi file="scheduled/amc_coef_${i}_threshold_${TQ}_iter${var}.xmlv3" # check if file is ok if [ -f "$file" ]; then # coefficient model if [[ $file = *coef_$i* ]]; then # number of mode change line=`sed -n "s/quality : \(.*\)/\1/p" < $file` if [ "$line" != "" ]; then quality+="$line;" fi; for (( j=1; j<=$NT; ++j )); do # criticality task line=`sed -n "s/T $j: \(.*\)/\1/p" < $file` if [ "$line" != "" ]; then criticality+="$line;" fi; line=`sed -n "s/Task$j\(.*\)/\1/p" < $file` if [ "$line" != "" ]; then worst_value=$(echo $line | awk '/worst/ {print $2}' | tr /worst " " ) worst+="$worst_value;" best_value=$(echo $line | awk '/worst/ {print $3}' | tr /best " " ) best+="$best_value;" #average_value=$(echo $line | awk '/worst/ {print $4}' | tr /average " ") #chaine+="$average_value;" fi; done # paste into echo $quality >> data_quality_threshold_withoutHI.csv # reset variables worst="" best="" criticality="" nbchange="" quality="" fi fi done done done chaine="" worst="" best="" quality="" for i in 50; do # iterate on quality threshold for TQ in 1 2 3 4; do # iteration for ((iter=1; iter<=1000; ++iter)); do if (( iter < 10 )) then var='0'$iter else var=$iter fi file="scheduled/anytime_coef_${i}_threshold_${TQ}_iter${var}.xmlv3" # check if file is ok if [ -f "$file" ]; then # coefficient model if [[ $file = *coef_$i* ]]; then # number of mode change line=`sed -n "s/quality : \(.*\)/\1/p" < $file` if [ "$line" != "" ]; then quality+="$line;" fi; for (( j=1; j<=$NT; ++j )); do # criticality task line=`sed -n "s/T $j: \(.*\)/\1/p" < $file` if [ "$line" != "" ]; then criticality+="$line;" fi; line=`sed -n "s/Task$j\(.*\)/\1/p" < $file` if [ "$line" != "" ]; then worst_value=$(echo $line | awk '/worst/ {print $2}' | tr /worst " " ) worst+="$worst_value;" best_value=$(echo $line | awk '/worst/ {print $3}' | tr /best " " ) best+="$best_value;" #average_value=$(echo $line | awk '/worst/ {print $4}' | tr /average " ") #chaine+="$average_value;" fi; done # paste into echo $quality >> data_quality_threshold_withoutHI.csv # reset variables worst="" best="" criticality="" nbchange="" quality="" fi fi done done done