#!/bin/bash

matice[0]="s820"
matice[1]="c1908"
matice[2]="s420.1_1"
matice[3]="s420.1_4"
matice[4]="s641_1"
matice[5]="s838_1"
matice[6]="s5378_3"
matice[7]="s9234.1_1"
matice[8]="s13207.1_3"
matice[9]="s38417_1"

pop[0]="5000"
pop[1]="3000"
pop[2]="5000"
pop[3]="3000"
pop[4]="8000"
pop[5]="1000"
pop[6]="2000"
pop[7]="150"
pop[8]="70"
pop[9]="70"

sel="3"
cros="0.5"
mutation="0.1"
pr="0.01"


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

    filename="0_uni_${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}" >> $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)         ${pr}" >> $filename
echo "mutation-rank2-probability(pr2)         0" >> $filename
    

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

  done

