\ifx\sevenrm\undefined
  \font\sevenrm=cmr7 scaled \magstep0
\fi

\newread\MyStyle
\openin\MyStyle=src2latex.s2t
\ifeof\MyStyle
  \closein\MyStyle
\else
  \input src2latex.s2t
  \closein\MyStyle
\fi

\ifx\gtfam\undefined
  \ifx\dm\undefined
    \ifx\tendm\undefined
      \def\mc{\null}
    \else
      \def\mc{\tendm}
    \fi
  \else
    \def\mc{\dm}
  \fi
  \ifx\dg\undefined
    \ifx\tendg\undefined
      \def\gt{\null}
    \else
      \def\gt{\tendg}
    \fi
  \else
    \def\gt{\dg}
  \fi
\fi
\ifx\sc\undefined
  \def\sc{\null}
\fi

\tt\mc 

\noindent
function{\tt\mc \kern0.500em}[]{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}strengthga({\tt\mc \kern0.500em}overallfitness{\tt\mc \kern0.500em})

\noindent
{}{\tt\%}STRENGTHGA{\tt\mc \kern0.500em}Genetischer{\tt\mc \kern0.500em}Algorithmus{\tt\mc \kern0.500em}zur{\tt\mc \kern0.500em}Anpassung{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Fitnesswerte

\noindent
{}{\tt\%}{\tt\mc \kern1.500em}Dieser{\tt\mc \kern0.500em}GA{\tt\mc \kern0.500em}soll{\tt\mc \kern0.500em}nach{\tt\mc \kern0.500em}mehreren{\tt\mc \kern0.500em}erfolgten{\tt\mc \kern0.500em}Simulationsläufen{\tt\mc \kern0.500em}mit{\tt\mc \kern0.500em}dem

\noindent
{}{\tt\%}{\tt\mc \kern1.500em}gleichen{\tt\mc \kern0.500em}Regelsatz{\tt\mc \kern0.500em}aber{\tt\mc \kern0.500em}unterschiedlichen{\tt\mc \kern0.500em}Fitnesswerten{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}einzelnen

\noindent
{}{\tt\%}{\tt\mc \kern1.500em}Regeln{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Ergebnisse{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Läufe{\tt\mc \kern0.500em}miteinander{\tt\mc \kern0.500em}vergleichen{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}aufgrund

\noindent
{}{\tt\%}{\tt\mc \kern1.500em}der{\tt\mc \kern0.500em}globalen{\tt\mc \kern0.500em}Fitness{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}entstandenen{\tt\mc \kern0.500em}Strukturen{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}einzelnen

\noindent
{}{\tt\%}{\tt\mc \kern1.500em}Stärkewerte{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Regeln{\tt\mc \kern0.500em}genetisch{\tt\mc \kern0.500em}rekombinieren.{\tt\mc \kern0.500em}Dadurch{\tt\mc \kern0.500em}sollen{\tt\mc \kern0.500em}neue

\noindent
{}{\tt\%}{\tt\mc \kern1.500em}Regelsätze{\tt\mc \kern0.500em}erzeugt{\tt\mc \kern0.500em}werden,{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}sich{\tt\mc \kern0.500em}nur{\tt\mc \kern0.500em}durch{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Fitness{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}einzelnen

\noindent
{}{\tt\%}{\tt\mc \kern1.500em}Regeln{\tt\mc \kern0.500em}von{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}alten{\tt\mc \kern0.500em}Regelsätzen{\tt\mc \kern0.500em}unterscheiden.

\noindent
{}\hfill

\noindent
{}global{\tt\mc \kern0.500em}wespe;

\noindent
{}global{\tt\mc \kern0.500em}Wabengitter;

\noindent
{}global{\tt\mc \kern0.500em}MittelWabe;

\noindent
{}\hfill

\noindent
{}probmutation{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0.2;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}feste{\tt\mc \kern0.500em}Mutationswahrscheinlichkeit

\noindent
{}elternzahl{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}4;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Zahl{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}auszuwählenden{\tt\mc \kern0.500em}Individuen{\tt\mc \kern0.500em}pro{\tt\mc \kern0.500em}GA{\tt -}Durchlauf

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}{\tt -}{\tt\mc \kern0.500em}muss{\tt\mc \kern0.500em}ein{\tt\mc \kern0.500em}Vielfaches{\tt\mc \kern0.500em}von{\tt\mc \kern0.500em}2{\tt\mc \kern0.500em}sein

\noindent
{}{\tt\mc \kern8.000em}

\noindent
{}overallrezip{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}1{\tt\mc \kern0.500em}.{\tt /}{\tt\mc \kern0.500em}overallfitness;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Die{\tt\mc \kern0.500em}reziproken{\tt\mc \kern0.500em}Werte{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Gesamtfitness

\noindent
{}{\tt\mc \kern17.000em}{\tt\%}{\tt\mc \kern0.500em}zur{\tt\mc \kern0.500em}Berechnung{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}zu{\tt\mc \kern0.500em}löschenden

\noindent
{}{\tt\mc \kern17.000em}{\tt\%}{\tt\mc \kern0.500em}Elemente

\noindent
{}overallrezip{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}overallrezip{\tt\mc \kern0.500em}{\tt /}{\tt\mc \kern0.500em}sum(overallrezip);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Normierung{\tt\mc \kern0.500em}auf{\tt\mc \kern0.500em}Gesamtsumme{\tt\mc \kern0.500em}1

\noindent
{}\hfill

\noindent
{}overallfitness{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}overallfitness{\tt\mc \kern0.500em}{\tt /}{\tt\mc \kern0.500em}sum(overallfitness);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Normierung{\tt\mc \kern0.500em}auf{\tt\mc \kern0.500em}Gesamtfitness{\tt\mc \kern0.500em}1

\noindent
{}{\tt\mc \kern10.500em}{\tt\%}{\tt\mc \kern0.500em}wichtig{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}Roulette{\tt\_\kern.141em}wheel{\tt -}Selection

\noindent
{}\hfill

\noindent
{}cumulfitness{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

\noindent
{}cumulrezip{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}es{\tt\mc \kern0.500em}werden{\tt\mc \kern0.500em}zwei{\tt\mc \kern0.500em}Vektoren{\tt\mc \kern0.500em}(maxfitness{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}maxrezip){\tt\mc \kern0.500em}erzeugt,{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}denen{\tt\mc \kern0.500em}für

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}jeden{\tt\mc \kern0.500em}Regelsatz{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}wespe{\tt\mc \kern0.500em}ein{\tt\mc \kern0.500em}Wert{\tt\mc \kern0.500em}abgespeichert{\tt\mc \kern0.500em}ist,{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Position{\tt\mc \kern0.500em}des

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}jeweiligen{\tt\mc \kern0.500em}Abschnitts{\tt\mc \kern0.500em}auf{\tt\mc \kern0.500em}dem{\tt\mc \kern0.500em}Roulette{\tt -}Wheel{\tt\mc \kern0.500em}entspricht.{\tt\mc \kern0.500em}Der{\tt\mc \kern0.500em}Vektor{\tt\mc \kern0.500em}ist

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}normiert{\tt\mc \kern0.500em}auf{\tt\mc \kern0.500em}1,{\tt\mc \kern0.500em}d.h.{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}letzte{\tt\mc \kern0.500em}Wert{\tt\mc \kern0.500em}im{\tt\mc \kern0.500em}Vektor{\tt\mc \kern0.500em}sollte{\tt\mc \kern0.500em}1.0{\tt\mc \kern0.500em}betragen.

\noindent
{}for{\tt\mc \kern0.500em}regelsatz=1:length(overallfitness)

\noindent
{}{\tt\mc \kern2.000em}cumulfitness{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}cumulfitness{\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}overallfitness(regelsatz);

\noindent
{}{\tt\mc \kern2.000em}maxfitness(regelsatz){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}cumulfitness;

\noindent
{}{\tt\mc \kern2.000em}cumulrezip{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}cumulrezip{\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}overallrezip(regelsatz);

\noindent
{}{\tt\mc \kern2.000em}maxrezip(regelsatz){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}cumulrezip;

\noindent
{}end

\noindent
{}\hfill

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}Selektion

\noindent
{}eltern{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}roulette(overallfitness,{\tt\mc \kern0.500em}maxfitness);

\noindent
{}\hfill

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}Rekombination

\noindent
{}newstrings{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}onepointxover(eltern);

\noindent
{}\hfill

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}Mutation

\noindent
{}newstrings{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}mutation(newstrings);

\noindent
{}\hfill

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}Selektion{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}zu{\tt\mc \kern0.500em}löschenden{\tt\mc \kern0.500em}bauagent{\tt -}Objekte

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}{\tt -}{\tt\mc \kern0.500em}Es{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}das{\tt\mc \kern0.500em}gleiche{\tt\mc \kern0.500em}Prinzip{\tt\mc \kern0.500em}zur{\tt\mc \kern0.500em}Roulette{\tt -}Wheel{\tt -}Selektion{\tt\mc \kern0.500em}angewendet{\tt\mc \kern0.500em}wie

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}bei{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Eltern{\tt -}Selektion,{\tt\mc \kern0.500em}nur{\tt\mc \kern0.500em}dass{\tt\mc \kern0.500em}auf{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}Kehrwerten{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Fitnesswerte

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}gearbeitet{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}deshalb{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Selektionswahrscheinlichkeit{\tt\mc \kern0.500em}mit

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}steigender{\tt\mc \kern0.500em}Fitness{\tt\mc \kern0.500em}abnimmt,{\tt\mc \kern0.500em}d.h.{\tt\mc \kern0.500em}dass{\tt\mc \kern0.500em}weniger{\tt\mc \kern0.500em}fitte{\tt\mc \kern0.500em}bauagent{\tt -}Objekte{\tt\mc \kern0.500em}mit

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}höherer{\tt\mc \kern0.500em}Wahrscheinlichkeit{\tt\mc \kern0.500em}gelöscht{\tt\mc \kern0.500em}werden.

\noindent
{}todelete{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}roulette(overallrezip,{\tt\mc \kern0.500em}maxrezip);

\noindent
{}\hfill

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}Erzeugen{\tt\mc \kern0.500em}von{\tt\mc \kern0.500em}zwei{\tt\mc \kern0.500em}zusätzlichen{\tt\mc \kern0.500em}bauagent{\tt -}Objekten{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}wespe

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}{\tt -}{\tt\mc \kern0.500em}nicht{\tt\mc \kern0.500em}mehr{\tt\mc \kern0.500em}nötig,{\tt\mc \kern0.500em}da{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Populationsgröße{\tt\mc \kern0.500em}konstant{\tt\mc \kern0.500em}gehalten{\tt\mc \kern0.500em}werden{\tt\mc \kern0.500em}soll

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}neuen{\tt\mc \kern0.500em}Objekte{\tt\mc \kern0.500em}alte{\tt\mc \kern0.500em}überschrieben{\tt\mc \kern0.500em}werden

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}Stattdessen{\tt\mc \kern0.500em}direktes{\tt\mc \kern0.500em}Ersetzen{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}zu{\tt\mc \kern0.500em}löschenden{\tt\mc \kern0.500em}Objekte{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}Einfügen{\tt\mc \kern0.500em}der

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}neuen{\tt\mc \kern0.500em}Fitnessstrings

\noindent
{}\hfill

\noindent
{}{\tt\%}{\tt\mc \kern0.500em}rulesetanzahl{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}size(wespe,1);

\noindent
{}for{\tt\mc \kern0.500em}elternindex=1:elternzahl

\noindent
{}{\tt\mc \kern2.000em}wespe(todelete(elternindex),1){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}bauagent(Wabengitter(1:2,{\tt\mc \kern0.500em}MittelWabe)',{\tt\mc \kern0.500em}1);

\noindent
{}{\tt\mc \kern2.000em}wespe(todelete(elternindex),1).classifierfitnessstring{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}newstrings(1,:);

\noindent
{}{\tt\mc \kern2.000em}wespe(todelete(elternindex),1).updatefitness;

\noindent
{}end

\noindent
{}\hfill

\noindent
{}\hfill

\noindent
{}function{\tt\mc \kern0.500em}index{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}roulette(fitnessvektor,{\tt\mc \kern0.500em}maxvektor)

\noindent
{}{\tt\mc \kern2.000em}

\noindent
{}{\tt\mc \kern2.000em}for{\tt\mc \kern0.500em}candid=1:elternzahl

\noindent
{}{\tt\mc \kern4.000em}a{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}rand;

\noindent
{}{\tt\mc \kern4.000em}{\tt\%}{\tt\mc \kern0.500em}b{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}rand;

\noindent
{}{\tt\mc \kern2.000em}

\noindent
{}{\tt\mc \kern4.000em}for{\tt\mc \kern0.500em}ruleset=length(fitnessvektor):{\tt -}1:2

\noindent
{}{\tt\mc \kern6.000em}if{\tt\mc \kern0.500em}({\tt\mc \kern0.500em}(a{\tt\mc \kern0.500em}{\tt >}={\tt\mc \kern0.500em}maxvektor(ruleset{\tt -}1)){\tt\mc \kern0.500em}{\tt\&}{\tt\&}{\tt\mc \kern0.500em}(fitnessvektor(ruleset){\tt\mc \kern0.500em}{\tt >}{\tt\mc \kern0.500em}0.0){\tt\mc \kern0.500em})

\noindent
{}{\tt\mc \kern8.000em}index(candid){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}ruleset

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}maxfitness(ruleset{\tt -}1){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}1.0;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}verhindert,{\tt\mc \kern0.500em}dass{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}index2{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}gleiche{\tt\mc \kern0.500em}Wert{\tt\mc \kern0.500em}gewählt{\tt\mc \kern0.500em}wird

\noindent
{}{\tt\mc \kern8.000em}

\noindent
{}{\tt\mc \kern8.000em}break;

\noindent
{}{\tt\mc \kern6.000em}end

\noindent
{}{\tt\mc \kern4.000em}end

\noindent
{}{\tt\mc \kern4.000em}if{\tt\mc \kern0.500em}({\tt\mc \kern0.500em}a{\tt\mc \kern0.500em}{\tt <}{\tt\mc \kern0.500em}maxvektor(1){\tt\mc \kern0.500em})

\noindent
{}{\tt\mc \kern6.000em}index(candid){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}1

\noindent
{}{\tt\mc \kern4.000em}end

\noindent
{}{\tt\mc \kern4.000em}

\noindent
{}{\tt\mc \kern4.000em}fitnessvektor(index(candid)){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0.0;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Fitness{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}gewählten{\tt\mc \kern0.500em}Individuums{\tt\mc \kern0.500em}auf{\tt\mc \kern0.500em}0{\tt\mc \kern0.500em}setzen

\noindent
{}{\tt\mc \kern4.000em}fitnessvektor{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}fitnessvektor{\tt\mc \kern0.500em}{\tt /}{\tt\mc \kern0.500em}sum(fitnessvektor);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}neue{\tt\mc \kern0.500em}Normierung

\noindent
{}{\tt\mc \kern8.000em}

\noindent
{}{\tt\mc \kern4.000em}cumul{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

\noindent
{}{\tt\mc \kern4.000em}for{\tt\mc \kern0.500em}regel=1:length(fitnessvektor)

\noindent
{}{\tt\mc \kern6.000em}cumul{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}cumul{\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}fitnessvektor(regel);

\noindent
{}{\tt\mc \kern6.000em}maxvektor(regel){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}cumul;

\noindent
{}{\tt\mc \kern4.000em}end{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}neuen{\tt\mc \kern0.500em}Vektor{\tt\mc \kern0.500em}mit{\tt\mc \kern0.500em}Maximalwerten{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}Roulette{\tt -}Selection{\tt\mc \kern0.500em}erzeugen

\noindent
{}{\tt\mc \kern2.000em}end

\noindent
{}end

\noindent
{}\hfill

\noindent
{}{\tt\mc \kern2.000em}function{\tt\mc \kern0.500em}kinder{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}onepointxover(eltern)

\noindent
{}{\tt\mc \kern3.000em}for{\tt\mc \kern0.500em}xoverindex=1:uint8(elternzahl{\tt /}2)

\noindent
{}{\tt\mc \kern4.000em}string1{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}wespe(eltern(xoverindex),1).classifierfitnessstring;

\noindent
{}{\tt\mc \kern4.000em}string2{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}wespe(eltern(xoverindex+1),1).classifierfitnessstring;

\noindent
{}{\tt\mc \kern5.500em}{\tt\%}{\tt\mc \kern0.500em}kopiert{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Fitness{\tt -}Strings{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}ausgewählten{\tt\mc \kern0.500em}Eltern{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}Graycode

\noindent
{}{\tt\mc \kern5.500em}{\tt\%}{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}zwei{\tt\mc \kern0.500em}lokale{\tt\mc \kern0.500em}String{\tt -}Variablen

\noindent
{}{\tt\mc \kern5.500em}{\tt\%}{\tt\mc \kern0.500em}Es{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Gesamtstring{\tt\mc \kern0.500em}(Stärke{\tt\mc \kern0.500em}aller{\tt\mc \kern0.500em}Regeln

\noindent
{}{\tt\mc \kern5.500em}{\tt\%}{\tt\mc \kern0.500em}hintereinander){\tt\mc \kern0.500em}verwendet

\noindent
{}{\tt\mc \kern4.000em}xoverpoint{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}uint16(rand{\tt\mc \kern0.500em}{\tt *}{\tt\mc \kern0.500em}length(string1));

\noindent
{}{\tt\mc \kern5.500em}{\tt\%}{\tt\mc \kern0.500em}wählt{\tt\mc \kern0.500em}einen{\tt\mc \kern0.500em}zufälligen{\tt\mc \kern0.500em}Crossoverpunkt

\noindent
{}{\tt\mc \kern4.000em}neustring1{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}[string1(1:xoverpoint){\tt\mc \kern0.500em}string2(xoverpoint+1:length(string2))];

\noindent
{}{\tt\mc \kern4.000em}neustring2{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}[string2(1:xoverpoint){\tt\mc \kern0.500em}string1(xoverpoint+1:length(string1))];

\noindent
{}{\tt\mc \kern4.000em}

\noindent
{}{\tt\mc \kern4.000em}kinder(xoverindex,:){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}neustring1;{\tt\mc \kern0.500em}

\noindent
{}{\tt\mc \kern4.000em}kinder(xoverindex+1,:){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}neustring2;

\noindent
{}{\tt\mc \kern3.000em}end

\noindent
{}{\tt\mc \kern2.000em}end

\noindent
{}{\tt\mc \kern2.000em}

\noindent
{}{\tt\mc \kern2.000em}function{\tt\mc \kern0.500em}newbitstring{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}mutation(bitstring)

\noindent
{}{\tt\mc \kern3.000em}for{\tt\mc \kern0.500em}mutindex=1:uint8(elternzahl{\tt /}2){\tt\mc \kern1.000em}

\noindent
{}{\tt\mc \kern4.000em}bitstring1{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}bitstring(mutindex,:);

\noindent
{}{\tt\mc \kern4.000em}bitstring2{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}bitstring(mutindex+1,:);

\noindent
{}{\tt\mc \kern4.000em}

\noindent
{}{\tt\mc \kern4.000em}if{\tt\mc \kern0.500em}(rand{\tt\mc \kern0.500em}{\tt <}{\tt\mc \kern0.500em}probmutation){\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}wenn{\tt\mc \kern0.500em}Zufallszahl{\tt\mc \kern0.500em}unter{\tt\mc \kern0.500em}Mutationswahrscheinlichkeit

\noindent
{}{\tt\mc \kern6.000em}mutbit{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}uint16(rand{\tt\mc \kern0.500em}{\tt *}{\tt\mc \kern0.500em}length(bitstring1));

\noindent
{}{\tt\mc \kern6.000em}if{\tt\mc \kern0.500em}strcmp(bitstring1(mutbit),'0')

\noindent
{}{\tt\mc \kern8.000em}bitstring1(mutbit){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}'1';

\noindent
{}{\tt\mc \kern6.000em}end

\noindent
{}{\tt\mc \kern6.000em}if{\tt\mc \kern0.500em}strcmp(bitstring1(mutbit),'1')

\noindent
{}{\tt\mc \kern8.000em}bitstring1(mutbit){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}'0';

\noindent
{}{\tt\mc \kern6.000em}end

\noindent
{}{\tt\mc \kern4.000em}end{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}bitstring1

\noindent
{}{\tt\mc \kern4.000em}

\noindent
{}{\tt\mc \kern4.000em}if{\tt\mc \kern0.500em}(rand{\tt\mc \kern0.500em}{\tt <}{\tt\mc \kern0.500em}probmutation){\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}wenn{\tt\mc \kern0.500em}Zufallszahl{\tt\mc \kern0.500em}unter{\tt\mc \kern0.500em}Mutationswahrscheinlichkeit

\noindent
{}{\tt\mc \kern6.000em}mutbit{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}uint16(rand{\tt\mc \kern0.500em}{\tt *}{\tt\mc \kern0.500em}length(bitstring2));

\noindent
{}{\tt\mc \kern6.000em}if{\tt\mc \kern0.500em}strcmp(bitstring2(mutbit),'0')

\noindent
{}{\tt\mc \kern8.000em}bitstring2(mutbit){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}'1';

\noindent
{}{\tt\mc \kern6.000em}end

\noindent
{}{\tt\mc \kern6.000em}if{\tt\mc \kern0.500em}strcmp(bitstring2(mutbit),'1')

\noindent
{}{\tt\mc \kern8.000em}bitstring2(mutbit){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}'0';

\noindent
{}{\tt\mc \kern6.000em}end

\noindent
{}{\tt\mc \kern4.000em}end{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}bitstring2

\noindent
{}{\tt\mc \kern4.000em}

\noindent
{}{\tt\mc \kern4.000em}newbitstring(mutindex,:){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}bitstring1;

\noindent
{}{\tt\mc \kern4.000em}newbitstring(mutindex+1,:){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}bitstring2;

\noindent
{}{\tt\mc \kern3.000em}end

\noindent
{}{\tt\mc \kern2.000em}end

\noindent
{}{\tt\mc \kern4.000em}

\noindent
{}end

\rm\mc
