Commit 316387f3 authored by Vytor Calixto's avatar Vytor Calixto 👾

Add plots melhores

parent b920d518
Pipeline #9594 passed with stage
in 8 minutes and 11 seconds
......@@ -5,5 +5,5 @@ a.out
*.in
test
tests/*.txt
tests/tempos.png
tests/*.png
massif.out*
......@@ -12,10 +12,13 @@ test:
- make test
- cd tests
- gnuplot "tempos.plot"
- gnuplot medias.plot
artifacts:
paths:
- tests/tabuleiros.txt
- tests/tempos.txt
- tests/medias.txt
- tests/tempos.png
- tests/medias.png
tags:
- ubuntu
......@@ -16,4 +16,4 @@ main: main.c libs/tabuleiro.o libs/grafo.o libs/vertice.o libs/filha.o libs/list
clean:
$(RM) *.o
$(RM) libs/*.o
$(RM) tests/*.in
$(RM) tests/*.time
set terminal png
set output "medias.png"
set xlabel "Tamanho"
set ylabel "Tempo (milisegundos)"
set title "Tempo médio para execução considerando tamanho do tabuleiro"
set grid
set key
set pointintervalbox 3
plot "medias.txt" using 1:2 with linespoints lc rgb "#602b7d" lw 2 pt 7 lt 1 pi -1 ps 1.5
......@@ -4,7 +4,7 @@
tempo_max=10000 #10s
# tamanhos do tabuleiro
tams=(4 8 16 32 50 64 80 92 100)
tams=(4 8 16 25 32 50 64 75 100 128)
# lista de cores
cores=(2 3 4 5 6 7 8)
......@@ -17,7 +17,8 @@ CYAN='\033[0;36m'
NC='\033[0m' # Sem cor
echo -ne "" > tabuleiros.txt
echo -ne "" > tempos.txt
echo -ne "#Tam tabuleiro\t#N cores\t#Tempo médio\n" > tempos.txt
echo -ne "#Tam tabuleiro\t#Tempo médio\n" > medias.txt
echo "Iniciado testes"
for i in ${tams[*]}
......@@ -55,14 +56,15 @@ do
echo -ne "\n${CYAN}Tempo médio com ${cor} cores: ${S_medio_cor}."
printf "%03d" ${M_medio_cor}
echo -e "s (${T_medio_cor})${NC}\n"
echo -e "${i}\t${cor}\t${M_medio_cor}" >> tempos.txt
done
T_medio_total=$(( $T_soma_total/($i * ${#cores[*]}) ))
S_medio_total=$(($T_medio_total/1000000000))
M_medio_total=$(($T_medio_total/1000000))
echo -ne "${BLUE}Tempo médio com tamanho ${i}: ${S_medio_total}."
printf "%03d" ${M_medio_total}
echo -e "s (${T_medio_cor})${NC}\n"
echo -e "${i} \t ${M_medio_total}" >> tempos.txt
echo -e "s (${T_medio_total})${NC}\n"
echo -e "${i}\t${M_medio_total}" >> medias.txt
done
fs=$(cat tabuleiros.txt | wc -l)
......
set terminal png
set output "tempos.png"
set xlabel "Tamanho"
set xlabel "Cores"
set ylabel "Tempo (milisegundos)"
set title "Tempo médio para execução considerando tamanho do tabuleiro e tempo"
set title "Tempo médio para execução considerando número de cores e tamanho do tabuleiro"
filename="tempos.txt"
from=system('tail -n +2 '.filename. '| cut -f 1 | sort | uniq')
select_source(w) = sprintf('< awk ''{if ($1 == "%s") print }'' %s', w, filename)
set grid
set style data lines
set key
plot "tempos.txt" using 1:2 with lines lc rgb "#602b7d" lw 2
set style data linespoints
set pointintervalbox 3
plot for [f in from] select_source(f) using 2:3 title f
#plot "tempos.txt" using 1:3 with points lc rgb "#602b7d" lw 2 title "Tamanho do tabuleiro",\
# "tempos.txt" using 2:3 with points lc rgb "#19e287" lw 2 title "Número de cores"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment