2019-04-01 15:34:34 +00:00
|
|
|
|
#!/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
|
2019-04-09 00:20:33 +00:00
|
|
|
|
set available_methods 1 2 3 4
|
2019-04-01 15:34:34 +00:00
|
|
|
|
set output results.txt
|
|
|
|
|
rm -f $output
|
|
|
|
|
for method in $available_methods
|
2019-04-09 00:20:33 +00:00
|
|
|
|
set nb_options (count $nb_execution)
|
|
|
|
|
echo "Method $method:" >> $output
|
|
|
|
|
echo "| / | < | < |" >> $output
|
|
|
|
|
echo "| Nb d’améliorations | Nb d’exécutions | Temps d’exé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
|
2019-04-01 15:34:34 +00:00
|
|
|
|
end
|
2019-04-09 00:20:33 +00:00
|
|
|
|
echo "" >> $output
|
2019-04-01 15:34:34 +00:00
|
|
|
|
end
|