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.

Slides:



Advertisements
Similar presentations
Adversarial Search We have experience in search where we assume that we are the only intelligent being and we have explicit control over the “world”. Lets.
Advertisements

This lecture topic: Game-Playing & Adversarial Search
For Friday Finish chapter 5 Program 1, Milestone 1 due.
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2008.
Game Playing (Tic-Tac-Toe), ANDOR graph By Chinmaya, Hanoosh,Rajkumar.
1 CSC 550: Introduction to Artificial Intelligence Fall 2008 search in game playing  zero-sum games  game trees, minimax principle  alpha-beta pruning.
CS 484 – Artificial Intelligence
10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching.
GP Applications Two main areas of research Testing genetic programming in areas other techniques have been applied to. Applying genetic programming to.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
This time: Outline Game playing The minimax algorithm
Game Playing CSC361 AI CSC361: Game Playing.
Min-Max Trees Based on slides by: Rob Powers Ian Gent Yishay Mansour.
1 search CS 331/531 Dr M M Awais A* Examples:. 2 search CS 331/531 Dr M M Awais 8-Puzzle f(N) = g(N) + h(N)
Game-Playing Read Chapter 6 Adversarial Search. Game Types Two-person games vs multi-person –chess vs monopoly Perfect Information vs Imperfect –checkers.
1 Heuristic Search 4 4.0Introduction 4.1An Algorithm for Heuristic Search 4.2Admissibility, Monotonicity, and Informedness 4.3Using Heuristics in Games.
Find a Path s A D B E C F G Heuristically Informed Methods  Which node do I expand next?  What information can I use to guide this.
Applying Genetic Programming to Stratego Ryan Albarelli.
How computers play games with you CS161, Spring ‘03 Nathan Sturtevant.
ICS-271:Notes 6: 1 Notes 6: Game-Playing ICS 271 Fall 2006.
Backtracking. Introduction Systematic way to do an exhaustive search Take advantage of pruning when possible.
Game Tree Search based on Russ Greiner and Jean-Claude Latombe’s notes.
Adversarial Search: Game Playing Reading: Chess paper.
HEURISTIC SEARCH. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 Portion of the state space for tic-tac-toe.
Alpha-Beta Search. 2 Two-player games The object of a search is to find a path from the starting position to a goal position In a puzzle-type problem,
1 Heuristic Search 4 4.0Introduction 4.1An Algorithm for Heuristic Search 4.2Admissibility, Monotonicity, and Informedness 4.3Using Heuristics in Games.
Game-Playing Read Chapter 6 Adversarial Search. State-Space Model Modified States the same Operators depend on whose turn Goal: As before: win or win.
Game Playing: Adversarial Search Chapter 6. Why study games Fun Clear criteria for success Interesting, hard problems which require minimal “initial structure”
1 Adversary Search Ref: Chapter 5. 2 Games & A.I. Easy to measure success Easy to represent states Small number of operators Comparison against humans.
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
9.1. B OARD G AMES AND A IMING AI Common board game AI approaches and Aiming AI.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
Lecture 5 Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
Minimax.
Computer Implementation of Genetic Algorithm
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Game Playing. Introduction Why is game playing so interesting from an AI point of view? –Game Playing is harder then common searching The search space.
Game Playing.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Search CSE When you can’t use A* Hill-climbing Simulated Annealing Other strategies 2 person- games.
1 Computer Group Engineering Department University of Science and Culture S. H. Davarpanah
October 3, 2012Introduction to Artificial Intelligence Lecture 9: Two-Player Games 1 Iterative Deepening A* Algorithm A* has memory demands that increase.
Automatically Defined Functions Used to evolve modular programs Architecture implemented by Koza Architecture implemented by Bruce Function calls A critical.
Heuristic Search In addition to depth-first search, breadth-first search, bound depth-first search, and iterative deepening, we can also use informed or.
Traditional game playing 2 player adversarial (win => lose) based on search but... huge game trees can't be fully explored.
What is Genetic Programming? Genetic programming is a model of programming which uses the ideas (and some of the terminology) of biological evolution to.
Game-playing AIs Part 1 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part I (this set of slides)  Motivation  Game Trees  Evaluation.
For Wednesday Read Weiss, chapter 12, section 2 Homework: –Weiss, chapter 10, exercise 36 Program 5 due.
Game Playing. Towards Intelligence? Many researchers attacked “intelligent behavior” by looking to strategy games involving deep thought. Many researchers.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
Search exploring the consequences of possible actions.
Initial Population Generation Methods for population generation: Grow Full Ramped Half-and-Half Variety – Genetic Diversity.
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.
For Friday Finish chapter 6 Program 1, Milestone 1 due.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
Introduction Genetic programming falls into the category of evolutionary algorithms. Genetic algorithms vs. genetic programming. Concept developed by John.
George F Luger ARTIFICIAL INTELLIGENCE 5th edition Structures and Strategies for Complex Problem Solving HEURISTIC SEARCH Luger: Artificial Intelligence,
HEURISTIC SEARCH 4 4.0Introduction 4.1An Algorithm for Heuristic Search 4.2Admissibility, Monotonicity, and Informedness 4.3Using Heuristics in Games 4.4Complexity.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
The Standard Genetic Algorithm Start with a “population” of “individuals” Rank these individuals according to their “fitness” Select pairs of individuals.
Adversarial Search. Regular Tic Tac Toe Play a few games. –What is the expected outcome –What kinds of moves “guarantee” that?
Blocks World Problem. The CS Terminal Specifies the block at the top of the stack. Example CS evaluates to E Note: Evaluates to nil if the stack is empty.
Evolving Recursive Algorithms The SRF function Automatically defined recursions (ADRs) The recur operator Dealing with infinite and time-consuming recursions.
Chapter 5 Adversarial Search. 5.1 Games Why Study Game Playing? Games allow us to experiment with easier versions of real-world situations Hostile agents.
Adversarial Search and Game-Playing
Introduction Genetic programming falls into the category of evolutionary algorithms. Genetic algorithms vs. genetic programming. Concept developed by John.
Atacan KULLABCI Kubilay BEKTAŞ
NIM - a two person game n objects are in one pile
Pruned Search Strategies
Presentation transcript:

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: 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

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 = 34 – 5 = -1

Example: Minimax Algorithm

Game Tree

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

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

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?

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

Evolved Solution

Simplified Solution

Pursuer - Evader

Game Parameters The payoff for the pursuer is the time it takes to catch the evader. The payoff of the evader is the time it remains free. The information available at each stage of the game is the position of the pursuer and the evader. A game-playing strategy will specify the angle at which the pursuer must move in order to catch the evader.

Terminals and Functions T={ X, Y, R } X - x-coordinate of the position of the evader Y – Y-coordinate of the position of the evader R – ephemeral constant in the range [-1, 1] F={ +, -, /, EXP, IFLTZ} EXP – the exponential function IFLTZ – evaluates its first argument if its second argument is less than zero else it evaluates its third arguments

Evaluation This fitness cases consists of 20 different positions of the evader on the plane, i.e. a set of (X, Y) coordinate values. The raw fitness of an individual is average time required to catch the evader over the 20 fitness cases. An upper limit is set on the maximum time permitted. The hits ratio is the number of fitness cases for which this time limit is not exceeded.