1 / 15

# Game Playing

Game Playing. Evolve a strategy for two-person zero-sum games. Help the user to determine the next move. Constructing a game tree Each node represents a state in the game Each arc represents a legal move The minimax algorithm Alpha-beta pruning. Example: Minimax Algorithm. Game Tree:

Télécharger la présentation

## Game Playing

E N D

### Presentation Transcript

1. Game Playing • Evolve a strategy for two-person zero-sum games. • Help the user to determine the next move. • Constructing a game tree • Each node represents a state in the game • Each arc represents a legal move • The minimax algorithm • Alpha-beta pruning

2. Example: Minimax Algorithm • Game Tree: • We want to maximize player X’ score. • A value of 1 indicates a win for player X and a loss for player O. • A value of 0 indicates a win for player O and a loss for player X. 1 1 0 1 0 1 1

3. Heuristics • Not viable to generate the entire game tree. • Use of heuristics • Example : Tic-Tac-Toe • Number of possible wins for X minus number of possible wins for O. 8 – 5 = 3 4 – 5 = -1

4. Example: Minimax Algorithm 16 16 8 32 16 8 24

5. Game Tree

6. Operators • Terminals – Legal moves, i.e. left and right • Functions: CXM1, CXM2, COM1, COM2 • XM1: first move made by player X • XM2: second move made by player X • OM1: first move made by player O • OM2: second move made by player O

7. Fitness Cases • Consists of the possible combinations of L and R for the moves that O can make. • Format: XM1, OM1, XM2, OM2 LLLL LRRR LLLR LRRL

8. Evaluation • The raw fitness of an individual is the sum of the payoffs for each fitness case. • The hits ratio is the number of fitness cases for which the individual receives a payoff at least as good as the minimax strategy. • What is the raw fitness and hits ratio of the following individuals?

9. GP Parameters • Population size: 500 • Max. no. of Generations: 51 • Initial Population Generation:The ramped half-and-half method with an initial tree depth of six and a depth limit of seventeen on the size of trees created by the genetic operators. • Method of Selection: Fitness proportionate selection

10. Evolved Solution

11. Simplified Solution