1 / 10

Game Playing

Game Playing. Introduction. One of the earliest areas in artificial intelligence is game playing. Two-person zero-sum game. Games for which the state space is small enough – generate the entire space. Games for which the entire space cannot be generated. The Game NIM. 7. 6-1. 5-2. 4-3.

macon
Télécharger la présentation

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. Game Playing

  2. Introduction • One of the earliest areas in artificial intelligence is game playing. • Two-person zero-sum game. • Games for which the state space is small enough – generate the entire space. • Games for which the entire space cannot be generated.

  3. The Game NIM 7 6-1 5-2 4-3 5-1-1 4-2-1 3-2-2 3-3-1 4-1-1-1 3-2-1-1 2-2-2-1 3-1-1-1 2-2-1-1 2-1-1-1-1-1

  4. NIM- MAX Plays First MAX 7 MIN 6-1 5-2 4-3 MAX 5-1-1 4-2-1 3-2-2 3-3-1 MIN 4-1-1-1 3-2-1-1 2-2-2-1 1 . MAX 3-1-1-1 2-2-1-1 0 2-1-1-1-1-1 1 MIN

  5. NIM- MIN Plays First MIN 7 MAX 6-1 5-2 4-3 MIN 5-1-1 4-2-1 3-2-2 3-3-1 MAX 4-1-1-1 3-2-1-1 2-2-2-1 0 . MIN 3-1-1-1 2-2-1-1 1 MAX 2-1-1-1-1-1 0

  6. Minimax Algorithm Repeat • If the limit of search has been reached, compute the static value of the current position relative to the appropriate player. Report the result. • Otherwise, if the level is a minimizing level, use the minimax on the children of the current position. Report the minimum value of the results. • Otherwise, if the level is a maximizing level, use the minimax on the children of the current position. Report the maximum of the results. Until the entire tree is traversed .

  7. Minimax Applied to NIM MIN 0 7 MAX 1 6-1 0 5-2 0 4-3 0 MIN 5-1-1 0 4-2-1 0 3-2-2 3-3-1 0 MAX 4-1-1-1 1 3-2-1-1 0 2-2-2-1 0 . 0 MIN 3-1-1-1 1 2-2-1-1 MAX 2-1-1-1-1-1 0

  8. Generating the Game Tree to a Depth • In some cases the game tree will be too large to generate. • In this case the tree is generated to a certain depth or ply. • Heuristic values are used to estimate how promising a node is. • Horizon effect .

  9. Example

  10. Heuristic for Tic-Tac-Toe • h(n) = x(n) - o(n) where • x(n) is the total of MAX’s possible winning (we assume MAX is playing x) • o(n) is the total of the opponent’s, i.e. MIN’s winning lines • h(n) is the total evaluation for a state n.

More Related