5 test -d ./auto || mkdir auto
6 test -d ./auto/data || mkdir auto/data
7 test -d ./auto/plots || mkdir auto/plots
10 size=648 # 6*6*6*3 = 216
12 echo "[+] Generating data"
13 for m in 0 0.01 0.05 0.1 0.5 1; do #6
14 # echo " * Mutation chance: $m"
15 for c in 0.01 0.05 0.1 0.5 0.75 1; do #6
16 # echo " ** Crossover chance: $c"
17 for g in 10 20 50 100 200 500; do #6
18 # echo " > Generations: $g"
19 for ch in 10 20 30; do #3
20 FILENAME="$limit-$g-$ch-$c-$m"
21 FILE="./auto/data/$FILENAME"
22 # echo " > Chromosomes: $ch"
23 # echo "./genetic --chromosome-size=$ch --generation-size=$g --generation-limit=$limit --crossover=$c --mutation=$m > ./../../genetic-materialy/auto/$limit.$g.$ch.$c.$m"
24 ./genetic --chromosome-size=$ch --generation-size=$g --generation-limit=$limit --crossover=$c --mutation=$m > $FILE
27 set xlabel "Pokolenia"
28 set ylabel "Dostosowanie"
32 set title "Wykres średniego dostosowania populacji i najlepszego osobnika \n Genów:$ch, Osobników:$g, Krzyżowanie:$c, Mutacja:$m"
33 set key autotitle columnheader
34 set output "./auto/plots/${FILENAME}.png"
35 plot "${FILE}" using 1:2 with lines, "" using 1:3 with lines
38 echo -n " > (" $i/$size ")\r"
45 echo "[+] Generating comparison charts"
47 test -d ./auto/comparisons || mkdir auto/comparisons
48 test -d ./auto/comparisons/genes || mkdir auto/comparisons/genes
51 size=216 # 6*6*6 = 216
52 for m in 0 0.01 0.05 0.1 0.5 1; do #6
53 for c in 0.01 0.05 0.1 0.5 0.75 1; do #6
54 for g in 10 20 50 100 200 500; do #6
55 FILENAME="$limit-$g-$c-$m"
58 set xlabel "Pokolenia"
59 set ylabel "Dostosowanie"
63 set title "Wykres wpływu ilości genów na szybkość dostosowania populacji \n Osobników:$g, Krzyżowanie:$c, Mutacja:$m"
64 set key autotitle columnheader
65 set output "./auto/comparisons/genes/${FILENAME}.png"
66 plot "./auto/data/$limit-$g-10-$c-$m" using 1:2 with lines title "10 Genów", \
67 "./auto/data/$limit-$g-20-$c-$m" using 1:2 with lines title "20 Genów", \
68 "./auto/data/$limit-$g-30-$c-$m" using 1:2 with lines title "30 Genów"
71 echo -n " * Genes (" $i/$size ")\r"
78 echo "Check: ./auto/ directory for generated data and plots"