09.09.2013 Views

Kunstig Intelligens til Brætspillet Taiji - Danmarks Tekniske Universitet

Kunstig Intelligens til Brætspillet Taiji - Danmarks Tekniske Universitet

Kunstig Intelligens til Brætspillet Taiji - Danmarks Tekniske Universitet

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Bilag A<br />

To be added<br />

A.1 AI<strong>Taiji</strong>AlphaBeta.java<br />

Kildekode<br />

1 import java . u t i l . Random ;<br />

2 import java . u t i l . ArrayList ;<br />

3<br />

4 p u b l i c c l a s s AI<strong>Taiji</strong>AlphaBeta {<br />

5<br />

6 p u b l i c <strong>Taiji</strong>Model tModel ;<br />

7 p u b l i c Node tNode ;<br />

8 p u b l i c i n t count ; // f o r at t e s t e hvor mange noder der l a v e s .<br />

9 p u b l i c i n t maxDepth ;<br />

10 p r i v a t e ArrayList [ ] [ ] nodes ; // i n d e h o l d e r a l l e noderne i<br />

a r r a y l i s t s e f t e r g e n e r a t i o n og hash v a e r d i .<br />

11 p r i v a t e i n t maxD; // den maximale dybde f o r t r a e e t .<br />

12 p r i v a t e i n t maxH ; // den maximale Hash v a e r d i<br />

13 p r i v a t e Node Root ; // Traeets rod .<br />

14 p r i v a t e i n t searchD ; // Search depth , muligheden f o r at s a e t t e<br />

en maximal s o e g e dybde<br />

15<br />

16 p u b l i c AI<strong>Taiji</strong>AlphaBeta ( <strong>Taiji</strong>Model m) {<br />

17 t h i s . tModel = m;<br />

18 }

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!