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
168 Bilag A 303 f [ 1 ] [ 0 ] [ 1 ] = W; 304 } 305 e l s e 306 i f (W>f [ 1 ] [ 1 ] [ 1 ] ) { 307 f [ 1 ] [ 1 ] [ 0 ] = w; 308 f [ 1 ] [ 1 ] [ 1 ] = W; 309 } 310 } 311 } 312 f o r ( i n t b=2; bf [ 0 ] [ 0 ] [ 1 ] ) { 316 f [ 0 ] [ 1 ] [ 0 ] = f [ 0 ] [ 0 ] [ 0 ] ; 317 f [ 0 ] [ 1 ] [ 1 ] = f [ 0 ] [ 0 ] [ 1 ] ; 318 f [ 0 ] [ 0 ] [ 0 ] = b ; 319 f [ 0 ] [ 0 ] [ 1 ] = B; 320 } 321 e l s e 322 i f (B>f [ 0 ] [ 1 ] [ 1 ] ) { 323 f [ 0 ] [ 1 ] [ 0 ] = b ; 324 f [ 0 ] [ 1 ] [ 1 ] = B; 325 } 326 } 327 } 328 r e t u r n ( f ) ; 329 } 330 331 // r e t u r n e r numrene f o r de 3 s t o e r s t e hvid og de 3 s t o e r s t e s o r t e f i g u r e , som der endnu kan p l a c e r e s b r i k opad . 332 p u b l i c i n t [ ] [ ] [ ] g e t F i g s 3 ( i n t [ ] [ ] fb ) { 333 i n t [ ] [ ] [ ] f = new i n t [ 2 ] [ 3 ] [ 2 ] ; 334 // f [ ] [ ] [ 0 ] = f i g u r navnet (nummer) , f [ ] [ ] [ 1 ] = f i g u r e n s s t o e r r e l s e 335 // f [ 1 ] [ ] [ ] = hvid f i g u r , f [ 0 ] [ ] [ ] = s o r t f i g u r 336 // f [ ] [ 0 ] [ ] = s t o e r s t e f i g u r , f [ ] [ 1 ] [ ] = n a e s t s t o e r r e s t e f i g u r , f [ ] [ 2 ] [ ] = 3 . s t o e r s t e f i g u r 337 f [ 1 ] [ 0 ] [ 0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f [ 0 ] [ 0 ] [ 1 ] ) 381 { 382 f [ 0 ] [ 1 ] [ 0 ] = f [ 0 ] [ 0 ] [ 0 ] ; 383 f [ 0 ] [ 1 ] [ 1 ] = f [ 0 ] [ 0 ] [ 1 ] ; 384 f [ 0 ] [ 0 ] [ 0 ] = b ; 385 f [ 0 ] [ 0 ] [ 1 ] = B; 386 } 387 e l s e 388 i f (B>f [ 0 ] [ 1 ] [ 1 ] ) { 389 f [ 0 ] [ 2 ] [ 0 ] = f [ 0 ] [ 1 ] [ 0 ] ; 390 f [ 0 ] [ 2 ] [ 1 ] = f [ 0 ] [ 2 ] [ 1 ] ; 391 f [ 0 ] [ 1 ] [ 0 ] = b ; 392 f [ 0 ] [ 1 ] [ 1 ] = B; 393 } 394 e l s e { 395 i f (B>f [ 0 ] [ 2 ] [ 1 ] ) { 396 f [ 0 ] [ 2 ] [ 0 ] = b ; 397 f [ 0 ] [ 2 ] [ 1 ] = B; 398 } 399 } 400 } 401 } 402 } 403 r e t u r n ( f ) ; 404 } 405 406 // r e t u r n e r e true , h v i s der e r minimum en f r i p l a d s opad f i g u r e n 407 p r i v a t e boolean checkFig ( i n t f , i n t [ ] [ ] fb ) { 408 f o r ( i n t c =0; c < tModel . noCols ; c++){
- Page 128 and 129: 118 Bilag A 537 b [ c +1][ r −1]
- Page 130 and 131: 120 Bilag A 633 b [ c −1][ r −1
- Page 132 and 133: 122 Bilag A 729 beta = r e [ 2 ] ;
- Page 134 and 135: 124 Bilag A 825 beta = r e [ 2 ] ;
- Page 136 and 137: 126 Bilag A 916 i f ( n . a > v ) 9
- Page 138 and 139: 128 Bilag A 997 Root . wc=0; // tMo
- Page 140 and 141: 130 Bilag A 1097 n . bc = tModel .
- Page 142 and 143: 132 Bilag A 93 i f ( rowEnd >= tMod
- Page 144 and 145: 134 Bilag A 192 alpha = n . a ; 193
- Page 146 and 147: 136 Bilag A 291 } 292 293 // Min−
- Page 148 and 149: 138 Bilag A 391 n . c h i l d r e n
- Page 150 and 151: 140 Bilag A 493 i f ( Root . c h i
- Page 152 and 153: 142 Bilag A 593 r e t u r n ( n ) ;
- Page 154 and 155: 144 Bilag A 90 b [ c ] [ r ] = 0 ;
- Page 156 and 157: 146 Bilag A 185 // System . out . p
- Page 158 and 159: 148 Bilag A 280 } 281 282 // f l y
- Page 160 and 161: 150 Bilag A 377 // i f ( tTree . ma
- Page 162 and 163: 152 Bilag A 481 } 482 r e t u r n (
- Page 164 and 165: 154 Bilag A 532 // System . out . p
- Page 166 and 167: 156 Bilag A 33 p u b l i c i n t [
- Page 168 and 169: 158 Bilag A 137 f o r ( i n t r =0;
- Page 170 and 171: 160 Bilag A 245 f o r ( i n t r =0;
- Page 172 and 173: 162 Bilag A 353 break ; 354 } 355 i
- Page 174 and 175: 164 Bilag A 94 } 95 { // H o r i s
- Page 176 and 177: 166 Bilag A 198 p r i v a t e void
- Page 180 and 181: 170 Bilag A 409 f o r ( i n t r =0;
- Page 182 and 183: 172 Bilag A 43 p u b l i c Node cre
- Page 184 and 185: 174 Bilag A 27 whiteScore = new Sco
- Page 186 and 187: 176 Bilag A 65 bc = 1 ; 66 e l s e
- Page 188 and 189: 178 Bilag A 58 p u b l i c void mou
- Page 190 and 191: 180 Bilag A 149 S t r i n g t x t =
- Page 192 and 193: 182 Bilag A l o a d i n g the f i l
- Page 194 and 195: 184 Bilag A 7 p u b l i c AITaijiMi
- Page 196 and 197: 186 Bilag A 105 i f ( b l a c k P l
- Page 198 and 199: 188 Bilag A 211 tBoard . s e t P i
- Page 200 and 201: 190 Bilag A 315 { 316 f o r ( i n t
- Page 202 and 203: 192 Bilag A 416 { 417 //Bunden 418
- Page 204 and 205: 194 Bilag A 510 p r i v a t e boole
- Page 206 and 207: 196 Bilag A 612 } 613 614 // b e r
- Page 208 and 209: 198 Bilag A 702 } 703 704 // s a e
- Page 210 and 211: 200 Bilag A 802 p u b l i c void ne
- Page 212 and 213: 202 Bilag A 59 g . f i l l R e c t
- Page 214 and 215: 204 Bilag A 159 { 160 t h i s . set
- Page 216 and 217: 206 Bilag A 81 System . out . p r i
- Page 218 and 219: 208 Bilag A [ 1 ] [ 7 ] + ” ”+n
- Page 220 and 221: 210 Bilag A 176 System . out . p r
- Page 222 and 223: 212 Bilag A 212 System . out . p r
- Page 224 and 225: 214 Bilag A 246 System . out . p r
- Page 226 and 227: 216 Bilag A [ 8 ] [ 2 ] ) ; 277 i f
A.6 FigureMap.java 169<br />
355 i f (W>f [ 1 ] [ 0 ] [ 1 ] ) {<br />
356 f [ 1 ] [ 2 ] [ 0 ] = f [ 1 ] [ 1 ] [ 0 ] ;<br />
357 f [ 1 ] [ 2 ] [ 1 ] = f [ 1 ] [ 2 ] [ 1 ] ;<br />
358 f [ 1 ] [ 1 ] [ 0 ] = f [ 1 ] [ 0 ] [ 0 ] ;<br />
359 f [ 1 ] [ 1 ] [ 1 ] = f [ 1 ] [ 0 ] [ 1 ] ;<br />
360 f [ 1 ] [ 0 ] [ 0 ] = w;<br />
361 f [ 1 ] [ 0 ] [ 1 ] = W;<br />
362 }<br />
363 e l s e<br />
364 i f (W>f [ 1 ] [ 1 ] [ 1 ] ) {<br />
365 f [ 1 ] [ 2 ] [ 0 ] = f [ 1 ] [ 1 ] [ 0 ] ;<br />
366 f [ 1 ] [ 2 ] [ 1 ] = f [ 1 ] [ 2 ] [ 1 ] ;<br />
367 f [ 1 ] [ 1 ] [ 0 ] = w;<br />
368 f [ 1 ] [ 1 ] [ 1 ] = W;<br />
369 }<br />
370 e l s e {<br />
371 i f (W>f [ 1 ] [ 2 ] [ 1 ] ) {<br />
372 f [ 1 ] [ 2 ] [ 0 ] = w;<br />
373 f [ 1 ] [ 2 ] [ 1 ] = W;<br />
374 }<br />
375 }<br />
376 }<br />
377 f o r ( i n t b=2; bf [ 0 ] [ 0 ] [ 1 ] )<br />
381 {<br />
382 f [ 0 ] [ 1 ] [ 0 ] = f [ 0 ] [ 0 ] [ 0 ] ;<br />
383 f [ 0 ] [ 1 ] [ 1 ] = f [ 0 ] [ 0 ] [ 1 ] ;<br />
384 f [ 0 ] [ 0 ] [ 0 ] = b ;<br />
385 f [ 0 ] [ 0 ] [ 1 ] = B;<br />
386 }<br />
387 e l s e<br />
388 i f (B>f [ 0 ] [ 1 ] [ 1 ] ) {<br />
389 f [ 0 ] [ 2 ] [ 0 ] = f [ 0 ] [ 1 ] [ 0 ] ;<br />
390 f [ 0 ] [ 2 ] [ 1 ] = f [ 0 ] [ 2 ] [ 1 ] ;<br />
391 f [ 0 ] [ 1 ] [ 0 ] = b ;<br />
392 f [ 0 ] [ 1 ] [ 1 ] = B;<br />
393 }<br />
394 e l s e {<br />
395 i f (B>f [ 0 ] [ 2 ] [ 1 ] ) {<br />
396 f [ 0 ] [ 2 ] [ 0 ] = b ;<br />
397 f [ 0 ] [ 2 ] [ 1 ] = B;<br />
398 }<br />
399 }<br />
400 }<br />
401 }<br />
402 }<br />
403 r e t u r n ( f ) ;<br />
404 }<br />
405<br />
406 // r e t u r n e r e true , h v i s der e r minimum en f r i p l a d s opad<br />
f i g u r e n<br />
407 p r i v a t e boolean checkFig ( i n t f , i n t [ ] [ ] fb ) {<br />
408 f o r ( i n t c =0; c < tModel . noCols ; c++){