For Friday Finish reading chapter 7 Homework: –Chapter 6, exercises 1 (all) and 3 (a-c only)

Slides:



Advertisements
Similar presentations
Adversarial Search Chapter 6 Sections 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
Advertisements

Adversarial Search Chapter 6 Section 1 – 4. Types of Games.
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.
Adversarial Search Reference: “Artificial Intelligence: A Modern Approach, 3 rd ed” (Russell and Norvig)
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
For Friday Finish chapter 5 Program 1, Milestone 1 due.
February 7, 2006AI: Chapter 6: Adversarial Search1 Artificial Intelligence Chapter 6: Adversarial Search Michael Scherger Department of Computer Science.
Games & Adversarial Search
For Monday Read chapter 7, sections 1-4 Homework: –Chapter 4, exercise 1 –Chapter 5, exercise 9.
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
CS 484 – Artificial Intelligence
Adversarial Search Chapter 6 Section 1 – 4.
Adversarial Search Chapter 5.
COMP-4640: Intelligent & Interactive Systems Game Playing A game can be formally defined as a search problem with: -An initial state -a set of operators.
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.
Adversarial Search CSE 473 University of Washington.
1 Adversarial Search Chapter 6 Section 1 – 4 The Master vs Machine: A Video.
10/19/2004TCSS435A Isabelle Bichindaritz1 Game and Tree Searching.
Games CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Minimax and Alpha-Beta Reduction Borrows from Spring 2006 CS 440 Lecture Slides.
Lecture 13 Last time: Games, minimax, alpha-beta Today: Finish off games, summary.
Artificial Intelligence in Game Design
This time: Outline Game playing The minimax algorithm
1 Game Playing Chapter 6 Additional references for the slides: Luger’s AI book (2005). Robert Wilensky’s CS188 slides:
Class Project Due at end of finals week Essentially anything you want, so long as its AI related and I approve Any programming language you want In pairs.
Game Playing CSC361 AI CSC361: Game Playing.
Games and adversarial search
Games & Adversarial Search Chapter 6 Section 1 – 4.
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.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
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.
Lecture 6: Game Playing Heshaam Faili University of Tehran Two-player games Minmax search algorithm Alpha-Beta pruning Games with chance.
Game Playing.
Games CPS 170 Ron Parr. Why Study Games? Many human activities can be modeled as games –Negotiations –Bidding –TCP/IP –Military confrontations –Pursuit/Evasion.
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.
Chapter 6 Adversarial Search. Adversarial Search Problem Initial State Initial State Successor Function Successor Function Terminal Test Terminal Test.
Adversarial Search Chapter 6 Section 1 – 4. Outline Optimal decisions α-β pruning Imperfect, real-time decisions.
For Wednesday Read Weiss, chapter 12, section 2 Homework: –Weiss, chapter 10, exercise 36 Program 5 due.
Introduction to Artificial Intelligence CS 438 Spring 2008 Today –AIMA, Ch. 6 –Adversarial Search Thursday –AIMA, Ch. 6 –More Adversarial Search The “Luke.
Class Project Due at end of finals week Essentially anything you want, so long as its AI related and I approve Any programming language you want In pairs.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
1 Adversarial Search CS 171/271 (Chapter 6) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Games 1 Alpha-Beta Example [-∞, +∞] Range of possible values Do DF-search until first leaf.
For Wednesday Read chapter 7, sections 1-4 Homework: –Chapter 6, exercise 1.
Quiz 4 : Minimax Minimax is a paranoid algorithm. True
CSCI 4310 Lecture 6: Adversarial Tree Search. Book Winston Chapter 6.
For Friday Finish chapter 6 Program 1, Milestone 1 due.
For Friday Read chapter 8 Homework: –Chapter 7, exercise 1.
Adversarial Search Chapter Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent reply Time limits.
Game Playing Revision Mini-Max search Alpha-Beta pruning General concerns on games.
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.
Game Playing: Adversarial Search chapter 5. Game Playing: Adversarial Search  Introduction  So far, in problem solving, single agent search  The machine.
1 UNIT-3 KNOWLEDGE REPRESENTATION. 2 Agents that reason logically(Logical agents) A Knowledge based Agent The Wumpus world environment Representation,
Adversarial Search 2 (Game Playing)
Adversarial Search and Game Playing Russell and Norvig: Chapter 6 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2004/home.htm Prof: Dekang.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
Artificial Intelligence in Game Design Board Games and the MinMax Algorithm.
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.
Last time: search strategies
PENGANTAR INTELIJENSIA BUATAN (64A614)
Games & Adversarial Search
Adversarial Search CMPT 420 / CMPG 720.
Presentation transcript:

For Friday Finish reading chapter 7 Homework: –Chapter 6, exercises 1 (all) and 3 (a-c only)

Program 1 Any questions?

Genetic Algorithms Have a population of k states (or individuals) Have a fitness function that evaluates the states Create new individuals by randomly selecting pairs and mating them using a randomly selected crossover point. More fit individuals are selected with higher probability. Apply random mutation. Keep top k individuals for next generation.

Other Issues What issues arise from continuous spaces? What issues do online search and unknown environments create?

Game Playing in AI Long history Games are well-defined problems usually considered to require intelligence to play well Introduces uncertainty (can’t know opponent’s moves in advance)

Games and Search Search spaces can be very large: Chess –Branching factor: 35 –Depth: 50 moves per player –Search tree: nodes (~10 40 legal positions) Humans don’t seem to do much explicit search Good test domain for search methods and pruning methods

Game Playing Problem Instance of general search problem States where game has ended are terminal states A utility function (or payoff function) determines the value of the terminal states In 2 player games, MAX tries to maximize the payoff and MIN is tries to minimize the payoff In the search tree, the first layer is a move by MAX and the next a move by MIN, etc. Each layer is called a ply

Minimax Algorithm Method for determining the optimal move Generate the entire search tree Compute the utility of each node moving upward in the tree as follows: –At each MAX node, pick the move with maximum utility –At each MIN node, pick the move with minimum utility (assume opponent plays optimally) –At the root, the optimal move is determined

Recursive Minimax Algorithm function Minimax-Decision(game) returns an operator for each op in Operators[game] do Value[op] <- Mimimax-Value(Apply(op, game),game) end return the op with the highest Value[op] function Minimax-Value(state,game) returns a utility value if Terminal-Test[game](state) then return Utility[game](state) else if MAX is to move in state then return highest Minimax-Value of Successors(state) else return lowest Minimax-Value of Successors(state)

Making Imperfect Decisions Generating the complete game tree is intractable for most games Alternative: –Cut off search –Apply some heuristic evaluation function to determine the quality of the nodes at the cutoff

Evaluation Functions Evaluation function needs to –Agree with the utility function on terminal states –Be quick to evaluate –Accurately reflect chances of winning Example: material value of chess pieces Evaluation functions are usually weighted linear functions

Cutting Off Search Search to uniform depth Use iterative deepening to search as deep as time allows (anytime algorithm) Issues –quiescence needed –horizon problem

Alpha-Beta Pruning Concept: Avoid looking at subtrees that won’t affect the outcome Once a subtree is known to be worse than the current best option, don’t consider it further

General Principle If a node has value n, but the player considering moving to that node has a better choice either at the node’s parent or at some higher node in the tree, that node will never be chosen. Keep track of MAX’s best choice (  ) and MIN’s best choice (  ) and prune any subtree as soon as it is known to be worse than the current  or  value

function Max-Value (state, game, ,  ) returns the minimax value of state if Cutoff-Test(state) then return Eval(state) for each s in Successors(state) do  <- Max( , Min-Value(s, game, ,  )) if  >=  then return  end return  function Min-Value(state, game, ,  ) returns the minimax value of state if Cutoff-Test(state) then return Eval(state) for each s in Successors(state) do  <- Min( ,Max-Value(s, game, ,  )) if  <=  then return  end return 

Effectiveness Depends on the order in which siblings are considered Optimal ordering would reduce nodes considered from O(b d ) to O(b d/2 )--but that requires perfect knowledge Simple ordering heuristics can help quite a bit

Chance What if we don’t know what the options are? Expectiminimax uses the expected value for any node where chance is involved. Pruning with chance is more difficult. Why?

Imperfect Knowledge What issues arise when we don’t know everything (as in standard card games)?

State of the Art Chess – Deep Blue and Fritz Checkers – Chinook Othello – Logistello Backgammon – TD-Gammon (learning) Go – Computers are very bad Bridge

What about the games we play?

Knowledge Knowledge Base –Inference mechanism (domain-independent) –Information (domain-dependent) Knowledge Representation Language –Sentences (which are not quite like English sentence) –The KRL determine what the agent can “know” –It also affects what kind of reasoning is possible Tell and Ask

Getting Knowledge We can TELL the agent everything it needs to know We can create an agent that can “learn” new information to store in its knowledge base

The Wumpus World Simple computer game Good testbed for an agent A world in which an agent with knowledge should be able to perform well World has a single wumpus which cannot move, pits, and gold

Wumpus Percepts The wumpus’s square and squares adjacent to it smell bad. Squares adjacent to a pit are breezy. When standing in a square with gold, the agent will perceive a glitter. The agent can hear a scream when the wumpus dies from anywhere The agent will perceive a bump if it walks into a wall. The agent doesn’t know where it is.

Wumpus Actions Go forward Turn left Turn right Grab (picks up gold in that square) Shoot (fires an arrow forward--only once) –If the wumpus is in front of the agent, it dies. Climb (leave the cavern--only good at the start square)

Consequences Entering a square containing a live wumpus is deadly Entering a square containing a pit is deadly Getting out of the cave with the gold is worth 1,000 points. Getting killed costs 10,000 points Each action costs 1 point

Possible Wumpus Environment

Knowledge Representation Two sets of rules: –Syntax: determines what atomic symbols exist in the language and how to combine them into sentences –Semantics: Relationship between the sentences and “the world”--needed to determine truth or falsehood of the sentences