450 likes | 543 Views
ARTIFICIAL INTELLIGENCE: THE MAIN IDEAS. OLLI COURSE SCI 102 Tuesdays, 11:00 a.m. – 12:30 p.m. Winter Quarter, 2013 Higher Education Center, Medford Room 226. Nils J. Nilsson. nilsson@cs.stanford.edu http:// ai.stanford.edu/~nilsson /. Course Web Page: www.sci102.com/.
E N D
ARTIFICIAL INTELLIGENCE:THE MAIN IDEAS OLLI COURSE SCI 102 Tuesdays, 11:00 a.m. – 12:30 p.m. Winter Quarter, 2013 Higher Education Center, Medford Room 226 Nils J. Nilsson nilsson@cs.stanford.edu http://ai.stanford.edu/~nilsson/ Course Web Page: www.sci102.com/ For Information about parking near the HEC, go to: http://www.ci.medford.or.us/page.asp?navid=2117 There are links on that page to parking rules and maps
AI Planning MOOC http://www.coursera.org/course/aiplan
Action Selection Adding a Planner to The Model of an Agent Perception Memory Planner
On The Importance of Planning “[the ant] knew that a certain arrangement had to be made, but it could not figure how to make it. It was like a man with a tea-cup in one hand and a sandwich in the other, who wants to light a cigarette with a match. But, where the man would invent the idea of putting down the cup and sandwich---before picking up the cigarette and the match--- T. H. White, The Once and Future King
---this ant would have put down the sandwich and picked up the match, then it would have been down with the match and up with the cigarette, then down with the cigarette and up with the sandwich, then down with the cup and up with the cigarette, until finally it had put down the sandwich and picked up the match. It was inclined to rely on a series of accidents to achieve its object. T. H. White, The Once and Future King
“Those who will not reason, perish in the act. Those who will not act, perish for that reason.” ― W.H. Auden
What an Agent Needs in Order to Make a Plan 1. What state am I in now? 2. What state do I want to be in? Once I am in a state, and take an action I can take in that state, in which state will I end up?
The States and the Actions that Link Them Comprise a “Graph” A map is an example of a graph A “node” in the graph An “action link” in the graph
A Map is an “Explicit Graph” All the nodes and links are right there in the map
There Are Also “Implicit Graphs” The nodes and links aren’t known until we begin a search
An Example: The “8-Puzzle” 2 3 2 2 3 3 1 5 1 4 5 5 1 4 4 6 8 7 6 6 8 8 7 7 1
Another Example of an Implicit Graph All Possible Boards in Chess, Given the Initial Board and the Legal Moves of Chess
Components of an Implicit Graph Sj Possible Actions “Successor” States (Nodes) Si Sk Sl A Possible State (Node)
Planning Can Be Accomplished by “Searching” a Graph Whether Explicit or Implicit, we begin at a “start node,” visit the adjacent nodes, and continue until we reach a node corresponding to our goal
Example of Search: Internet Routing An Explicit Graph
Finding a Path From Palo Alto to Pittsburgh 1 hop 2 hops 3 hops Path Found!
The 8-Puzzle Again 3 1 2 2 3 8 4 5 1 4 6 7 5 6 8 7 0 2 3 1 4 5 8 7 6 Represent states by an array of numbers: START GOAL Successor states: exchange 0 with an adjacent number in array 1 2 3 8 0 4 7 6 5 Goal is this array:
Start and Goal States forThe 8-Puzzle The START State 1 2 3 8 0 4 7 6 5 The GOAL State The following sequence of slides was generated from an applet at: www.cs.rmit.edu.au/AI-Search/Product/
“Breadth-First” Search START slide 1 up slide 2 to left 1 2 3 8 0 4 7 6 5 Compare with GOAL
Heuristics (That Is, “Good Guesses”)Make the Search Process More Efficient Because They Are Only Guesses, They Aren’t Guaranteed To Be Accurate
Using Heuristic Search (A*) on the 8-Puzzle The START State 1 2 3 8 0 4 7 6 5 The GOAL State
Evaluating States in A* sequence number generate successor states number of tiles out of place (a rough “heuristic” estimate of number of moves left) + number of moves made so far 1 2 3 8 0 4 7 6 5 value = 6
A* “Open” Nodes Best Open Node number of tiles out of place (a rough “heuristic” estimate of number of moves left) + number of moves made so far 1 2 3 8 0 4 7 6 5 value = 6
A* (Next) Open Nodes BestOpen Node value = 6 1 2 3 8 0 4 7 6 5
A* (Next) Open Nodes Best Open Node value = 6 1 2 3 8 0 4 7 6 5
A* (Next) Open Nodes Open Node Best Open Node 1 2 3 8 0 4 7 6 5 value = 6
A* (Next) Open Nodes Open Node Best Open Node 1 2 3 8 0 4 7 6 5 value = 6
A* (Final) Open Nodes Open Nodes Best Open Node 1 2 3 8 0 4 7 6 5 value = 6 GOAL!
History of A* Shakey the Robot (around 1968) Shakey’sMap
Some Applications of A*(and its descendants) Route Finding in Maps (Google, Bing, MapQuest, …) Electronic Games (NPC Navigation) Language Analysis (Parsing Sentences) Navigation on Mars
Planning When States Are Represented by Lists of Statements Example: Toy Blocks State Description in English and in “Computerese”: B is on the Floor On(B,Fl) A is on C On(A,C) C is on the floor On(C,Fl) B is open Open(B) A is open Open(A) The floor is open Open(Fl) A C B
Describing Effects of Actions Action Description in English and in “Computerese”: Moving a block, x, from one place, y, to another place, z move(x,y,z) (A “schema” --- x, y, z are “variables”) Preconditions: On(x,y), Open(x), Open(z) Delete List: On(x,y), Open(z) Add list: On(x,z), Open(y), Open(Fl) One of three possible actions here: x = A, y = C, z = B (Instantiating the schema --- A, C, and B are “constants”) A B C
Example Action and its Effects One (of three) possible actions here: move(A,C,B) Preconditions: On(A,C), Open(A), Open(B) Delete List: On(A,C), Open(B) Add list: On(A,B), Open(C), Open(Fl) On(A,C) Open(B) Open(A) On(C,Fl) On(B,Fl) Open(Fl) Open(A) On(C,Fl) On(B,Fl) Open(Fl) On(A,B) Open(C) A A move(A,C,B) B B C C
A Possible Goal State On(A,B), On(B,C),On(C,Fl) A B A C B C What Actions Will Achieve the Goal?
Two Technical Problems 1. The Qualification Problem 2. The Side-Effect Problem
The Qualification Problem move(x,y,z) Preconditions: On(x,y), Open(x), Open(z) Delete List: On(x,y), Open(z) Add list: On(x,z), Open(y), Open(Fl) A B C What about unexpected, anomalous preconditions?
The Side-Effect Problem move(x,y,z) Preconditions: On(x,y), Open(x), Open(z) Delete List: On(x,y), Open(z) Add list: On(x,z), Open(y), Open(Fl) A B C Mention These in Delete and Add Lists
This Style of Planning Was First Proposed in a System Called STRIPS Used by Shakey the Robot to Make Plans (1971)
Applications of STRIPS-Style Planners Scheduling (e.g., for Hubble Space Telescope) Mission Planning (Defense and Space) Assembly Planning Logistics Planning Actions for Non-Player Characters in Electronic Games