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

09.09.2013 Views

210 Bilag A 176 System . out . p r i n t l n ( i +” ”+n . c h i l d r e n . get ( i )+” Depth : ”+n . c h i l d r e n . get ( i ) . d+” Score ”+n . c h i l d r e n . get ( i ) . a ) ; 177 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . par+” ”+n . c h i l d r e n . get ( i ) . a+” b ”+n . c h i l d r e n . get ( i ) . bc+”,”+n . c h i l d r e n . get ( i ) . br+” w ”+n . c h i l d r e n . get ( i ) . wc+”,”+n . c h i l d r e n . get ( i ) . wr+” ”+n . c h i l d r e n . get ( i ) . c h i l d r e n +” ”+n . c h i l d r e n . get ( i ) . nodeBoard ) ; 178 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard [ 0 ] [ 0 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 1 ] [ 0 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 2 ] [ 0 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 3 ] [ 0 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 4 ] [ 0 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 5 ] [ 0 ] ) ; 179 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard [ 0 ] [ 1 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 1 ] [ 1 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 2 ] [ 1 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 3 ] [ 1 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 4 ] [ 1 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 5 ] [ 1 ] ) ; 180 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard [ 0 ] [ 2 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 1 ] [ 2 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 2 ] [ 2 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 3 ] [ 2 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 4 ] [ 2 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 5 ] [ 2 ] ) ; 181 i f ( tModel . noRows > 3) { 182 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard [ 0 ] [ 3 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 1 ] [ 3 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 2 ] [ 3 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 3 ] [ 3 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 4 ] [ 3 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 5 ] [ 3 ] ) ; 183 i f ( tModel . noRows > 4) { 184 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard [ 0 ] [ 4 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 1 ] [ 4 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 2 ] [ 4 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 3 ] [ 4 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 4 ] [ 4 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 5 ] [ 4 ] ) ; 185 i f ( tModel . noRows > 5) { 186 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard [ 0 ] [ 5 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 1 ] [ 5 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 2 ] [ 5 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 3 ] [ 5 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 4 ] [ 5 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 5 ] [ 5 ] ) ; 187 i f ( tModel . noRows > 6) { 188 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard [ 0 ] [ 6 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 1 ] [ 6 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 2 ] [ 6 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 3 ] [ 6 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 4 ] [ 6 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 5 ] [ 6 ] ) ; 189 i f ( tModel . noRows > 7) {

A.15 TaijiPrint.java 211 190 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard [ 0 ] [ 7 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 1 ] [ 7 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 2 ] [ 7 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 3 ] [ 7 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 4 ] [ 7 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 5 ] [ 7 ] ) ; 191 i f ( tModel . noRows > 8) { 192 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard [ 0 ] [ 8 ] + ” ”+ n . c h i l d r e n . get ( i ) . nodeBoard [ 1 ] [ 8 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 2 ] [ 8 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 3 ] [ 8 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 4 ] [ 8 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 5 ] [ 8 ] ) ; 193 194 } 195 } 196 } 197 } 198 } 199 } 200 System . out . p r i n t l n ( ) ; 201 } 202 } 203 204 // f o r b r a e t med 7 k o l o n e r 205 p u b l i c void p r i n t C h i l d r e n 7 x ( Node n ) { 206 System . out . p r i n t l n (” t P r i n t P r i n t Children ”+n ) ; 207 f o r ( i n t i =0; i

210 Bilag A<br />

176 System . out . p r i n t l n ( i +” ”+n . c h i l d r e n . get ( i )+” Depth : ”+n<br />

. c h i l d r e n . get ( i ) . d+” Score ”+n . c h i l d r e n . get ( i ) . a ) ;<br />

177 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . par+” ”+n . c h i l d r e n<br />

. get ( i ) . a+” b ”+n . c h i l d r e n . get ( i ) . bc+”,”+n . c h i l d r e n<br />

. get ( i ) . br+” w ”+n . c h i l d r e n . get ( i ) . wc+”,”+n .<br />

c h i l d r e n . get ( i ) . wr+” ”+n . c h i l d r e n . get ( i ) . c h i l d r e n +”<br />

”+n . c h i l d r e n . get ( i ) . nodeBoard ) ;<br />

178 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard [ 0 ] [ 0 ] + ”<br />

”+n . c h i l d r e n . get ( i ) . nodeBoard [ 1 ] [ 0 ] + ” ”+n . c h i l d r e n .<br />

get ( i ) . nodeBoard [ 2 ] [ 0 ] + ” ”+n . c h i l d r e n . get ( i ) .<br />

nodeBoard [ 3 ] [ 0 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard<br />

[ 4 ] [ 0 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 5 ] [ 0 ] ) ;<br />

179 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard [ 0 ] [ 1 ] + ”<br />

”+n . c h i l d r e n . get ( i ) . nodeBoard [ 1 ] [ 1 ] + ” ”+n . c h i l d r e n .<br />

get ( i ) . nodeBoard [ 2 ] [ 1 ] + ” ”+n . c h i l d r e n . get ( i ) .<br />

nodeBoard [ 3 ] [ 1 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard<br />

[ 4 ] [ 1 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 5 ] [ 1 ] ) ;<br />

180 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard [ 0 ] [ 2 ] + ”<br />

”+n . c h i l d r e n . get ( i ) . nodeBoard [ 1 ] [ 2 ] + ” ”+n . c h i l d r e n .<br />

get ( i ) . nodeBoard [ 2 ] [ 2 ] + ” ”+n . c h i l d r e n . get ( i ) .<br />

nodeBoard [ 3 ] [ 2 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard<br />

[ 4 ] [ 2 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 5 ] [ 2 ] ) ;<br />

181 i f ( tModel . noRows > 3) {<br />

182 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard<br />

[ 0 ] [ 3 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard [ 1 ] [ 3 ] + ”<br />

”+n . c h i l d r e n . get ( i ) . nodeBoard [ 2 ] [ 3 ] + ” ”+n .<br />

c h i l d r e n . get ( i ) . nodeBoard [ 3 ] [ 3 ] + ” ”+n . c h i l d r e n .<br />

get ( i ) . nodeBoard [ 4 ] [ 3 ] + ” ”+n . c h i l d r e n . get ( i ) .<br />

nodeBoard [ 5 ] [ 3 ] ) ;<br />

183 i f ( tModel . noRows > 4) {<br />

184 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) . nodeBoard<br />

[ 0 ] [ 4 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard<br />

[ 1 ] [ 4 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard<br />

[ 2 ] [ 4 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard<br />

[ 3 ] [ 4 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard<br />

[ 4 ] [ 4 ] + ” ”+n . c h i l d r e n . get ( i ) . nodeBoard<br />

[ 5 ] [ 4 ] ) ;<br />

185 i f ( tModel . noRows > 5) {<br />

186 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) .<br />

nodeBoard [ 0 ] [ 5 ] + ” ”+n . c h i l d r e n . get ( i ) .<br />

nodeBoard [ 1 ] [ 5 ] + ” ”+n . c h i l d r e n . get ( i ) .<br />

nodeBoard [ 2 ] [ 5 ] + ” ”+n . c h i l d r e n . get ( i ) .<br />

nodeBoard [ 3 ] [ 5 ] + ” ”+n . c h i l d r e n . get ( i ) .<br />

nodeBoard [ 4 ] [ 5 ] + ” ”+n . c h i l d r e n . get ( i ) .<br />

nodeBoard [ 5 ] [ 5 ] ) ;<br />

187 i f ( tModel . noRows > 6) {<br />

188 System . out . p r i n t l n ( n . c h i l d r e n . get ( i ) .<br />

nodeBoard [ 0 ] [ 6 ] + ” ”+n . c h i l d r e n . get (<br />

i ) . nodeBoard [ 1 ] [ 6 ] + ” ”+n . c h i l d r e n .<br />

get ( i ) . nodeBoard [ 2 ] [ 6 ] + ” ”+n .<br />

c h i l d r e n . get ( i ) . nodeBoard [ 3 ] [ 6 ] + ”<br />

”+n . c h i l d r e n . get ( i ) . nodeBoard<br />

[ 4 ] [ 6 ] + ” ”+n . c h i l d r e n . get ( i ) .<br />

nodeBoard [ 5 ] [ 6 ] ) ;<br />

189 i f ( tModel . noRows > 7) {

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

Saved successfully!

Ooh no, something went wrong!