1 / 12

Pertemuan 15 Game Playing

Pertemuan 15 Game Playing. Matakuliah : T0264/Intelijensia Semu Tahun : Juli 2006 Versi : 2/1. Learning Outcomes. Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : << TIK-99 >> << TIK-99>>. Outline Materi. Materi 1 Materi 2 Materi 3 Materi 4 Materi 5. 12.1. Overview.

greta
Download Presentation

Pertemuan 15 Game Playing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pertemuan 15Game Playing Matakuliah : T0264/Intelijensia Semu Tahun : Juli 2006 Versi : 2/1

  2. Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : • << TIK-99 >> • << TIK-99>>

  3. Outline Materi • Materi 1 • Materi 2 • Materi 3 • Materi 4 • Materi 5

  4. 12.1. Overview • Mudah untuk menentukan ukuran kesuksesan dan kegagalan (menang atau kalah). • Perhatikan permainan Catur (chess). • Rata-rata setiap node bercang sebanyak 35. Tiap pemain rata-rata bergerak 50 kali. Sehingga total dalam satu pohon permainan akan terdapat posisi sebanyak 35100. • Netoda-metoda yang digunakan dalam game : • Depth-limited search. • Statistic evaluation function. • Credit assignment problem. • Minimax search algorithm.

  5. A B C D (8) (3) (-2) A B C D K E F G I H J (9) (0) (0) (-3) (-6) (-2) (-4) 12.2. Prosedur pencarian MINIMAX • One-Ply Search : • Two - Ply Search :

  6. Prosedur pencarian MINIMAX • Backing Up the Values of a Two-Ply Search

  7. Algorithm : MINIMAX (Position,Depth, Player) 1. If DEEP-ENOUGH(Position, Depth), then return the structure VALUE = STATIC(Position, Player); PATH = nil This indicates that there is no path from this node and that its value is determined by static evaluation function. 2. Otherwise,generate one more ply of the tree by calling the function MOVEGEN(Position,Player) and setting SUCCESORS to the list it returns. 3. If SUCCESORS is empty, then there are no moves to be made, so return the structure that would have been returned if DEEP-ENOUGH had returned true.

  8. Algorithm contd’ 4. If SUCCESORS is not empty, then examine each element in turn and keep track of the best one. This is done as follows. Initialize BEST-SCORE to the minimum value that STATIC can return. It will be update to reflect the best score that can be achieved by an element of SUCCESORS. For each element SUCC of SUCCESORS, do the following : • Set RESULT- SUCC to MINIMAX(SUCC, Depht + 1, OPPOSITE(Player)) This recursive call to MINIMAX will actually carry out the exploration of SUCC. • Set NEW-VALUE to - VALUE(RESULT-SUCC). This will cause it to reflect the merits of the position from the opposite perspective from that of the next lower level. • If NEW-VALUE > BEST-SCORE, then we found a succesor that is better than any that have been examined so far. Record this by doing the following :

  9. Algorithm contd’ • Set BEST-SCORE to NEW-VALUE. • The best known path is now from CURRENT to SUCC and then on to the appropriate path down from SUCC as determined by the recursive call to MINIMAX. So set BEST-PATH to the result of attaching SUCC to the front of PATH(RESULT-SUCC). 5. Now that all the succesors have been examined, we know the value of Position as well as which path to take from it. So return the structure VALUE = BEST-SCORE PATH = BEST-PATH

  10. MAX B A C D -6 -2 -2 -4 MIN E F G J K L H 9 -6 0 -2 -4 -3 1 I 0 Prosedur pencarian MINIMAX

  11. Prosedur pencarian MINIMAX • Pada MINIMAX terdapat 2 prosedur yang dijalankan yaitu : maximize dilakukan oleh “saya” dan minimize dilakukan oleh “lawan”. • Diperlukan fungsi evaluasi statis yang menyatakan nilai yang mungkin didapat oelh pemain. • Pada level pertama “saya” melakukan maximize dan pada level kedua “lawan” melakukan minimize. • Kelemahan metoda MINIMAX adalah harus mengunjungi semua node yang ada sebelum memutuskan langkah yang diambil.

  12. << CLOSING >> Untuk memperbaiki kelemahan metoda MINIMAX digunakan -Cutoff atau -pruning End of Pertemuan 15 Good Luck

More Related