\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
classdef{\tt\mc \kern0.500em}bauagent{\tt\mc \kern0.500em}{\tt <}{\tt\mc \kern0.500em}handle

\noindent
{}{\tt\mc \kern2.000em}{\tt\%}BAUAGENT{\tt\mc \kern0.500em}Diese{\tt\mc \kern0.500em}Klasse{\tt\mc \kern0.500em}definiert{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Eigenschaften{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}einzelnen{\tt\mc \kern0.500em}Agenten

\noindent
{}{\tt\mc \kern2.000em}{\tt\%}{\tt\mc \kern1.500em}Hier{\tt\mc \kern0.500em}werden{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Eigenschaften{\tt\mc \kern0.500em}festgelegt,{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}einzelnen{\tt\mc \kern0.500em}Agenten

\noindent
{}{\tt\mc \kern2.000em}{\tt\%}{\tt\mc \kern1.500em}ausmachen,{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}Bau{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Wabenstruktur{\tt\mc \kern0.500em}zuständig{\tt\mc \kern0.500em}ist.

\noindent
{}{\tt\mc \kern2.000em}{\tt\%}{\tt\mc \kern1.500em}Für{\tt\mc \kern0.500em}jeden{\tt\mc \kern0.500em}einzelnen{\tt\mc \kern0.500em}Agenten{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}ein{\tt\mc \kern0.500em}Objekt{\tt\mc \kern0.500em}dieser{\tt\mc \kern0.500em}Klasse{\tt\mc \kern0.500em}erzeugt.

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

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

\noindent
{}{\tt\mc \kern4.000em}Position{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Vektor,{\tt\mc \kern0.500em}welcher{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Position{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Agenten{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}

\noindent
{}{\tt\mc \kern8.500em}{\tt\%}{\tt\mc \kern0.500em}X{\tt -}Y({\tt -}Z){\tt -}Koordinaten{\tt\mc \kern0.500em}enthält.{\tt\mc \kern0.500em}Je{\tt\mc \kern0.500em}nach{\tt\mc \kern0.500em}Umgebung{\tt\mc \kern0.500em}

\noindent
{}{\tt\mc \kern8.500em}{\tt\%}{\tt\mc \kern0.500em}zwei{\tt -}{\tt\mc \kern0.500em}oder{\tt\mc \kern0.500em}dreidimensional.

\noindent
{}{\tt\mc \kern4.000em}Ausrichtung{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Blickrichtung{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Agenten{\tt\mc \kern0.500em}im{\tt\mc \kern0.500em}Gradmaß{\tt\mc \kern0.500em}(0{\tt\mc \kern0.500em}bis{\tt\mc \kern0.500em}360)

\noindent
{}{\tt\mc \kern10.000em}{\tt\%}{\tt\mc \kern0.500em}Null{\tt\mc \kern0.500em}entspricht{\tt\mc \kern0.500em}Blick{\tt\mc \kern0.500em}waagerecht{\tt\mc \kern0.500em}nach{\tt\mc \kern0.500em}rechts

\noindent
{}{\tt\mc \kern4.000em}RuleSet{\tt\mc \kern0.500em}

\noindent
{}{\tt\mc \kern8.500em}{\tt\%}{\tt\mc \kern0.500em}Enthält{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Ausgangsregeln,{\tt\mc \kern0.500em}nach{\tt\mc \kern0.500em}denen{\tt\mc \kern0.500em}gebaut{\tt\mc \kern0.500em}oder{\tt\mc \kern0.500em}nicht

\noindent
{}{\tt\mc \kern8.500em}{\tt\%}{\tt\mc \kern0.500em}gebaut{\tt\mc \kern0.500em}wird.{\tt\mc \kern0.500em}Hier{\tt\mc \kern0.500em}werden{\tt\mc \kern0.500em}nur{\tt\mc \kern0.500em}Regeln{\tt\mc \kern0.500em}festgelegt,{\tt\mc \kern0.500em}mit

\noindent
{}{\tt\mc \kern8.500em}{\tt\%}{\tt\mc \kern0.500em}denen{\tt\mc \kern0.500em}begonnen{\tt\mc \kern0.500em}wird,{\tt\mc \kern0.500em}danach{\tt\mc \kern0.500em}werden{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Regeln{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}das

\noindent
{}{\tt\mc \kern8.500em}{\tt\%}{\tt\mc \kern0.500em}Array{\tt\mc \kern0.500em}classifierset{\tt\mc \kern0.500em}kopiert{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}nur{\tt\mc \kern0.500em}noch{\tt\mc \kern0.500em}von{\tt\mc \kern0.500em}dort

\noindent
{}{\tt\mc \kern8.500em}{\tt\%}{\tt\mc \kern0.500em}ausgelesen{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}auch{\tt\mc \kern0.500em}durch{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}GA{\tt\mc \kern0.500em}verändert.

\noindent
{}{\tt\mc \kern8.500em}{\tt\%}{\tt\mc \kern0.500em}Könnte{\tt\mc \kern0.500em}auch{\tt\mc \kern0.500em}aus{\tt\mc \kern0.500em}Datei{\tt\mc \kern0.500em}gelesen{\tt\mc \kern0.500em}werden...

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

\noindent
{}{\tt\mc \kern4.000em}BuildCounter{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Zählt{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Anzahl{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}gesetzten{\tt\mc \kern0.500em}Bausteine.

\noindent
{}{\tt\mc \kern4.000em}Abstand{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Ein{\tt\mc \kern0.500em}Abstandsvektor,{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}absoluten{\tt\mc \kern0.500em}Abstandswerte{\tt\mc \kern0.500em}zu

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}allen{\tt\mc \kern0.500em}Zellenmittelpunkten{\tt\mc \kern0.500em}enthält

\noindent
{}{\tt\mc \kern4.000em}Speed{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}1;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}relative{\tt\mc \kern0.500em}Geschwindigkeit,{\tt\mc \kern0.500em}mit{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}sich{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Agent{\tt\mc \kern0.500em}bewegt

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

\noindent
{}{\tt\mc \kern4.000em}Markierung{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}graphisches{\tt\mc \kern0.500em}Objekt{\tt\mc \kern0.500em}zur{\tt\mc \kern0.500em}Positionsmarkierung

\noindent
{}{\tt\mc \kern4.000em}Index{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}enthält{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}laufende{\tt\mc \kern0.500em}Nummer{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Agenten

\noindent
{}{\tt\mc \kern4.000em}Farbe{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Farbe{\tt\mc \kern0.500em}zur{\tt\mc \kern0.500em}Markierung

\noindent
{}{\tt\mc \kern4.000em}classifierset{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}ein{\tt\mc \kern0.500em}Array,{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}dem{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Objekte{\tt\mc \kern0.500em}vom{\tt\mc \kern0.500em}Typ{\tt\mc \kern0.500em}'classifier'

\noindent
{}{\tt\mc \kern11.000em}{\tt\%}{\tt\mc \kern0.500em}abgelegt{\tt\mc \kern0.500em}werden

\noindent
{}{\tt\mc \kern4.000em}numberofclassifiers{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Anzahl{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}vorhandenen{\tt\mc \kern0.500em}Regeln

\noindent
{}{\tt\mc \kern4.000em}matchset{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Array{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}dem{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Indizes{\tt\mc \kern0.500em}aller{\tt\mc \kern0.500em}passenden{\tt\mc \kern0.500em}Klassifikatoren{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}einen{\tt\mc \kern0.500em}Zeitschritt{\tt\mc \kern0.500em}abgelegt{\tt\mc \kern0.500em}werden

\noindent
{}{\tt\mc \kern8.500em}{\tt\%}{\tt\mc \kern0.500em}{\tt -}{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}nach{\tt\mc \kern0.500em}jedem{\tt\mc \kern0.500em}Zeitschritt{\tt\mc \kern0.500em}gelöscht

\noindent
{}{\tt\mc \kern4.000em}bucket{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}enthält{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}Index{\tt -}Wert{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}letzten{\tt\mc \kern0.500em}benutzten{\tt\mc \kern0.500em}Klassifikators

\noindent
{}{\tt\mc \kern7.500em}{\tt\%}{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}bucket{\tt -}brigade{\tt -}Algorithmus{\tt\mc \kern0.500em}benötigt

\noindent
{}{\tt\mc \kern4.000em}classifierfitnessstring{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}enthält{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Fitnessstrings{\tt\mc \kern0.500em}aller{\tt\mc \kern0.500em}Regeln{\tt\mc \kern0.500em}im{\tt\mc \kern0.500em}Gray{\tt\mc \kern0.500em}code{\tt\mc \kern0.500em}hintereinander

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

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

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

\noindent
{}{\tt\mc \kern4.000em}function{\tt\mc \kern0.500em}obj{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}bauagent(InitialPosition,{\tt\mc \kern0.500em}indexNummer){\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Konstruktor

\noindent
{}{\tt\mc \kern6.000em}global{\tt\mc \kern0.500em}Grenzen;

\noindent
{}{\tt\mc \kern6.000em}obj.Ausrichtung{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}obj.RuleSet{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}['BBB{\tt *}{\tt *}{\tt *}1';{\tt\mc \kern0.500em}'B{\tt *}BB{\tt *}{\tt *}1';{\tt\mc \kern0.500em}'B{\tt *}{\tt *}BB{\tt *}1';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern8.000em}'B{\tt *}{\tt *}{\tt *}BB1';{\tt\mc \kern0.500em}'{\tt *}BBB{\tt *}{\tt *}1';{\tt\mc \kern0.500em}'{\tt *}B{\tt *}BB{\tt *}1';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern8.000em}'{\tt *}B{\tt *}{\tt *}BB1';{\tt\mc \kern0.500em}'{\tt *}{\tt *}BBB{\tt *}1';{\tt\mc \kern0.500em}'{\tt *}{\tt *}BB{\tt *}B1';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern8.000em}'{\tt *}{\tt *}{\tt *}BBB1';{\tt\mc \kern0.500em}'{\tt *}BB{\tt *}{\tt *}{\tt *}2';{\tt\mc \kern0.500em}'{\tt *}{\tt *}{\tt *}{\tt *}BB2';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern8.000em}'{\tt *}{\tt *}{\tt *}B{\tt *}{\tt *}3';{\tt\mc \kern0.500em}'B{\tt *}{\tt *}{\tt *}{\tt *}{\tt *}3'{\tt\mc \kern0.500em}];

\noindent
{}{\tt\mc \kern6.500em}

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}obj.RuleSet{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}['B{\tt *}{\tt *}{\tt *}{\tt *}{\tt *}1';{\tt\mc \kern0.500em}'{\tt *}{\tt *}{\tt *}B{\tt *}{\tt *}4';{\tt\mc \kern0.500em}'{\tt *}B{\tt *}{\tt *}{\tt *}{\tt *}2';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern8.000em}'{\tt *}{\tt *}{\tt *}{\tt *}B{\tt *}5'];{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}'{\tt *}{\tt *}B{\tt *}{\tt *}{\tt *}3';{\tt\mc \kern0.500em}'{\tt *}{\tt *}{\tt *}{\tt *}{\tt *}B6'{\tt\mc \kern0.500em}];{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Regelwerk{\tt\mc \kern0.500em}zum{\tt\mc \kern0.500em}Testen

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

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}obj.RuleSet{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}['BBB{\tt *}{\tt *}{\tt *}3';{\tt\mc \kern0.500em}'{\tt *}BBB{\tt *}{\tt *}3';{\tt\mc \kern0.500em}'{\tt *}{\tt *}BBB{\tt *}3';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern7.500em}'{\tt *}{\tt *}{\tt *}BBB3';{\tt\mc \kern0.500em}'{\tt *}BB{\tt *}{\tt *}{\tt *}1';{\tt\mc \kern0.500em}'{\tt *}{\tt *}{\tt *}{\tt *}BB1';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern7.500em}'{\tt *}{\tt *}{\tt *}B{\tt *}{\tt *}2';{\tt\mc \kern0.500em}'B{\tt *}{\tt *}{\tt *}{\tt *}{\tt *}2'{\tt\mc \kern0.500em}];{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}simulation01.avi{\tt\mc \kern0.500em}{\tt -}{\tt\mc \kern0.500em}31x31{\tt\mc \kern0.500em}{\tt -}{\tt\mc \kern0.500em}500{\tt\mc \kern0.500em}steps

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

\noindent
{}{\tt\mc \kern6.000em}obj.RuleSet{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}['BBBBBB1';{\tt\mc \kern0.500em}'BBBBB01';{\tt\mc \kern0.500em}'0BBBBB1';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern13.500em}'B0BBBB1';{\tt\mc \kern0.500em}'BB0BBB1';{\tt\mc \kern0.500em}'BBB0BB1';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern13.500em}'BBBB0B1';{\tt\mc \kern0.500em}'BBBB001';{\tt\mc \kern0.500em}'0BBBB01';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern13.500em}'00BBBB1';{\tt\mc \kern0.500em}'B00BBB1';{\tt\mc \kern0.500em}'BB00BB1';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern13.500em}'BBB00B1';{\tt\mc \kern0.500em}'BBB0001';{\tt\mc \kern0.500em}'0BBB001';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern13.500em}'00BBB01';{\tt\mc \kern0.500em}'000BBB1';{\tt\mc \kern0.500em}'B000BB1';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern13.500em}'BB000B1';{\tt\mc \kern0.500em}'BB00001';{\tt\mc \kern0.500em}'0BB0001';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern13.500em}'00BB001';{\tt\mc \kern0.500em}'000BB01';{\tt\mc \kern0.500em}'0000BB1';{\tt\mc \kern0.500em}'B0000B1';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern13.500em}'B000000';{\tt\mc \kern0.500em}'0B00000';{\tt\mc \kern0.500em}'00B0000';{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern13.500em}'000B000';{\tt\mc \kern0.500em}'0000B00';{\tt\mc \kern0.500em}'00000B0'];

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

\noindent
{}{\tt\mc \kern6.000em}for{\tt\mc \kern0.500em}rule=1:size(obj.RuleSet,1)

\noindent
{}{\tt\mc \kern8.000em}classifiers(rule){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}classifier(obj.RuleSet(rule,:),{\tt\mc \kern0.500em}uint8(rand{\tt *}255));

\noindent
{}{\tt\mc \kern6.000em}end{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Erzeugung{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Regelsatzes{\tt\mc \kern0.500em}{\tt -}{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}jede{\tt\mc \kern0.500em}Regel{\tt\mc \kern0.500em}eine{\tt\mc \kern0.500em}Zufallszahl{\tt\mc \kern0.500em}zwischen

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}0{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}255,{\tt\mc \kern0.500em}um{\tt\mc \kern0.500em}genau{\tt\mc \kern0.500em}mit{\tt\mc \kern0.500em}8{\tt -}bit{\tt\mc \kern0.500em}Gray{\tt\mc \kern0.500em}code{\tt\mc \kern0.500em}arbeiten{\tt\mc \kern0.500em}zu

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}können

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

\noindent
{}{\tt\mc \kern6.000em}obj.classifierset{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}classifiers;{\tt\mc \kern0.500em}

\noindent
{}{\tt\mc \kern6.000em}obj.numberofclassifiers{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}length(obj.classifierset);

\noindent
{}\hfill

\noindent
{}{\tt\mc \kern6.000em}obj.classifierfitnessstring{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}strcat(obj.classifierset.fitnessstring);

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

\noindent
{}{\tt\mc \kern6.000em}if{\tt\mc \kern0.500em}nargin{\tt\mc \kern0.500em}{\tt >}{\tt\mc \kern0.500em}0

\noindent
{}{\tt\mc \kern8.000em}obj.Index{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}indexNummer;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}übergibt{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}Index{\tt\mc \kern0.500em}aus{\tt\mc \kern0.500em}dem{\tt\mc \kern0.500em}Vektor

\noindent
{}{\tt\mc \kern18.500em}{\tt\%}{\tt\mc \kern0.500em}von{\tt\mc \kern0.500em}Agenten{\tt\mc \kern0.500em}als{\tt\mc \kern0.500em}Eigenschaft

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

\noindent
{}{\tt\mc \kern8.000em}obj.Index{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

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

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

\noindent
{}{\tt\mc \kern6.000em}if{\tt\mc \kern0.500em}(mod(obj.Index,{\tt\mc \kern0.500em}7){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}1)

\noindent
{}{\tt\mc \kern8.000em}obj.Farbe{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}'blue';

\noindent
{}{\tt\mc \kern6.000em}elseif{\tt\mc \kern0.500em}(mod(obj.Index,{\tt\mc \kern0.500em}7){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}2)

\noindent
{}{\tt\mc \kern8.000em}obj.Farbe{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}'cyan';

\noindent
{}{\tt\mc \kern6.000em}elseif{\tt\mc \kern0.500em}(mod(obj.Index,{\tt\mc \kern0.500em}7){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}3)

\noindent
{}{\tt\mc \kern8.000em}obj.Farbe{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}'green';

\noindent
{}{\tt\mc \kern6.000em}elseif{\tt\mc \kern0.500em}(mod(obj.Index,{\tt\mc \kern0.500em}7){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}4)

\noindent
{}{\tt\mc \kern8.000em}obj.Farbe{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}'white';

\noindent
{}{\tt\mc \kern6.000em}elseif{\tt\mc \kern0.500em}(mod(obj.Index,{\tt\mc \kern0.500em}7){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}5)

\noindent
{}{\tt\mc \kern8.000em}obj.Farbe{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}'black';

\noindent
{}{\tt\mc \kern6.000em}elseif{\tt\mc \kern0.500em}(mod(obj.Index,{\tt\mc \kern0.500em}7){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}6)

\noindent
{}{\tt\mc \kern8.000em}obj.Farbe{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}'yellow';

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

\noindent
{}{\tt\mc \kern8.000em}obj.Farbe{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}'magenta';

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

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

\noindent
{}{\tt\mc \kern6.000em}obj.BuildCounter{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Anzahl{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}gebauten{\tt\mc \kern0.500em}Bausteine{\tt\mc \kern0.500em}auf{\tt\mc \kern0.500em}Null

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

\noindent
{}{\tt\mc \kern6.000em}if{\tt\mc \kern0.500em}nargin{\tt\mc \kern0.500em}{\tt >}{\tt\mc \kern0.500em}0

\noindent
{}{\tt\mc \kern8.000em}obj.Position{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}InitialPosition;

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

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}obj.Position{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}rand(1,2);

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}obj.Position(1,1){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}obj.Position(1,1){\tt\mc \kern0.500em}{\tt *}{\tt\mc \kern0.500em}Grenzen(1);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Setzt{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Position{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Agenten{\tt\mc \kern0.500em}auf{\tt\mc \kern0.500em}einen

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}obj.Position(1,2){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}obj.Position(1,2){\tt\mc \kern0.500em}{\tt *}{\tt\mc \kern0.500em}Grenzen(2);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}beliebigen{\tt\mc \kern0.500em}Punkt{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}Grenzen{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Gitters

\noindent
{}{\tt\mc \kern8.000em}obj.Position(1,1){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

\noindent
{}{\tt\mc \kern8.000em}obj.Position(1,2){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

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

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

\noindent
{}{\tt\mc \kern6.000em}obj.Markierung{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}line(obj.Position(1),{\tt\mc \kern0.500em}obj.Position(2),{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern18.000em}1.1,{\tt\mc \kern0.500em}'Marker','.',{\tt\mc \kern0.500em}'MarkerFaceColor',obj.Farbe,{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern18.000em}'Color',obj.Farbe{\tt\mc \kern0.500em});

\noindent
{}{\tt\mc \kern12.500em}{\tt\%}{\tt\mc \kern0.500em}aktuelle{\tt\mc \kern0.500em}Position{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Agenten{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}graphisch

\noindent
{}{\tt\mc \kern12.500em}{\tt\%}{\tt\mc \kern0.500em}markiert

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}set(obj.Markierung,{\tt\mc \kern0.500em}'XDataSource','agent.Position(1)');

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}set(obj.Markierung,{\tt\mc \kern0.500em}'YDataSource','agent.Position(2)');

\noindent
{}{\tt\mc \kern12.000em}{\tt\%}{\tt\mc \kern0.500em}Verknüpfung{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Grafikobjekts{\tt\mc \kern0.500em}mit{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Position

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

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

\noindent
{}{\tt\mc \kern4.000em}{\tt\%}{\tt\mc \kern0.500em}function{\tt\mc \kern0.500em}obj{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}bauagent(){\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}dummy{\tt\mc \kern0.500em}konstruktor

\noindent
{}{\tt\mc \kern4.000em}{\tt\%}{\tt\mc \kern0.500em}end

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

\noindent
{}{\tt\mc \kern4.000em}function{\tt\mc \kern0.500em}obj{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}movebuild(agent){\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Diese{\tt\mc \kern0.500em}Funktion{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}einmal{\tt\mc \kern0.500em}pro{\tt\mc \kern0.500em}Zeitschritt{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}jeden{\tt\mc \kern0.500em}Agenten{\tt\mc \kern0.500em}aufgerufen

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}Die{\tt\mc \kern0.500em}Umgebung{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}verarbeitet{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}nach{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}Regeln{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Agenten

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}entschieden,{\tt\mc \kern0.500em}ob{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Agent{\tt\mc \kern0.500em}an{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}aktuellen{\tt\mc \kern0.500em}Position{\tt\mc \kern0.500em}eine{\tt\mc \kern0.500em}Wabe{\tt\mc \kern0.500em}baut

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}oder{\tt\mc \kern0.500em}sich{\tt\mc \kern0.500em}weiterbewegt.

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

\noindent
{}{\tt\mc \kern6.000em}global{\tt\mc \kern0.500em}Knotenzahl;

\noindent
{}{\tt\mc \kern6.000em}global{\tt\mc \kern0.500em}Grenzen;

\noindent
{}{\tt\mc \kern6.000em}global{\tt\mc \kern0.500em}raumplot;

\noindent
{}{\tt\mc \kern6.000em}global{\tt\mc \kern0.500em}bebautezellen;

\noindent
{}{\tt\mc \kern6.000em}global{\tt\mc \kern0.500em}animation;

\noindent
{}{\tt\mc \kern6.000em}global{\tt\mc \kern0.500em}gadurchlauf;

\noindent
{}{\tt\mc \kern6.000em}global{\tt\mc \kern0.500em}numberofgaruns;

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

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}matchset{\tt\mc \kern0.500em}muss{\tt\mc \kern0.500em}gelöscht{\tt\mc \kern0.500em}werden{\tt\mc \kern0.500em}(empty{\tt\mc \kern0.500em}matrix)

\noindent
{}{\tt\mc \kern6.000em}agent.matchset{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}[];

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

\noindent
{}{\tt\mc \kern6.000em}agent.Ausrichtung{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}mod(agent.Ausrichtung{\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}rand{\tt *}360,{\tt\mc \kern0.500em}360);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}dreht{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}Agenten{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}eine{\tt\mc \kern0.500em}zufällige{\tt\mc \kern0.500em}Richtung

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

\noindent
{}{\tt\mc \kern6.000em}Zelle{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}agent.indexPosition;{\tt\mc \kern3.000em}{\tt\%}{\tt\mc \kern0.500em}Index{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Zelle,{\tt\mc \kern0.500em}auf{\tt\mc \kern0.500em}dessen{\tt\mc \kern0.500em}Fläche{\tt\mc \kern0.500em}sich{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Agent{\tt\mc \kern0.500em}befindet

\noindent
{}{\tt\mc \kern6.000em}Nachbarn{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}agent.nachbarn(Zelle);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}erzeugt{\tt\mc \kern0.500em}Liste{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Indizes{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}Agenten{\tt\mc \kern0.500em}unmittelbar

\noindent
{}{\tt\mc \kern23.000em}{\tt\%}{\tt\mc \kern0.500em}umgebenden{\tt\mc \kern0.500em}Zellen

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

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}refreshdata(agent.Markierung);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Markierung{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}neu{\tt\mc \kern0.500em}gezeichnet

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

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

\noindent
{}{\tt\mc \kern6.000em}for{\tt\mc \kern0.500em}nachbarZelle=1:6

\noindent
{}{\tt\mc \kern8.000em}builtFlag{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

\noindent
{}{\tt\mc \kern8.000em}validFlag{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}1;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Initialisierung

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

\noindent
{}{\tt\mc \kern8.000em}bauPosition{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}Nachbarn(nachbarZelle);{\tt\mc \kern0.500em}

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}setze{\tt\mc \kern0.500em}potentielle{\tt\mc \kern0.500em}Position{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}neuen{\tt\mc \kern0.500em}Baustein{\tt\mc \kern0.500em}auf{\tt\mc \kern0.500em}einen

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}sechs{\tt\mc \kern0.500em}Nachbarzellen{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}aktuellen{\tt\mc \kern0.500em}Position

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

\noindent
{}{\tt\mc \kern8.000em}if{\tt\mc \kern0.500em}({\tt\mc \kern0.500em}(bauPosition{\tt\mc \kern0.500em}{\tt <}{\tt\mc \kern0.500em}1){\tt\mc \kern0.500em}{\tt |}{\tt |}{\tt\mc \kern0.500em}(bauPosition{\tt\mc \kern0.500em}{\tt >}{\tt\mc \kern0.500em}Knotenzahl){\tt\mc \kern0.500em}{\tt |}{\tt |}{\tt\mc \kern0.500em}...{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Grenzen{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Gitters

\noindent
{}{\tt\mc \kern10.500em}(Wabengitter(4,bauPosition){\tt\mc \kern0.500em}{\tt\char'176}={\tt\mc \kern0.500em}0){\tt\mc \kern0.500em}{\tt |}{\tt |}{\tt\mc \kern0.500em}...{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Bebauung{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Zelle

\noindent
{}{\tt\mc \kern10.500em}(Wabengitter(3,bauPosition){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}0){\tt\mc \kern0.500em}){\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}ist{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Wabe{\tt\mc \kern0.500em}noch{\tt\mc \kern0.500em}im{\tt\mc \kern0.500em}Gitter?

\noindent
{}{\tt\mc \kern10.000em}validFlag{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;{\tt\mc \kern1.000em}

\noindent
{}{\tt\mc \kern17.500em}

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

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

\noindent
{}{\tt\mc \kern8.000em}bauNachbarn{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}agent.nachbarn(bauPosition);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}erzeugt{\tt\mc \kern0.500em}Liste{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}unmittelbaren{\tt\mc \kern0.500em}Nachbarn{\tt\mc \kern0.500em}der

\noindent
{}{\tt\mc \kern29.500em}{\tt\%}{\tt\mc \kern0.500em}potentiellen

\noindent
{}{\tt\mc \kern29.500em}{\tt\%}{\tt\mc \kern0.500em}Bauposition

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

\noindent
{}{\tt\mc \kern8.000em}for{\tt\mc \kern0.500em}ruleNumber=1:agent.numberofclassifiers{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}jeder{\tt\mc \kern0.500em}Klassifikator{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}auf{\tt\mc \kern0.500em}Validität{\tt\mc \kern0.500em}geprüft

\noindent
{}{\tt\mc \kern10.500em}

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

\noindent
{}{\tt\mc \kern10.000em}if{\tt\mc \kern0.500em}(validFlag{\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}0)

\noindent
{}{\tt\mc \kern12.000em}break;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}wenn{\tt\mc \kern0.500em}sich{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Position{\tt\mc \kern0.500em}außerhalb{\tt\mc \kern0.500em}des

\noindent
{}{\tt\mc \kern15.500em}{\tt\%}{\tt\mc \kern0.500em}Gitters{\tt\mc \kern0.500em}befindet{\tt\mc \kern0.500em}oder{\tt\mc \kern0.500em}schon{\tt\mc \kern0.500em}bebaut{\tt\mc \kern0.500em}ist,

\noindent
{}{\tt\mc \kern15.500em}{\tt\%}{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}nächste{\tt\mc \kern0.500em}Position{\tt\mc \kern0.500em}geprüft

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

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

\noindent
{}{\tt\mc \kern10.000em}validFlag{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}1;

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

\noindent
{}{\tt\mc \kern10.000em}for{\tt\mc \kern0.500em}ruleCellNumber=1:6{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}jede{\tt\mc \kern0.500em}Position{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Regel{\tt\mc \kern0.500em}einzeln{\tt\mc \kern0.500em}geprüft

\noindent
{}{\tt\mc \kern12.000em}if{\tt\mc \kern0.500em}({\tt\mc \kern0.500em}(validFlag{\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}0){\tt\mc \kern0.500em}{\tt |}{\tt |}{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern13.500em}(bauNachbarn(ruleCellNumber){\tt\mc \kern0.500em}{\tt >}{\tt\mc \kern0.500em}Knotenzahl){\tt\mc \kern0.500em}{\tt |}{\tt |}{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern13.500em}(bauNachbarn(ruleCellNumber){\tt\mc \kern0.500em}{\tt <}{\tt\mc \kern0.500em}1){\tt\mc \kern0.500em})

\noindent
{}{\tt\mc \kern14.000em}break;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}wenn{\tt\mc \kern0.500em}schon{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}letzte{\tt\mc \kern0.500em}Stelle{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Regel{\tt\mc \kern0.500em}ungültig{\tt\mc \kern0.500em}war,

\noindent
{}{\tt\mc \kern17.500em}{\tt\%}{\tt\mc \kern0.500em}braucht{\tt\mc \kern0.500em}diese{\tt\mc \kern0.500em}nicht{\tt\mc \kern0.500em}mehr{\tt\mc \kern0.500em}getestet{\tt\mc \kern0.500em}zu

\noindent
{}{\tt\mc \kern17.500em}{\tt\%}{\tt\mc \kern0.500em}werden{\tt\mc \kern0.500em}{\tt -}{\tt\mc \kern0.500em}wenn{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Position{\tt\mc \kern0.500em}außerhalb

\noindent
{}{\tt\mc \kern17.500em}{\tt\%}{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Gitters{\tt\mc \kern0.500em}liegt,{\tt\mc \kern0.500em}auch{\tt\mc \kern0.500em}nicht

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

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

\noindent
{}{\tt\mc \kern12.000em}if{\tt\mc \kern0.500em}strcmp(agent.classifierset(ruleNumber).detector(ruleCellNumber),{\tt\mc \kern0.500em}'B')

\noindent
{}{\tt\mc \kern14.000em}if{\tt\mc \kern0.500em}({\tt\mc \kern0.500em}Wabengitter(4,bauNachbarn(ruleCellNumber)){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}1{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern15.000em}{\tt |}{\tt |}{\tt\mc \kern0.500em}Wabengitter(4,bauNachbarn(ruleCellNumber)){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}2{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern15.000em}{\tt |}{\tt |}{\tt\mc \kern0.500em}Wabengitter(4,bauNachbarn(ruleCellNumber)){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}3{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern15.000em}{\tt |}{\tt |}{\tt\mc \kern0.500em}Wabengitter(4,bauNachbarn(ruleCellNumber)){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}4{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern15.000em}{\tt |}{\tt |}{\tt\mc \kern0.500em}Wabengitter(4,bauNachbarn(ruleCellNumber)){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}5{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern15.000em}{\tt |}{\tt |}{\tt\mc \kern0.500em}Wabengitter(4,bauNachbarn(ruleCellNumber)){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}6{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern15.000em}{\tt |}{\tt |}{\tt\mc \kern0.500em}Wabengitter(4,bauNachbarn(ruleCellNumber)){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}7{\tt\mc \kern0.500em})

\noindent
{}{\tt\mc \kern14.000em}validFlag{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}1;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}wenn{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Regel{\tt\mc \kern0.500em}an{\tt\mc \kern0.500em}dieser{\tt\mc \kern0.500em}Stelle{\tt\mc \kern0.500em}'B'{\tt\mc \kern0.500em}enthält,

\noindent
{}{\tt\mc \kern16.500em}{\tt\%}{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}validFlag{\tt\mc \kern0.500em}'true'{\tt\mc \kern0.500em}gesetzt,{\tt\mc \kern0.500em}falls{\tt\mc \kern0.500em}ein

\noindent
{}{\tt\mc \kern16.500em}{\tt\%}{\tt\mc \kern0.500em}beliebiger{\tt\mc \kern0.500em}Baustein{\tt\mc \kern0.500em}(1{\tt -}7){\tt\mc \kern0.500em}vorhanden{\tt\mc \kern0.500em}ist.

\noindent
{}{\tt\mc \kern14.000em}else

\noindent
{}{\tt\mc \kern16.000em}validFlag{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

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

\noindent
{}{\tt\mc \kern12.000em}elseif{\tt\mc \kern0.500em}strcmp(agent.classifierset(ruleNumber).detector(ruleCellNumber),{\tt\mc \kern0.500em}'{\tt *}')

\noindent
{}{\tt\mc \kern14.000em}validFlag{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}1;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}enthält{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Regel{\tt\mc \kern0.500em}an{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}betreffenden{\tt\mc \kern0.500em}Stelle{\tt\mc \kern0.500em}ein{\tt\mc \kern0.500em}'{\tt *}'

\noindent
{}{\tt\mc \kern21.500em}{\tt\%}{\tt\mc \kern0.500em}so{\tt\mc \kern0.500em}ist{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Zustand{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Zelle

\noindent
{}{\tt\mc \kern21.500em}{\tt\%}{\tt\mc \kern0.500em}egal.

\noindent
{}{\tt\mc \kern12.000em}else

\noindent
{}{\tt\mc \kern14.000em}validFlag{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}strcmp(num2str(Wabengitter(4,bauNachbarn(ruleCellNumber))),{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern21.500em}agent.classifierset(ruleNumber).detector(ruleCellNumber));

\noindent
{}{\tt\mc \kern19.500em}{\tt\%}{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}allen{\tt\mc \kern0.500em}anderen{\tt\mc \kern0.500em}Fällen{\tt\mc \kern0.500em}(genaue

\noindent
{}{\tt\mc \kern19.500em}{\tt\%}{\tt\mc \kern0.500em}Spezifikation{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Regel){\tt\mc \kern0.500em}muss

\noindent
{}{\tt\mc \kern19.500em}{\tt\%}{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Zelleninhalt{\tt\mc \kern0.500em}exakt{\tt\mc \kern0.500em}mit{\tt\mc \kern0.500em}der

\noindent
{}{\tt\mc \kern19.500em}{\tt\%}{\tt\mc \kern0.500em}Regelposition{\tt\mc \kern0.500em}übereinstimmen.

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

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

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

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

\noindent
{}{\tt\mc \kern10.000em}if{\tt\mc \kern0.500em}(validFlag{\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}1)

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

\noindent
{}{\tt\mc \kern12.000em}agent.classifierset(ruleNumber).bid{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern14.000em}gray2bin(agent.classifierset(ruleNumber).strength,'fsk',256){\tt\mc \kern0.500em}{\tt *}{\tt\mc \kern0.500em}...{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Rückkonvertierung{\tt\mc \kern0.500em}von{\tt\mc \kern0.500em}Gray

\noindent
{}{\tt\mc \kern14.000em}log2(agent.classifierset(ruleNumber).specificity{\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}1);

\noindent
{}{\tt\mc \kern13.000em}{\tt\%}{\tt\mc \kern0.500em}bid{\tt -}Wert{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}berechnet:{\tt\mc \kern0.500em}

\noindent
{}{\tt\mc \kern13.000em}{\tt\%}{\tt\mc \kern0.500em}bid(r){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}strength(r){\tt\mc \kern0.500em}{\tt *}{\tt\mc \kern0.500em}log2(specificity(r))

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

\noindent
{}{\tt\mc \kern12.000em}agent.matchset(length(agent.matchset)+1){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}ruleNumber;

\noindent
{}{\tt\mc \kern13.500em}{\tt\%}{\tt\mc \kern0.500em}wenn{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Regel{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Klassifikators{\tt\mc \kern0.500em}gültig{\tt\mc \kern0.500em}ist,

\noindent
{}{\tt\mc \kern13.500em}{\tt\%}{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}seine{\tt\mc \kern0.500em}Indexnummer{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}matchset{\tt\mc \kern0.500em}übernommen

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

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

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

\noindent
{}{\tt\mc \kern10.000em}validFlag{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}1;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}sonst{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}nächste{\tt\mc \kern0.500em}Regel{\tt\mc \kern0.500em}nicht{\tt\mc \kern0.500em}angewendet

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

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}an{\tt\mc \kern0.500em}dieser{\tt\mc \kern0.500em}Position{\tt\mc \kern0.500em}sind{\tt\mc \kern0.500em}alle{\tt\mc \kern0.500em}Regeln{\tt\mc \kern0.500em}ausgewertet{\tt\mc \kern0.500em}und

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}matchset{\tt\mc \kern0.500em}sollte{\tt\mc \kern0.500em}alle{\tt\mc \kern0.500em}passenden{\tt\mc \kern0.500em}Regeln{\tt\mc \kern0.500em}enthalten

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

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

\noindent
{}{\tt\mc \kern8.000em}overallbid{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

\noindent
{}{\tt\mc \kern8.000em}cumulativebid{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

\noindent
{}{\tt\mc \kern8.000em}chosenrule{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

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

\noindent
{}{\tt\mc \kern8.000em}if{\tt\mc \kern0.500em}{\tt\char'176}isempty(agent.matchset){\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}bei{\tt\mc \kern0.500em}leerem{\tt\mc \kern0.500em}matchset{\tt\mc \kern0.500em}muss{\tt\mc \kern0.500em}nichts{\tt\mc \kern0.500em}ausgewählt{\tt\mc \kern0.500em}werden

\noindent
{}{\tt\mc \kern10.000em}for{\tt\mc \kern0.500em}clsf=1:length(agent.matchset)

\noindent
{}{\tt\mc \kern12.000em}overallbid{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}overallbid{\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}agent.classifierset(agent.matchset(clsf)).bid;

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

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

\noindent
{}{\tt\mc \kern10.000em}for{\tt\mc \kern0.500em}clsf=1:length(agent.matchset)

\noindent
{}{\tt\mc \kern12.000em}normalbid{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}agent.classifierset(agent.matchset(clsf)).bid{\tt\mc \kern0.500em}{\tt /}{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern14.000em}overallbid;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Normalisierung{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}bid{\tt -}Wertes

\noindent
{}{\tt\mc \kern20.000em}{\tt\%}{\tt\mc \kern0.500em}auf{\tt\mc \kern0.500em}Wert{\tt\mc \kern0.500em}zwischen{\tt\mc \kern0.500em}0{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}1

\noindent
{}{\tt\mc \kern20.000em}{\tt\%}{\tt\mc \kern0.500em}(Anteil{\tt\mc \kern0.500em}an{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Summe{\tt\mc \kern0.500em}aller

\noindent
{}{\tt\mc \kern20.000em}{\tt\%}{\tt\mc \kern0.500em}bid{\tt -}Werte{\tt\mc \kern0.500em}aller{\tt\mc \kern0.500em}Regeln)

\noindent
{}{\tt\mc \kern12.000em}agent.classifierset(agent.matchset(clsf)).minfit{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}cumulativebid;

\noindent
{}{\tt\mc \kern12.000em}cumulativebid{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}cumulativebid{\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}normalbid;

\noindent
{}{\tt\mc \kern12.000em}agent.classifierset(agent.matchset(clsf)).maxfit{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}cumulativebid;

\noindent
{}{\tt\mc \kern15.000em}{\tt\%}{\tt\mc \kern0.500em}Unter{\tt -}{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}Obergrenzen{\tt\mc \kern0.500em}werden{\tt\mc \kern0.500em}gesetzt

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

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

\noindent
{}{\tt\mc \kern10.000em}decision{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}rand;

\noindent
{}{\tt\mc \kern10.000em}for{\tt\mc \kern0.500em}clsf=1:length(agent.matchset)

\noindent
{}{\tt\mc \kern12.000em}if{\tt\mc \kern0.500em}(decision{\tt\mc \kern0.500em}{\tt >}={\tt\mc \kern0.500em}agent.classifierset(agent.matchset(clsf)).minfit{\tt\mc \kern0.500em}{\tt\&}{\tt\&}{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern14.000em}decision{\tt\mc \kern0.500em}{\tt <}={\tt\mc \kern0.500em}agent.classifierset(agent.matchset(clsf)).maxfit)

\noindent
{}{\tt\mc \kern14.500em}chosenrule{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}agent.matchset(clsf);

\noindent
{}{\tt\mc \kern14.500em}break;

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

\noindent
{}{\tt\mc \kern10.000em}end{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}hier{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}zu{\tt\mc \kern0.500em}verwendende{\tt\mc \kern0.500em}Regel{\tt\mc \kern0.500em}ausgewählt{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}ihr{\tt\mc \kern0.500em}Index{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}chosenrule{\tt\mc \kern0.500em}abgespeichert

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

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

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

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}wenn{\tt\mc \kern0.500em}eine{\tt\mc \kern0.500em}Regel{\tt\mc \kern0.500em}ausgewählt{\tt\mc \kern0.500em}wurde{\tt\mc \kern0.500em}(chosenrule),{\tt\mc \kern0.500em}muss{\tt\mc \kern0.500em}nach

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}dieser{\tt\mc \kern0.500em}Regel{\tt\mc \kern0.500em}auch{\tt\mc \kern0.500em}gebaut{\tt\mc \kern0.500em}werden:

\noindent
{}{\tt\mc \kern8.000em}if{\tt\mc \kern0.500em}(chosenrule)

\noindent
{}{\tt\mc \kern12.000em}Wabengitter(4,bauPosition){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}agent.classifierset(chosenrule).effector;

\noindent
{}{\tt\mc \kern16.000em}{\tt\%}{\tt\mc \kern0.500em}hier{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}gebaut!!

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

\noindent
{}{\tt\mc \kern12.000em}agent.bucket{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}chosenrule;

\noindent
{}{\tt\mc \kern16.000em}{\tt\%}{\tt\mc \kern0.500em}benutzte{\tt\mc \kern0.500em}Regel{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}BBA

\noindent
{}{\tt\mc \kern16.000em}{\tt\%}{\tt\mc \kern0.500em}zwischengespeichert

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

\noindent
{}{\tt\mc \kern12.000em}agent.BuildCounter{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}agent.BuildCounter{\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}1;

\noindent
{}{\tt\mc \kern16.000em}{\tt\%}{\tt\mc \kern0.500em}Counter{\tt\mc \kern0.500em}erhöhen

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

\noindent
{}{\tt\mc \kern12.000em}builtFlag{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}1;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}zeigt{\tt\mc \kern0.500em}an,{\tt\mc \kern0.500em}dass{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}diesem{\tt\mc \kern0.500em}Zeitschritt{\tt\mc \kern0.500em}gebaut{\tt\mc \kern0.500em}wurde

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

\noindent
{}{\tt\mc \kern12.000em}if{\tt\mc \kern0.500em}(gadurchlauf{\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}numberofgaruns)

\noindent
{}{\tt\mc \kern14.000em}plotwabe(bauPosition,{\tt\mc \kern0.500em}raumplot,{\tt\mc \kern0.500em}Wabengitter(4,bauPosition));{\tt\mc \kern0.500em}

\noindent
{}{\tt\mc \kern16.000em}{\tt\%}{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}gebaute{\tt\mc \kern0.500em}Wabe{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}graphisch{\tt\mc \kern0.500em}markiert

\noindent
{}{\tt\mc \kern16.000em}{\tt\%}{\tt\mc \kern0.500em}Parameter:

\noindent
{}{\tt\mc \kern16.000em}{\tt\%}{\tt\mc \kern0.500em}bauPosition{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}Index{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}zu{\tt\mc \kern0.500em}bebauenden

\noindent
{}{\tt\mc \kern16.000em}{\tt\%}{\tt\mc \kern0.500em}Zelle

\noindent
{}{\tt\mc \kern16.000em}{\tt\%}{\tt\mc \kern0.500em}raumplot{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}Handle{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}zu{\tt\mc \kern0.500em}benutzenden

\noindent
{}{\tt\mc \kern16.000em}{\tt\%}{\tt\mc \kern0.500em}Achsenobjekts

\noindent
{}{\tt\mc \kern16.000em}{\tt\%}{\tt\mc \kern0.500em}Wabengitter(...){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}Typ{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Bausteins

\noindent
{}{\tt\mc \kern16.000em}{\tt\%}{\tt\mc \kern0.500em}(definiert{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Farbe)

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

\noindent
{}{\tt\mc \kern12.000em}bebautezellen{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}find(Wabengitter(4,:));{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Update{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Liste{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Indizes{\tt\mc \kern0.500em}aller{\tt\mc \kern0.500em}bebauten{\tt\mc \kern0.500em}Zellen

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

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

\noindent
{}{\tt\mc \kern8.000em}if{\tt\mc \kern0.500em}true(builtFlag)

\noindent
{}{\tt\mc \kern10.000em}builtFlag{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

\noindent
{}{\tt\mc \kern10.000em}break;{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}jeder{\tt\mc \kern0.500em}Agent{\tt\mc \kern0.500em}soll{\tt\mc \kern0.500em}höchstens{\tt\mc \kern0.500em}einmal{\tt\mc \kern0.500em}pro{\tt\mc \kern0.500em}Zeitschritt{\tt\mc \kern0.500em}bauen

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

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

\noindent
{}{\tt\mc \kern7.500em}

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

\noindent
{}{\tt\mc \kern6.000em}agent.Position(1){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}agent.Position(1){\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}cosd(agent.Ausrichtung{\tt\mc \kern0.500em}{\tt *}{\tt\mc \kern0.500em}agent.Speed);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Bewegung{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}x{\tt -}Richtung

\noindent
{}{\tt\mc \kern6.000em}agent.Position(2){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}agent.Position(2){\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}sind(agent.Ausrichtung{\tt\mc \kern0.500em}{\tt *}{\tt\mc \kern0.500em}agent.Speed);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}Bewegung{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}y{\tt -}Richtung

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

\noindent
{}{\tt\mc \kern6.000em}zelle{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}agent.indexPosition;

\noindent
{}{\tt\mc \kern6.000em}if{\tt\mc \kern0.500em}({\tt\mc \kern0.500em}(Wabengitter(4,zelle){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}0){\tt\mc \kern0.500em}{\tt |}{\tt |}{\tt\mc \kern0.500em}...{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}wenn{\tt\mc \kern0.500em}Position{\tt\mc \kern0.500em}unbebaut{\tt\mc \kern0.500em}ist...

\noindent
{}{\tt\mc \kern8.500em}(agent.Position(1){\tt\mc \kern0.500em}{\tt >}{\tt\mc \kern0.500em}Grenzen(1)){\tt\mc \kern0.500em}{\tt |}{\tt |}{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern8.500em}(agent.Position(1){\tt\mc \kern0.500em}{\tt <}{\tt\mc \kern0.500em}0){\tt\mc \kern0.500em}{\tt |}{\tt |}...

\noindent
{}{\tt\mc \kern8.500em}(agent.Position(2){\tt\mc \kern0.500em}{\tt >}{\tt\mc \kern0.500em}Grenzen(2)){\tt\mc \kern0.500em}{\tt |}{\tt |}{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern8.500em}(agent.Position(2){\tt\mc \kern0.500em}{\tt <}{\tt\mc \kern0.500em}0){\tt\mc \kern0.500em}){\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}..{\tt\mc \kern0.500em}oder{\tt\mc \kern0.500em}außerhalb{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Gitters{\tt\mc \kern0.500em}liegt

\noindent
{}{\tt\mc \kern12.500em}{\tt\%}{\tt\mc \kern0.500em}...dann{\tt\mc \kern0.500em}mache{\tt\mc \kern0.500em}Positionsänderung{\tt\mc \kern0.500em}rückgängig

\noindent
{}{\tt\mc \kern8.000em}agent.Position(1){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}agent.Position(1){\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern10.000em}cosd({\tt\mc \kern0.500em}mod((agent.Ausrichtung{\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}180),360){\tt\mc \kern0.500em}{\tt *}{\tt\mc \kern0.500em}agent.Speed{\tt\mc \kern0.500em});

\noindent
{}{\tt\mc \kern8.000em}agent.Position(2){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}agent.Position(2){\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern10.000em}sind({\tt\mc \kern0.500em}mod((agent.Ausrichtung{\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}180),360){\tt\mc \kern0.500em}{\tt *}{\tt\mc \kern0.500em}agent.Speed{\tt\mc \kern0.500em});

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

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

\noindent
{}{\tt\mc \kern6.000em}if{\tt\mc \kern0.500em}(gadurchlauf{\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}numberofgaruns)

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

\noindent
{}{\tt\mc \kern8.000em}{\tt\%}{\tt\mc \kern0.500em}delete(agent.Markierung);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}alte{\tt\mc \kern0.500em}Markierung{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}gelöscht

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

\noindent
{}{\tt\mc \kern8.000em}agent.Markierung{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}line(agent.Position(1),{\tt\mc \kern0.500em}agent.Position(2),{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern18.000em}1.1,{\tt\mc \kern0.500em}'Marker','.',{\tt\mc \kern0.500em}'MarkerFaceColor',agent.Farbe,{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern18.000em}'Color',agent.Farbe,{\tt\mc \kern0.500em}'Parent',raumplot{\tt\mc \kern0.500em});

\noindent
{}{\tt\mc \kern18.000em}{\tt\%}{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}neue{\tt\mc \kern0.500em}Markierung{\tt\mc \kern0.500em}gesetzt

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

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

\noindent
{}{\tt\mc \kern6.000em}if{\tt\mc \kern0.500em}(animation)

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

\noindent
{}{\tt\mc \kern6.000em}end{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}zeigt{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}animierte{\tt\mc \kern0.500em}Bausequenz,{\tt\mc \kern0.500em}wenn{\tt\mc \kern0.500em}animation{\tt -}flag{\tt\mc \kern0.500em}gesetzt

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

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

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

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

\noindent
{}{\tt\mc \kern4.000em}function{\tt\mc \kern0.500em}liste{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}nachbarn(obj,{\tt\mc \kern0.500em}mittelpunkt)

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}Gibt{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}einen{\tt\mc \kern0.500em}gegebenen{\tt\mc \kern0.500em}Knoten{\tt\mc \kern0.500em}im{\tt\mc \kern0.500em}Wabengitter{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Liste{\tt\mc \kern0.500em}der

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}direkten{\tt\mc \kern0.500em}Nachbarn{\tt\mc \kern0.500em}zurück{\tt\mc \kern0.500em}{\tt -}{\tt\mc \kern0.500em}Reihenfolge{\tt\mc \kern0.500em}vom{\tt\mc \kern0.500em}oberen{\tt\mc \kern0.500em}Nachbarn{\tt\mc \kern0.500em}

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}beginnend{\tt\mc \kern0.500em}im{\tt\mc \kern0.500em}Uhrzeigersinn

\noindent
{}{\tt\mc \kern6.000em}global{\tt\mc \kern0.500em}DX;

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

\noindent
{}{\tt\mc \kern6.000em}liste{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}[{\tt\mc \kern0.500em}mittelpunkt+2{\tt *}DX,{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern10.500em}mittelpunkt+DX+1+mod(idivide(mittelpunkt,uint32(DX)),2),{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern10.500em}mittelpunkt{\tt -}DX+1+mod(idivide(mittelpunkt,uint32(DX)),2),{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern10.500em}mittelpunkt{\tt -}2{\tt *}DX,{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern10.500em}mittelpunkt{\tt -}DX{\tt -}2+mod(idivide(mittelpunkt,uint32(DX)),2),{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern10.500em}mittelpunkt+DX{\tt -}2+mod(idivide(mittelpunkt,uint32(DX)),2){\tt\mc \kern0.500em}];

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

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

\noindent
{}{\tt\mc \kern4.000em}function{\tt\mc \kern0.500em}indexnummer{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}indexPosition(agent)

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}Gibt{\tt\mc \kern0.500em}für{\tt\mc \kern0.500em}jeden{\tt\mc \kern0.500em}Agenten{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}Index{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Mittelpunkts{\tt\mc \kern0.500em}derjenigen

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}Wabe{\tt\mc \kern0.500em}zurück,{\tt\mc \kern0.500em}auf{\tt\mc \kern0.500em}deren{\tt\mc \kern0.500em}Fläche{\tt\mc \kern0.500em}sich{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Agent{\tt\mc \kern0.500em}nach{\tt\mc \kern0.500em}seinen

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}Koordinaten{\tt\mc \kern0.500em}befindet

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

\noindent
{}{\tt\mc \kern6.000em}global{\tt\mc \kern0.500em}MittelPunkte;

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}global{\tt\mc \kern0.500em}bebautezellen;

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

\noindent
{}{\tt\mc \kern6.000em}agent.Abstand{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}[abs(Wabengitter(1,MittelPunkte){\tt\mc \kern0.500em}{\tt -}{\tt\mc \kern0.500em}agent.Position(1));{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern11.500em}abs(Wabengitter(2,MittelPunkte){\tt\mc \kern0.500em}{\tt -}{\tt\mc \kern0.500em}agent.Position(2))];

\noindent
{}{\tt\mc \kern6.000em}kandidatenX{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}find(agent.Abstand(1,:){\tt\mc \kern0.500em}{\tt <}={\tt\mc \kern0.500em}1);

\noindent
{}{\tt\mc \kern6.000em}kandidatenY{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}find(agent.Abstand(2,:){\tt\mc \kern0.500em}{\tt <}={\tt\mc \kern0.500em}1);

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

\noindent
{}{\tt\mc \kern6.000em}indexnummer{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}0;

\noindent
{}{\tt\mc \kern6.000em}for{\tt\mc \kern0.500em}kandX=1:length(kandidatenX)

\noindent
{}{\tt\mc \kern8.000em}for{\tt\mc \kern0.500em}kandY=1:length(kandidatenY)

\noindent
{}{\tt\mc \kern10.000em}if{\tt\mc \kern0.500em}(kandidatenX(kandX){\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}kandidatenY(kandY))

\noindent
{}{\tt\mc \kern12.000em}indexnummer{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}MittelPunkte(kandidatenX(kandX));

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

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

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

\noindent
{}{\tt\mc \kern8.000em}if{\tt\mc \kern0.500em}(indexnummer{\tt\mc \kern0.500em}{\tt\char'176}={\tt\mc \kern0.500em}0)

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

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

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

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

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}folgender{\tt\mc \kern0.500em}Code{\tt\mc \kern0.500em}ist{\tt\mc \kern0.500em}zu{\tt\mc \kern0.500em}langsam{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}wird{\tt\mc \kern0.500em}nur{\tt\mc \kern0.500em}noch{\tt\mc \kern0.500em}verwendet,

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}wenn{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}andere{\tt\mc \kern0.500em}kein{\tt\mc \kern0.500em}Ergebnis{\tt\mc \kern0.500em}bringt:

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

\noindent
{}{\tt\mc \kern6.000em}if{\tt\mc \kern0.500em}indexnummer{\tt\mc \kern0.500em}=={\tt\mc \kern0.500em}0

\noindent
{}{\tt\mc \kern8.000em}agent.Abstand{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}sqrt((Wabengitter(1,MittelPunkte){\tt\mc \kern0.500em}{\tt -}{\tt\mc \kern0.500em}(agent.Position(1,1))).{\tt\char'136}2{\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern17.500em}+{\tt\mc \kern0.500em}(Wabengitter(2,MittelPunkte){\tt\mc \kern0.500em}{\tt -}{\tt\mc \kern0.500em}(agent.Position(1,2))).{\tt\char'136}2{\tt\mc \kern0.500em});

\noindent
{}{\tt\mc \kern12.500em}{\tt\%}{\tt\mc \kern0.500em}erzeugt{\tt\mc \kern0.500em}einen{\tt\mc \kern0.500em}Vektor{\tt\mc \kern0.500em}mit{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}euklidischen{\tt\mc \kern0.500em}Abständen{\tt\mc \kern0.500em}des{\tt\mc \kern0.500em}Agenten

\noindent
{}{\tt\mc \kern12.500em}{\tt\%}{\tt\mc \kern0.500em}von{\tt\mc \kern0.500em}allen{\tt\mc \kern0.500em}Wabenmittelpunkten:{\tt\mc \kern0.500em}

\noindent
{}{\tt\mc \kern12.500em}{\tt\%}{\tt\mc \kern0.500em}D(X,Y){\tt\mc \kern0.500em}={\tt\mc \kern0.500em}sqrt{\tt\mc \kern0.500em}[{\tt\mc \kern0.500em}(x1{\tt -}y1){\tt\char'136}2{\tt\mc \kern0.500em}+{\tt\mc \kern0.500em}(x2{\tt -}y2){\tt\char'136}2{\tt\mc \kern0.500em}]

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

\noindent
{}{\tt\mc \kern7.500em}[abstand,{\tt\mc \kern0.500em}I]{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}min(agent.Abstand);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}gibt{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}Abstand{\tt\mc \kern0.500em}zum{\tt\mc \kern0.500em}nächstgelegenen

\noindent
{}{\tt\mc \kern11.500em}{\tt\%}{\tt\mc \kern0.500em}Wabenmittelpunkt{\tt\mc \kern0.500em}(abstand){\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}dazugehörigen

\noindent
{}{\tt\mc \kern11.500em}{\tt\%}{\tt\mc \kern0.500em}Index{\tt\mc \kern0.500em}im{\tt\mc \kern0.500em}Vektor{\tt\mc \kern0.500em}Abstand{\tt\mc \kern0.500em}(I){\tt\mc \kern0.500em}zurück

\noindent
{}{\tt\mc \kern8.000em}indexnummer{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}MittelPunkte(I);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}nächste{\tt\mc \kern0.500em}Mittelpunkt{\tt\mc \kern0.500em}ist{\tt\mc \kern0.500em}der

\noindent
{}{\tt\mc \kern12.000em}{\tt\%}{\tt\mc \kern0.500em}mit{\tt\mc \kern0.500em}Index{\tt\mc \kern0.500em}I{\tt\mc \kern0.500em}im{\tt\mc \kern0.500em}Vektor{\tt\mc \kern0.500em}Abstand,{\tt\mc \kern0.500em}also{\tt\mc \kern0.500em}ist{\tt\mc \kern0.500em}sein

\noindent
{}{\tt\mc \kern12.000em}{\tt\%}{\tt\mc \kern0.500em}Index{\tt\mc \kern0.500em}im{\tt\mc \kern0.500em}Array{\tt\mc \kern0.500em}Wabengitter{\tt\mc \kern0.500em}der{\tt\mc \kern0.500em}Wert{\tt\mc \kern0.500em}an{\tt\mc \kern0.500em}Stelle{\tt\mc \kern0.500em}i

\noindent
{}{\tt\mc \kern12.000em}{\tt\%}{\tt\mc \kern0.500em}im{\tt\mc \kern0.500em}Vektor{\tt\mc \kern0.500em}Abstand

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

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

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

\noindent
{}{\tt\mc \kern4.000em}function{\tt\mc \kern0.500em}updatefitness(agent)

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}Kopiert{\tt\mc \kern0.500em}den{\tt\mc \kern0.500em}Gesamt{\tt -}Fitnesstring{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}die{\tt\mc \kern0.500em}Stärkewerte{\tt\mc \kern0.500em}der

\noindent
{}{\tt\mc \kern6.000em}{\tt\%}{\tt\mc \kern0.500em}einzelnen{\tt\mc \kern0.500em}Regeln.

\noindent
{}{\tt\mc \kern6.000em}for{\tt\mc \kern0.500em}regelindex=1:agent.numberofclassifiers

\noindent
{}{\tt\mc \kern8.000em}agent.classifierset(regelindex).fitnessstring{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern8.000em}agent.classifierfitnessstring({\tt\mc \kern0.500em}((regelindex{\tt -}1){\tt *}8)+1:((regelindex{\tt -}1){\tt *}8)+8{\tt\mc \kern0.500em});

\noindent
{}{\tt\mc \kern8.000em}graystrength{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}bin2dec(agent.classifierset(regelindex).fitnessstring);

\noindent
{}{\tt\mc \kern10.000em}{\tt\%}{\tt\mc \kern0.500em}Konvertierung{\tt\mc \kern0.500em}von{\tt\mc \kern0.500em}Binärstring{\tt\mc \kern0.500em}in

\noindent
{}{\tt\mc \kern10.000em}{\tt\%}{\tt\mc \kern0.500em}Dezimalzahl(Graycodiert)

\noindent
{}{\tt\mc \kern8.000em}agent.classifierset(regelindex).strength{\tt\mc \kern0.500em}={\tt\mc \kern0.500em}...

\noindent
{}{\tt\mc \kern10.000em}gray2bin(graystrength,'fsk',256);{\tt\mc \kern0.500em}{\tt\%}{\tt\mc \kern0.500em}konvertiert{\tt\mc \kern0.500em}von{\tt\mc \kern0.500em}gray{\tt\mc \kern0.500em}in{\tt\mc \kern0.500em}standard{\tt\mc \kern0.500em}binär

\noindent
{}{\tt\mc \kern15.500em}{\tt\%}{\tt\mc \kern0.500em}und{\tt\mc \kern0.500em}speichert{\tt\mc \kern0.500em}im{\tt\mc \kern0.500em}strength{\tt -}Feld

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

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

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

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

\noindent
{}\hfill

\noindent
{}end

\noindent
{}\hfill

\noindent
{}

\rm\mc
