genetic-images/benchmarks.fish

30 lines
1.2 KiB
Fish
Raw Normal View History

#!/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