agents that plan reflex agents
play

Agents that Plan Reflex Agents Reflex agents: Choose - PowerPoint PPT Presentation

Today CS 232: Ar)ficial Intelligence Search Agents that Plan Ahead September 3 rd , 2015 Search Problems Uninformed Search Methods


  1. Today ¡ CS ¡232: ¡Ar)ficial ¡Intelligence ¡ ¡ Search ¡ § Agents ¡that ¡Plan ¡Ahead ¡ September ¡3 rd , ¡2015 ¡ § Search ¡Problems ¡ § Uninformed ¡Search ¡Methods ¡ § Depth-­‑First ¡Search ¡ § Breadth-­‑First ¡Search ¡ § Uniform-­‑Cost ¡Search ¡ [These ¡slides ¡were ¡created ¡by ¡Dan ¡Klein ¡and ¡Pieter ¡Abbeel ¡for ¡CS188 ¡Intro ¡to ¡AI ¡at ¡UC ¡Berkeley. ¡ ¡All ¡CS188 ¡materials ¡are ¡available ¡at ¡hMp://ai.berkeley.edu.] ¡ Agents ¡that ¡Plan ¡ Reflex ¡Agents ¡ § Reflex ¡agents: ¡ § Choose ¡ac)on ¡based ¡on ¡current ¡percept ¡(and ¡ maybe ¡memory) ¡ § May ¡have ¡memory ¡or ¡a ¡model ¡of ¡the ¡world’s ¡ current ¡state ¡ § Do ¡not ¡consider ¡the ¡future ¡consequences ¡of ¡ their ¡ac)ons ¡ § Consider ¡how ¡the ¡world ¡IS ¡ § Can ¡a ¡reflex ¡agent ¡be ¡ra)onal? ¡ [Demo: ¡reflex ¡op)mal ¡(L2D1)] ¡ [Demo: ¡reflex ¡op)mal ¡(L2D2)] ¡ 1

  2. Video ¡of ¡Demo ¡Reflex ¡Op)mal ¡ Video ¡of ¡Demo ¡Reflex ¡Odd ¡ ¡ Planning ¡Agents ¡ Search ¡Problems ¡ § Planning ¡agents: ¡ § Ask ¡“what ¡if” ¡ § Decisions ¡based ¡on ¡(hypothesized) ¡ consequences ¡of ¡ac)ons ¡ § Must ¡have ¡a ¡model ¡of ¡how ¡the ¡world ¡evolves ¡in ¡ response ¡to ¡ac)ons ¡ § Must ¡formulate ¡a ¡goal ¡(test) ¡ § Consider ¡how ¡the ¡world ¡WOULD ¡BE ¡if ¡a ¡certain ¡ ac)on ¡is ¡performed ¡ § Op)mal ¡vs. ¡complete ¡planning ¡ ¡ § Op)mal: ¡find ¡the ¡best ¡solu)on ¡ § Complete ¡planning: ¡finds ¡a ¡solu)on ¡ § Planning ¡vs. ¡replanning ¡ [Demo: ¡replanning ¡(L2D3)] ¡ Generates one single plan vs. replans at every step of the way [Demo: ¡mastermind ¡(L2D4)] ¡ 2

  3. Search ¡Problems ¡ Search ¡Problems ¡Are ¡Models ¡ § A ¡search ¡problem ¡consists ¡of: ¡ A model of the § A ¡state ¡space ¡ world at a given point in time. § A ¡successor ¡func)on ¡ “N”, ¡1.0 ¡ ¡(with ¡ac)ons, ¡costs) ¡ How the world evolves in response to agent’s actions. “E”, ¡1.0 ¡ § A ¡start ¡state ¡and ¡a ¡goal ¡test ¡ § A ¡solu)on ¡is ¡a ¡sequence ¡of ¡ac)ons ¡(a ¡plan) ¡which ¡ transforms ¡the ¡start ¡state ¡to ¡a ¡goal ¡state ¡ Important: Find the right level of abstraction, so that your model is a good model of the world. Example: ¡Traveling ¡in ¡Romania ¡ What’s ¡in ¡a ¡State ¡Space? ¡ The ¡world ¡state ¡includes ¡every ¡last ¡detail ¡of ¡the ¡environment ¡ § State ¡space: ¡ § Ci)es ¡ § Successor ¡func)on: ¡ § Roads: ¡Go ¡to ¡adjacent ¡city ¡with ¡ cost ¡= ¡distance ¡ § Start ¡state: ¡ A ¡search ¡state ¡keeps ¡only ¡the ¡details ¡needed ¡for ¡planning ¡(abstrac)on) ¡ § Arad ¡ § Problem: ¡Pathing ¡ § Problem: ¡Eat-­‑All-­‑Dots ¡ § Goal ¡test: ¡ § States: ¡(x,y) ¡loca)on ¡ § States: ¡{(x,y), ¡dot ¡booleans} ¡ § Is ¡state ¡== ¡Bucharest? ¡ § Ac)ons: ¡NSEW ¡ § Ac)ons: ¡NSEW ¡ § Successor: ¡update ¡loca)on ¡ § Successor: ¡update ¡loca)on ¡ § Solu)on? ¡ only ¡ and ¡possibly ¡a ¡dot ¡boolean ¡ § Goal ¡test: ¡is ¡(x,y)=END ¡ § Goal ¡test: ¡dots ¡all ¡false ¡ 3

  4. State ¡Space ¡Sizes? ¡ Quiz: ¡Safe ¡Passage ¡ § World ¡state: ¡ § Agent ¡posi)ons: ¡120 ¡ § Food ¡count: ¡30 ¡ § Ghost ¡posi)ons: ¡12 ¡ § Agent ¡facing: ¡NSEW ¡ ¡ § How ¡many ¡ § World ¡states? ¡ ¡120x(2 30 )x(12 2 )x4 ¡ § States ¡for ¡pathing? ¡ § Problem: ¡eat ¡all ¡dots ¡while ¡keeping ¡the ¡ghosts ¡perma-­‑scared ¡ ¡120 ¡ § What ¡does ¡the ¡state ¡space ¡have ¡to ¡specify? ¡ § States ¡for ¡eat-­‑all-­‑dots? ¡ ¡120x(2 30 ) ¡ ¡ ¡ ¡ ¡Solu)on: ¡ ¡ ¡ State ¡Space ¡Graphs ¡and ¡Search ¡Trees ¡ State ¡Space ¡Graphs ¡ § State ¡space ¡graph: ¡A ¡mathema)cal ¡ representa)on ¡of ¡a ¡search ¡problem ¡ § Nodes ¡are ¡(abstracted) ¡world ¡configura)ons ¡ § Arcs ¡represent ¡successors ¡(ac)on ¡results) ¡ § The ¡goal ¡test ¡is ¡a ¡set ¡of ¡goal ¡nodes ¡(maybe ¡only ¡one) ¡ § In ¡a ¡state ¡space ¡graph, ¡each ¡state ¡occurs ¡only ¡ once! ¡ § We ¡can ¡rarely ¡build ¡this ¡full ¡graph ¡in ¡memory ¡ (it’s ¡too ¡big), ¡but ¡it’s ¡a ¡useful ¡idea ¡ ¡ 4

  5. State ¡Space ¡Graphs ¡ Search ¡Trees ¡ This ¡is ¡now ¡/ ¡start ¡ § State ¡space ¡graph: ¡A ¡mathema)cal ¡ G representa)on ¡of ¡a ¡search ¡problem ¡ a “N”, ¡1.0 ¡ “E”, ¡1.0 ¡ c § Nodes ¡are ¡(abstracted) ¡world ¡configura)ons ¡ b Possible ¡futures ¡ § Arcs ¡represent ¡successors ¡(ac)on ¡results) ¡ e d § The ¡goal ¡test ¡is ¡a ¡set ¡of ¡goal ¡nodes ¡(maybe ¡only ¡one) ¡ f S h § In ¡a ¡search ¡graph, ¡each ¡state ¡occurs ¡only ¡once! ¡ p r q § A ¡search ¡tree: ¡ § A ¡“what ¡if” ¡tree ¡of ¡plans ¡and ¡their ¡outcomes ¡ § We ¡can ¡rarely ¡build ¡this ¡full ¡graph ¡in ¡memory ¡ Tiny ¡search ¡graph ¡for ¡a ¡0ny ¡ § The ¡start ¡state ¡is ¡the ¡root ¡node ¡ (it’s ¡too ¡big), ¡but ¡it’s ¡a ¡useful ¡idea ¡ search ¡problem ¡ § Children ¡correspond ¡to ¡successors ¡ § Nodes ¡show ¡states, ¡but ¡correspond ¡to ¡PLANS ¡that ¡achieve ¡those ¡states ¡ ¡ § For ¡most ¡problems, ¡we ¡can ¡never ¡actually ¡build ¡the ¡whole ¡tree ¡ State ¡Space ¡Graphs ¡vs. ¡Search ¡Trees ¡ Quiz: ¡State ¡Space ¡Graphs ¡vs. ¡Search ¡Trees ¡ Consider ¡this ¡4-­‑state ¡graph: ¡ ¡ How ¡big ¡is ¡its ¡search ¡tree ¡(from ¡S)? ¡ Each ¡NODE ¡in ¡in ¡ State ¡Space ¡Graph ¡ Search ¡Tree ¡ the ¡search ¡tree ¡is ¡ an ¡en0re ¡PATH ¡in ¡ the ¡state ¡space ¡ S a graph. ¡ G e p a d b c q b c e h r G S e d f h r p q f a a S We ¡construct ¡both ¡ h q c on ¡demand ¡– ¡and ¡ p q f G b p r q we ¡construct ¡as ¡ a q c G li:le ¡as ¡possible. ¡ a Important: ¡Lots ¡of ¡repeated ¡structure ¡in ¡the ¡search ¡tree! ¡ 5

  6. Tree ¡Search ¡ Search ¡Example: ¡Romania ¡ Searching ¡with ¡a ¡Search ¡Tree ¡ General ¡Tree ¡Search ¡ § Important ¡ideas: ¡ § Search: ¡ § Fringe ¡ § Expand ¡out ¡poten)al ¡plans ¡(tree ¡nodes) ¡ § Expansion ¡ § Explora)on ¡strategy ¡ § Maintain ¡a ¡fringe ¡of ¡par)al ¡plans ¡under ¡considera)on ¡ § Try ¡to ¡expand ¡as ¡few ¡tree ¡nodes ¡as ¡possible ¡ § Main ¡ques)on: ¡which ¡fringe ¡nodes ¡to ¡explore? ¡ 6

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