#!/bin/bash

# Testujeme vsechny matice po dobu jedne hodiny (t=3600) pri pouziti discardingu

matice[0]="s9234.1_1"
sel[0]="4"
pop[0]="150"
cros[0]="0.5"
mutation[0]="0.01"
pr[0]="0.1"

n=0
while [ "$n" -le 2 ];
do

  m=0
  while [ "$m" -le 0 ];
  do

    filename="97_pnt_${n}_${matice[$m]}"

echo "matrix-C                                matrix/${matice[$m]}_s.pat" > $filename
echo "matrix-T                                matrix/${matice[$m]}_d.pat" >> $filename
echo "estimate-population-size                0" >> $filename
echo "max-duration                            180" >> $filename
echo "population-size                         ${pop[$m]}" >> $filename
echo "max-generations                         10000" >> $filename
echo "bad-generations-to-terminate(pt)        5" >> $filename
echo "selection-parameter(ps)                 ${sel[$m]}" >> $filename
echo "use-threshold                           1" >> $filename
echo "crossover-method                        0" >> $filename
echo "crossover-probability(pc)               ${cros[$m]}" >> $filename
echo "use-discarding                          1" >> $filename
echo "mutation-matches-probability(pm)        ${mutation[$m]}" >> $filename
echo "mutation-rank1-probability(pr1)         0" >> $filename
echo "mutation-rank2-probability(pr2)         ${pr[$m]}" >> $filename
    

    mkdir "_$filename"
    ./gcma2_7 $filename
    
    m=$(expr "$m" + 1)

  done

  n=$(expr "$n" + 1)

done
