genetic-images/benchmarks.fish
2019-04-09 02:20:33 +02:00

30 lines
1.2 KiB
Fish
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env fish
# This script was written to work with the fish shell. If you do not have the
# fish shell installed on your system, please install it before executing this
# script.
# The results will be stored in the output file `results.txt`
set nb_amelioration 10 50 100 200 500 1000
set nb_execution 200 100 50 20 10 5
set available_methods 1 2 3 4
set output results.txt
rm -f $output
for method in $available_methods
set nb_options (count $nb_execution)
echo "Method $method:" >> $output
echo "| / | < | < |" >> $output
echo "| Nb daméliorations | Nb dexécutions | Temps dexécution (s) |" >> $output
echo "|--------------------+-----------------+-----------------------|" >> $output
for i in (seq $nb_options)
set total_exec_time 0
set startexec (date +%s.%N)
for j in $nb_execution[$i]
./build/bin/genetic-image -i ./img/mahakala-monochrome.jpg \
-n $nb_amelioration[$i] -m $method
end
set endexec (date +%s.%N)
set total_exec_time (math "$total_exec_time+($endexec-$startexec)/$i")
echo "|$nb_amelioration[$i]|$nb_execution[$i]|$total_exec_time|" >> $output
end
echo "" >> $output
end