Games: Expectimax Andrea Danyluk September 25, 2013.

Slides:



Advertisements
Similar presentations
Adversarial Search Reference: “Artificial Intelligence: A Modern Approach, 3 rd ed” (Russell and Norvig)
Advertisements

Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
This lecture topic: Game-Playing & Adversarial Search
For Friday Finish chapter 5 Program 1, Milestone 1 due.
Games & Adversarial Search
For Monday Read chapter 7, sections 1-4 Homework: –Chapter 4, exercise 1 –Chapter 5, exercise 9.
CS 484 – Artificial Intelligence
Adversarial Search Chapter 5.
1 Game Playing. 2 Outline Perfect Play Resource Limits Alpha-Beta pruning Games of Chance.
Lecture 12 Last time: CSPs, backtracking, forward checking Today: Game Playing.
Advanced Artificial Intelligence
Adversarial Search 對抗搜尋. Outline  Optimal decisions  α-β pruning  Imperfect, real-time decisions.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
This time: Outline Game playing The minimax algorithm
CS 561, Sessions Administrativia Assignment 1 due tuesday 9/24/2002 BEFORE midnight Midterm exam 10/10/2002.
1 Game Playing Chapter 6 Additional references for the slides: Luger’s AI book (2005). Robert Wilensky’s CS188 slides:
CS 561, Sessions Last time: search strategies Uninformed: Use only information available in the problem formulation Breadth-first Uniform-cost Depth-first.
Game Playing CSC361 AI CSC361: Game Playing.
1 DCP 1172 Introduction to Artificial Intelligence Lecture notes for Chap. 6 [AIMA] Chang-Sheng Chen.
CS 460, Sessions Last time: search strategies Uninformed: Use only information available in the problem formulation Breadth-first Uniform-cost Depth-first.
Game Tree Search based on Russ Greiner and Jean-Claude Latombe’s notes.
Adversarial Search: Game Playing Reading: Chess paper.
Games & Adversarial Search Chapter 6 Section 1 – 4.
CSE 473: Artificial Intelligence Spring 2012
CSE 473: Artificial Intelligence Autumn 2011 Adversarial Search Luke Zettlemoyer Based on slides from Dan Klein Many slides over the course adapted from.
CSE 573: Artificial Intelligence Autumn 2012
Game Playing State-of-the-Art  Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in Used an endgame database defining.
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
Notes adapted from lecture notes for CMSC 421 by B.J. Dorr
Adversarial Search Chapter 5 Adapted from Tom Lenaerts’ lecture notes.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
AD FOR GAMES Lecture 4. M INIMAX AND A LPHA -B ETA R EDUCTION Borrows from Spring 2006 CS 440 Lecture Slides.
Games CPS 170 Ron Parr. Why Study Games? Many human activities can be modeled as games –Negotiations –Bidding –TCP/IP –Military confrontations –Pursuit/Evasion.
Chapter 6 Adversarial Search. Adversarial Search Problem Initial State Initial State Successor Function Successor Function Terminal Test Terminal Test.
Adversarial Search CS311 David Kauchak Spring 2013 Some material borrowed from : Sara Owsley Sood and others.
Adversarial Search. Game playing Perfect play The minimax algorithm alpha-beta pruning Resource limitations Elements of chance Imperfect information.
Adversarial Search Chapter 6 Section 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
1 Adversarial Search CS 171/271 (Chapter 6) Some text and images in these slides were drawn from Russel & Norvig’s published material.
For Wednesday Read chapter 7, sections 1-4 Homework: –Chapter 6, exercise 1.
Quiz 4 : Minimax Minimax is a paranoid algorithm. True
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
CSE373: Data Structures & Algorithms Lecture 23: Intro to Artificial Intelligence and Game Theory Based on slides adapted Luke Zettlemoyer, Dan Klein,
CS 188: Artificial Intelligence Fall 2008 Lecture 7: Expectimax Search 9/18/2008 Dan Klein – UC Berkeley Many slides over the course adapted from either.
For Monday Read chapter 7, sections 1-4 Homework: –Chapter 4, exercise 1 –Chapter 5, exercise 9.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Game-playing AIs Part 2 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part II  The Minimax Rule  Alpha-Beta Pruning  Game-playing.
CMSC 421: Intro to Artificial Intelligence October 6, 2003 Lecture 7: Games Professor: Bonnie J. Dorr TA: Nate Waisbrot.
Adversarial Search Chapter 6 Section 1 – 4. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time.
AIMA Code: Adversarial Search CSE-391: Artificial Intelligence University of Pennsylvania Matt Huenerfauth February 2005.
Games: Efficiency Andrea Danyluk September 23, 2013.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
Adversarial Search Chapter 5 Sections 1 – 4. AI & Expert Systems© Dr. Khalid Kaabneh, AAU Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
ADVERSARIAL SEARCH Chapter 6 Section 1 – 4. OUTLINE Optimal decisions α-β pruning Imperfect, real-time decisions.
Adversarial Search CMPT 463. When: Tuesday, April 5 3:30PM Where: RLC 105 Team based: one, two or three people per team Languages: Python, C++ and Java.
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.
Games: Expectimax MAX MIN MAX Prune if α ≥ β. Games: Expectimax MAX MIN MAX
Announcements Homework 1 Full assignment posted..
Last time: search strategies
CS 460 Spring 2011 Lecture 4.
Expectimax Lirong Xia. Expectimax Lirong Xia Project 2 MAX player: Pacman Question 1-3: Multiple MIN players: ghosts Extend classical minimax search.
Game playing.
Lecture 1C: Adversarial Search(Game)
CSE 473: Artificial Intelligence Fall 2014
Expectimax Lirong Xia.
CSE 473: Artificial Intelligence Spring 2012
Minimax strategies, alpha beta pruning
Game Playing Fifth Lecture 2019/4/11.
Warm Up How would you search for moves in Tic Tac Toe?
Minimax strategies, alpha beta pruning
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

Games: Expectimax Andrea Danyluk September 25, 2013

Announcements Programming Assignment 2: Games – Anyone still looking for a partner? – Partner can’t be the same as for Assignment 1

Today’s Lecture Just a bit more on α-β pruning Games with more than 2 players Expectimax Pacman

α = 8 Β = +inf α = 8 Β = +inf 8 Is there a problem here???

function αβSEARCH(state) returns an action a v = MAX-VALUE(state, -infinity, +infinity) return action a in ACTIONS(state) with value v function MAX-VALUE(state, α, β) returns a utility value v if TERMINAL-TEST(state) then return UTILITY(state) v = -infinity for each a in ACTIONS(state) do v = MAX(v, MIN-VALUE(RESULT(state, a), α, β)) if v ≥ β then return v α = MAX(α, v) return v function MIN-VALUE(state, α, β) returns a utility value v if TERMINAL-TEST(state) then return UTILITY(state) v = infinity for each a in ACTIONS(state) do v = MIN(v, MAX-VALUE(RESULT(state, a), α, β)) if v ≤ α then return v β = MIN(β, v) return v

Node Order Matters B B D D C C A A MAX min Best ordering for maximum pruning?

Move Ordering Can we order moves in such a way that α-β will prune more rather than less? Chess? Connect 4? Don’t worry about this for Pacman assignment

Properties of α-β Pruning does not affect the final result (but be careful) Good move ordering improves effectiveness of pruning If search depth is d, what is the time complexity of minimax? – O(b d ) With perfect pruning, get down to O(b d/2 ) – Doubles solvable depth [Adapted from Russell]

Games with > 2 players Up to 4 players Player tries to place all 21 of his/her pieces Hopes to block opponents from placing their pieces

A Four-Player Game Blue to move Yellow to move Red Green … … … ………… (5,7,2,9)(4,3,1,1)(2,6,10,2)(6,4,19,8) (5,7,2,9)(3,5,1,8)(8,7,6,5)(9,7,1,3)(4,3,2,1)(4,4,4,4)(6,4,19,8)(3,5,7,9) (5,7,2,9)(8,7,6,5)(4,4,4,4)(6,4,19,8) (5,7,2,9)(4,4,4,4) (5,7,2,9)

Multi-Player Games Evaluation function returns a vector of utilities Each player chooses the move that maximizes its utility. Is Pacman with 2 ghosts a multi-player game?

Stochastic Games

Expectimax Introduce chance nodes into a minimax tree

Expectimax Introduce chance nodes into a minimax tree

Expectimax Introduce chance nodes into a minimax tree 0.5

Expectimax Introduce chance nodes into a minimax tree

Expectimax Introduce chance nodes into a minimax tree

Expectimax Introduce chance nodes into a minimax tree

Expectimax Introduce chance nodes into a minimax tree

Expectimax Introduce chance nodes into a minimax tree

Expectimax Introduce chance nodes into a minimax tree

Expectimax Introduce chance nodes into a minimax tree

Expectimax Introduce chance nodes into a minimax tree

Expectimax Introduce chance nodes into a minimax tree

Expectimax Introduce chance nodes into a minimax tree [From Russell]

Expectimax …

Evaluation Functions Revisited Behavior is preserved under any monotonic transformation of EVAL [From Russell]

Evaluation Functions Revisited Behavior is preserved only under positive linear transformation of EVAL [From Russell]

Expectimax Pacman def value(s) if s is a max node return maxValue(s) if s is an exp node return expValue(s) if s is a terminal node return eval(s) def maxValue(s) values = [value(s 1 ) for s 1 in succ(s)] return max(values) def expValue(s) values = [value(s 1 ) for s 1 in succ(s)] weights = [prob(s,s 1 ) for s 1 in succ(s)] return expectation(values, weights) [Verbatim from CS 188]

Depth-limited Expectimax ply Don’t forget: Magnitudes of the utilities / heuristic evaluations need to be meaningful.

Why Pacman Can Starve He knows his score can go up by eating now. He knows his score can go up by eating later. Within this search window there are no other eating opportunities.