example romania
play

Example: Romania On holiday in Romania; currently in Arad. Flight - PDF document

Example: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Problem solving and search be in Bucharest Formulate problem: states: various cities actions: drive between cities Chapter 3


  1. Example: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: Problem solving and search be in Bucharest Formulate problem: states: various cities actions: drive between cities Chapter 3 Find solution: sequence of cities, e.g., Arad, Sibiu, Fagaras, Bucharest Chapter 3 1 Chapter 3 4 Outline Example: Romania Oradea ♦ Problem-solving agents 71 Neamt 87 ♦ Problem types Zerind 151 75 Iasi ♦ Problem formulation Arad 140 92 Sibiu Fagaras ♦ Example problems 99 118 Vaslui 80 ♦ Basic search algorithms Rimnicu Vilcea Timisoara 142 211 111 Pitesti Lugoj 97 70 98 Hirsova 146 85 101 Mehadia Urziceni 86 75 138 Bucharest 120 Dobreta 90 Craiova Eforie Giurgiu Chapter 3 2 Chapter 3 5 Problem-solving agents Problem types Restricted form of general agent: Deterministic, fully observable = ⇒ single-state problem Agent knows exactly which state it will be in; solution is a sequence function Simple-Problem-Solving-Agent ( percept ) returns an action Non-observable = ⇒ conformant problem static : seq , an action sequence, initially empty Agent may have no idea where it is; solution (if any) is a sequence state , some description of the current world state goal , a goal, initially null Nondeterministic and/or partially observable = ⇒ contingency problem problem , a problem formulation percepts provide new information about current state state ← Update-State ( state, percept ) solution is a contingent plan or a policy if seq is empty then often interleave search, execution goal ← Formulate-Goal ( state ) problem ← Formulate-Problem ( state, goal ) Unknown state space = ⇒ exploration problem (“online”) seq ← Search ( problem ) action ← First ( seq ) seq ← Rest ( seq ) return action Note: this is offline problem solving; solution executed “eyes closed.” Online problem solving involves acting without complete knowledge. Chapter 3 3 Chapter 3 6

  2. Example: vacuum world Example: vacuum world Single-state, start in #5. Solution?? Single-state, start in #5. Solution?? 1 2 1 2 [ Right, Suck ] Conformant, start in { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 } 3 4 3 4 e.g., Right goes to { 2 , 4 , 6 , 8 } . Solution?? [ Right, Suck, Left, Suck ] 5 6 5 6 Contingency, start in #5 or #7 Murphy’s Law: Suck can dirty a clean carpet 7 8 7 8 Local sensing: dirt, location only. Solution?? [ Right, if dirt then Suck ] Chapter 3 7 Chapter 3 10 Example: vacuum world Single-state problem formulation A problem is defined by four items: Single-state, start in #5. Solution?? 1 2 [ Right, Suck ] initial state e.g., “at Arad” Conformant, start in { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 } 3 4 successor function S ( x ) = set of action–state pairs e.g., Right goes to { 2 , 4 , 6 , 8 } . Solution?? e.g., S ( Arad ) = {� Arad → Zerind, Zerind � , . . . } 5 6 goal test, can be explicit, e.g., x = “at Bucharest” 7 8 implicit, e.g., NoDirt ( x ) path cost (additive) e.g., sum of distances, number of actions executed, etc. c ( x, a, y ) is the step cost, assumed to be ≥ 0 A solution is a sequence of actions leading from the initial state to a goal state Chapter 3 8 Chapter 3 11 Example: vacuum world Selecting a state space Real world is absurdly complex Single-state, start in #5. Solution?? 1 2 ⇒ state space must be abstracted for problem solving [ Right, Suck ] Conformant, start in { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 } (Abstract) state = set of real states 3 4 e.g., Right goes to { 2 , 4 , 6 , 8 } . Solution?? (Abstract) action = complex combination of real actions [ Right, Suck, Left, Suck ] e.g., “Arad → Zerind” represents a complex set 5 6 Contingency, start in #5 or #7 of possible routes, detours, rest stops, etc. Murphy’s Law: Suck can dirty a clean carpet For guaranteed realizability, any real state “in Arad” 7 8 Local sensing: dirt, location only. must get to some real state “in Zerind” Solution?? (Abstract) solution = set of real paths that are solutions in the real world Each abstract action should be “easier” than the original problem! Chapter 3 9 Chapter 3 12

  3. Example: vacuum world state space graph Example: vacuum world state space graph R R L R L R L L S S S S R R R R L R L R L R L R L L L L S S S S S S S S R R L R L R L L S S S S states?? states??: integer dirt and robot locations (ignore dirt amounts etc.) actions?? actions??: Left , Right , Suck , NoOp goal test?? goal test??: no dirt path cost?? path cost?? Chapter 3 13 Chapter 3 16 Example: vacuum world state space graph Example: vacuum world state space graph R R L R L R L L S S S S R R R R L R L R L R L R L L L L S S S S S S S S R R L R L R L L S S S S states??: integer dirt and robot locations (ignore dirt amounts etc.) states??: integer dirt and robot locations (ignore dirt amounts etc.) actions?? actions??: Left , Right , Suck , NoOp goal test?? goal test??: no dirt path cost?? path cost??: 1 per action (0 for NoOp ) Chapter 3 14 Chapter 3 17 Example: vacuum world state space graph Example: The 8-puzzle R L R 7 2 4 1 5 2 3 L S S 5 6 4 5 6 R R L R L R L L 8 3 1 7 8 S S S S R Start State Goal State L R L states?? S S actions?? states??: integer dirt and robot locations (ignore dirt amounts etc.) goal test?? actions??: Left , Right , Suck , NoOp path cost?? goal test?? path cost?? Chapter 3 15 Chapter 3 18

  4. Example: The 8-puzzle Example: The 8-puzzle 7 2 4 5 1 2 3 7 2 4 1 5 2 3 5 6 4 5 6 5 6 4 5 6 8 3 1 7 8 8 3 1 7 8 Start State Goal State Start State Goal State states??: integer locations of tiles (ignore intermediate positions) states??: integer locations of tiles (ignore intermediate positions) actions?? actions??: move blank left, right, up, down (ignore unjamming etc.) goal test?? goal test??: = goal state (given) path cost?? path cost??: 1 per move [Note: optimal solution of n -Puzzle family is NP-hard] Chapter 3 19 Chapter 3 22 Example: The 8-puzzle Example: robotic assembly P 7 2 4 1 5 2 3 R R R R 5 6 4 5 6 R 8 3 1 7 8 Start State Goal State states??: states??: integer locations of tiles (ignore intermediate positions) actions??: move blank left, right, up, down (ignore unjamming etc.) goal test?? path cost?? Chapter 3 20 Chapter 3 23 Example: The 8-puzzle Example: robotic assembly P 7 2 4 5 1 2 3 R R R R 5 6 4 5 6 R 8 3 1 7 8 Start State Goal State states??: real-valued coordinates of robot joint angles states??: integer locations of tiles (ignore intermediate positions) parts of the object to be assembled actions??: move blank left, right, up, down (ignore unjamming etc.) goal test??: = goal state (given) actions??: path cost?? Chapter 3 21 Chapter 3 24

  5. Example: robotic assembly Tree search algorithms P R R Basic idea: offline, simulated exploration of state space R R by generating successors of already-explored states (a.k.a. expanding states) R function Tree-Search ( problem, strategy ) returns a solution, or failure initialize the search tree using the initial state of problem loop do states??: real-valued coordinates of robot joint angles if there are no candidates for expansion then return failure parts of the object to be assembled choose a leaf node for expansion according to strategy if the node contains a goal state then return the corresponding solution actions??: continuous motions of robot joints else expand the node and add the resulting nodes to the search tree end goal test??: Chapter 3 25 Chapter 3 28 Example: robotic assembly Tree search example P R R Arad R R Sibiu Timisoara Zerind R Arad Fagaras Oradea Arad Lugoj Arad Oradea Rimnicu Vilcea states??: real-valued coordinates of robot joint angles parts of the object to be assembled actions??: continuous motions of robot joints goal test??: complete assembly with no robot included! path cost??: Chapter 3 26 Chapter 3 29 Example: robotic assembly Tree search example P R R Arad R R Sibiu Timisoara Zerind R Arad Fagaras Oradea Arad Lugoj Arad Oradea Rimnicu Vilcea states??: real-valued coordinates of robot joint angles parts of the object to be assembled actions??: continuous motions of robot joints goal test??: complete assembly with no robot included! path cost??: time to execute Chapter 3 27 Chapter 3 30

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend