#!/bin/bash

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

matice[0]="s13207_x2"
matice[1]="s38417_2"

pop[0]="1000"
pop[1]="20"

sel[0]="4"
sel[1]="3"

cros="0.6"

mutation="0.01"

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

  n=3
  while [ "$n" -le 3 ];
  do

    filename="2_final_${n}_${matice[$m]}"

    touch $filename
        
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)        4" >> $filename
echo "selection-parameter(ps)                 ${sel[$m]}" >> $filename
echo "use-threshold                           1" >> $filename
echo "crossover-method                        0" >> $filename
echo "crossover-probability(pc)               ${cros}" >> $filename
echo "use-discarding                          1" >> $filename
echo "mutation-matches-probability(pm)        ${mutation}" >> $filename
echo "mutation-rank1-probability(pr1)         0" >> $filename
echo "mutation-rank2-probability(pr2)         0.1" >> $filename
    

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

  done
  
  m=$(expr "$m" + 1)

done

