Planning with Non-Deterministic Uncertainty. Recap Uncertainty is inherent in systems that act in the real world Last lecture: reacting to unmodeled disturbances.

Slides:



Advertisements
Similar presentations
Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
Advertisements

Additional Topics ARTIFICIAL INTELLIGENCE
Solving problems by searching
Announcements Course TA: Danny Kumar
Planning with Non-Deterministic Uncertainty (Where failure is not an option) R&N: Chap. 12, Sect (+ Chap. 10, Sect 10.7)
Artificial Intelligence CS482, CS682, MW 1 – 2:15, SEM 201, MS 227 Prerequisites: 302, 365 Instructor: Sushil Louis,
Situation Calculus for Action Descriptions We talked about STRIPS representations for actions. Another common representation is called the Situation Calculus.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Plan Generation & Causal-Link Planning 1 José Luis Ambite.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
CSC 423 ARTIFICIAL INTELLIGENCE
N ONDETERMINISTIC U NCERTAINTY & S ENSORLESS P LANNING.
Best-First Search: Agendas
Discrete Structure Li Tak Sing( 李德成 ) Lectures
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
CS 380: Artificial Intelligence Lecture #3 William Regli.
Chapter 12: Expert Systems Design Examples
Planning under Uncertainty
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) January, 12, 2009.
Search: Representation and General Search Procedure CPSC 322 – Search 1 January 12, 2011 Textbook § 3.0 –
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
3/25  Monday 3/31 st 11:30AM BYENG 210 Talk by Dana Nau Planning for Interactions among Autonomous Agents.
Game Playing CSC361 AI CSC361: Game Playing.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
Handling non-determinism and incompleteness. Problems, Solutions, Success Measures: 3 orthogonal dimensions  Incompleteness in the initial state  Un.
1 Target Finding. 2 Example robot’s visibility region hiding region 1 cleared region robot.
CS 326A: Motion Planning Criticality-Based Motion Planning: Target Finding.
Planning & Acting Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 12 Scheduling (12.1), Planning and Acting in nondetermininistic domains (12.3),
CS121 Heuristic Search Planning CSPs Adversarial Search Probabilistic Reasoning Probabilistic Belief Learning.
Solving problems by searching
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
1 Solving problems by searching This Lecture Chapters 3.1 to 3.4 Next Lecture Chapter 3.5 to 3.7 (Please read lecture topic material before and after each.
Games. Adversaries Consider the process of reasoning when an adversary is trying to defeat our efforts In game playing situations one searches down the.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
Lecture 3: Uninformed Search
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Lecture 3: 18/4/1435 Searching for solutions. Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
SOLVING PROBLEMS BY SEARCHING Chapter 3 August 2008 Blind Search 1.
A General Introduction to Artificial Intelligence.
U NCERTAINTY IN S ENSING ( AND ACTION ). A GENDA Planning with belief states Nondeterministic sensing uncertainty Probabilistic sensing uncertainty.
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
U NCERTAINTY IN S ENSING ( AND ACTION ). A GENDA Planning with belief states Nondeterministic sensing uncertainty Probabilistic sensing uncertainty.
Problem Reduction So far we have considered search strategies for OR graph. In OR graph, several arcs indicate a variety of ways in which the original.
Intro to Planning Or, how to represent the planning problem in logic.
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
PC-Trees & PQ-Trees. 2 Table of contents Review of PQ-trees –Template operations Introducing PC-trees The PC-tree algorithm –Terminal nodes –Splitting.
Automated Planning and Decision Making Prof. Ronen Brafman Automated Planning and Decision Making Fully Observable MDP.
Solving problems by searching A I C h a p t e r 3.
Planning Under Uncertainty. Sensing error Partial observability Unpredictable dynamics Other agents.
1 Solving problems by searching Chapter 3. 2 Outline Problem types Example problems Assumptions in Basic Search State Implementation Tree search Example.
PC-Trees & PQ-Trees. 2 Table of contents Review of PQ-trees –Template operations Introducing PC-trees The PC-tree algorithm –Terminal nodes –Splitting.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Solving problems by searching Chapter 3. Types of agents Reflex agent Consider how the world IS Choose action based on current percept Do not consider.
Solving problems by searching
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Example robot cleared region robot’s visibility region hiding region 2
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
CS b659: Intelligent Robotics
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
ECE 448 Lecture 4: Search Intro
Problem Solving by Searching
Artificial Intelligence
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Solving problems by searching
Robust Belief-based Execution of Manipulation Programs
What to do when you don’t know anything know nothing
Searching for Solutions
ARTIFICIAL INTELLIGENCE
Presentation transcript:

Planning with Non-Deterministic Uncertainty

Recap Uncertainty is inherent in systems that act in the real world Last lecture: reacting to unmodeled disturbances This lecture: improving worst-case outcomes by modeling disturbances

Three Strategies for Handling Uncertainty Reactive strategies (e.g., replanning) Proactive strategies  Anticipating future uncertainty  Shaping future uncertainty (active sensing)

Reactive

Anticipatory

Intruder Finding Problem  A moving intruder is hiding in a 2-D workspace  The robot must “sweep” the workspace to find the intruder  Both the robot and the intruder are points robot’s visibility region hiding region 1 cleared region robot

Example of Solution

Two Cases  Uncertainty in action only [The world is fully observable]  Uncertainty in both action and sensing [The world is partially observable]

Uncertainty in Action Only

Uncertainty Model Each action representation is of the form: Action: P {E 1, E 2,..., E r } where each E i, i = 1,..., r describes one possible set of effects of the action in a state satisfying P [In STRIPS language, E i consists of a Delete and an Add list]

Example: Devious Vacuum Robot Right P = In(R 1 ) {E 1 = [D 1 = In(R 1 ) A 1 = In(R 2 )] E 2 = [D 2 = Clean(R 1 ) A 2 =  ]} R1R1 R2R2 Right may cause the robot to move to room R 2 (E 1 ), or to dump dust and stay in R 1 (E 2 ) Not intentional, so unpredictable

Left P = In(R 2 ) {E 1 = [D 1 = In(R 2 ) A 1 = In(R 1 )]} Left always leads the robot to move to R 1

Suck(R 1 ) P = In(R 1 ) {E 1 = [D 1 =  A 1 = Clean(R 1 )]} Suck(R 1 ) always leads the robot to do the right thing

Suck(R 2 ) P = In(R 2 ) {E 1 = [D 1 =  A 1 = Clean(R 2 )] E 2 = [D 2 = In(R 2 ) A 2 = Clean(R 2 ), In(R 1 )]} But Suck(R 2 ) may also cause the robot to move to R 1

Problem From the initial state: our devious vacuum robot must achieve the goal Clean(R 1 )  Clean(R 2 ) We want a guaranteed plan, i.e., one that works regardless of which action outcomes actually occur R1R1 R2R2

Right AND/OR Tree action nodes (world “decision” nodes) state nodes (agent decision nodes) Suck(R 1 ) loop

Right AND/OR Tree Suck(R 1 ) loop LeftSuck(R 2 ) goal loop Suck(R 2 ) RightSuck(R 1 ) loop Does the problem have a solution? [not as obvious as it looks]

Right AND/OR Tree Suck(R 1 ) loop LeftSuck(R 2 ) goal loop Suck(R 2 ) RightSuck(R 1 ) loop Does the problem have a solution? [not as obvious as it looks] This is essentially forward planning So far, other schemes (backward and non-linear planning) haven’t scaled up well to problems with uncertainty This is essentially forward planning So far, other schemes (backward and non-linear planning) haven’t scaled up well to problems with uncertainty

Labeling an AND/OR Tree  Assume no detection of revisited states

Labeling an AND/OR Tree  A leaf state node is solved if it’s a goal state  A leaf state node is closed if it has no successor and is not a goal

Labeling an AND/OR Tree  An action node is solved if all its children are solved  An action node is closed if at least one of its children is closed

Labeling an AND/OR Tree  An action node is solved if all its children are solved  An action node is closed if at least one of its children is closed  A non-leaf state node is solved if one of its children is solved  A non-leaf state node is closed if all its children are closed

Labeling an AND/OR Tree  An action node is solved if all its children are solved  An action node is closed if at least one of its children is closed  A non-leaf state node is solved if one of its children is solved  A non-leaf state node is closed if all its children are closed  The problem is solved when the root node is solved  The problem is impossible if the root node is closed It was useless to expand this node

Solution of an AND/OR Tree Conditional plan:  Perform a1  If s1 is observed then perform a 2  Else if s 2 is observed then perform a 3  The solution is the sub-tree that establishes that the root is solved  It defines a conditional plan (or contingency plan) that includes tests on sensory data to pick the next action s1s1 s2s2 a3a3 a2a2 a1a1

Searching an AND/OR Tree Loop until the root node is solved or closed:  Top-down generation of the tree: Pick a pending state node N that is not solved or closed and expand it (identify all applicable actions and apply them) [Possibility of expanding state nodes incrementally, one action at a time]  Bottom-up labeling of the tree: Update the labeling of the nodes of the tree

OR Sub-Tree An OR sub-tree corresponds to a path in a classical search tree For each state node, only one child is included For each action node, all children are included It forms a part of a potential solution if none of its nodes is closed [A solution is an OR sub-tree in which all leaves are goal states]

Another OR Sub-Tree

Best-First Search  Let T be any OR sub-tree in the current AND/OR tree and f be a function that estimates the cost of the best solution sub-tree containing T, e.g., f(T) = g(T) + h(T) where g( T ) is the cost of T and h( T ) is an estimate of the cost from T to a solution sub-tree.  Best-first search expands a pending state node of the OR sub-tree with the smallest estimated cost  An algorithm similar to A* – AO*– is available for AND/OR trees

Dealing with Revisited States  Solution #1: Do not test for revisited states  Duplicated sub-trees [The tree may grow arbitrarily large even if the state space is finite]  Solution #2: Test for revisited states and avoid expanding nodes with revisited states

Solution #2 – Case #1  The state of a newly created node N is the same as the state of another node N’ that is not an ancestor of N  Merge N and N’  acyclic AND/OR graph N N’

N Solution #2 – Case #1  The state of a newly created node N is the same as the state of another node N’ that is not an ancestor of N  Merge N and N’  acyclic AND/OR graph  Just discarding the new node would not work! Why??  This makes it more difficult to extract OR sub-trees and manage evaluation function

Solution #2 – Case #2  The state of a newly created node N is the same as the state of a parent of N  Two possible choices: 1) Mark N closed 2) Mark N solved  In either case, the search tree will remain finite, if the state space is finite  If N is marked solved, the conditional plan may include loops What does this mean???

Example Right loop initial state goal

Example Right loop initial state goal

Example Right loop initial state goal Marking loop nodes closed  The problem has no solution

Example Right loop initial state goal Marking loop nodes closed  The problem has a solution But what is this solution?

Example Right initial state goal  cyclic plan : While In(R 1 ) do Right This plan requires that whenever Right is executed, there is a non-zero probability that it does the right thing The plan is guaranteed only in a probabilistic sense: the probability that it achieves the goal goes to 1 with time, but the running time is not bounded

 In the presence of uncertainty, it’s often the case that things don’t work the first time as one would like them to work; one must try again  Without allowing cyclic plans, many problems would have no solution  So, dealing properly with repeated states in case #2 is much more than just a matter of search efficiency!

LeftSuck(R 2 ) goal loop Suck(R 1 )Right LeftSuck(R 1 ) goal loop RightSuck(R 1 ) loop goal Suck(R 2 ) Suck(R 1 ) loop

LeftSuck(R 2 ) goal loop Suck(R 1 )Right LeftSuck(R 1 ) goal loop RightSuck(R 1 ) loop goal Suck(R 2 ) Suck(R 1 ) loop

LeftSuck(R 2 ) goal loop Suck(R 1 )Right LeftSuck(R 1 ) goal loop RightSuck(R 1 ) goal Suck(R 2 ) Suck(R 1 ) loop

Does this always work?  No ! We must be more careful  For a cyclic plan to be correct, it should be possible to reach a goal node from every non-goal node in the plan

LeftSuck(R 2 ) goal loop Suck(R 1 )Right LeftSuck(R 1 ) goal loop RightSuck(R 1 ) loop goal Suck(R 2 ) Suck(R 1 ) loop

Does this always work?  No ! We must be more careful  For a cyclic plan to be correct, it should be possible to reach a goal node from every non-goal node in the plan   The node labeling algorithm must be slightly modified [left as an exercise]

Uncertainty in Action and Sensing

Belief State  A belief state is the set of all states that an agent think are possible at any given time or at any stage of planning a course of actions, e.g.:  To plan a course of actions, the agent searches a space of belief states, instead of a space of states

Sensor Model  State space S  The sensor model is a function SENSE: S  2 S that maps each state s  S to a belief state (the set of all states that the agent would think possible if it were actually observing state s)  Example: Assume our vacuum robot can perfectly sense the room it is in and if there is dust in it. But it can’t sense if there is dust in the other room SENSE( ) =

Vacuum Robot Action and Sensor Model Right P = In(R 1 ) {E 1 = [D 1 = In(R 1 ) A 1 = In(R 2 )] E 2 = [D 2 =  A 2 =  ]} [Right either does the right thing, or nothing] Left P = In(R 2 ) {E 1 = [D 1 = In(R 2 ) A 1 = In(R 1 )] E 2 = [D 2 = In(R 2 ), Clean(R 2 ) A 2 = In(R 1 )} [Left always move the robot to R 1, but it may occasionally deposit dust in R 2 ] Suck(r) P = In(r) {E 1 = [D 1 =  A 1 = Clean(r)]} [Suck always does the right thing] The robot perfectly senses the room it is in and whether there is dust in it But it can’t sense if there is dust in the other room

Transition Between Belief States  Suppose the robot is initially in state:  After sensing this state, its belief state is:  Just after executing Left, its belief state will be:  After sensing the new state, its belief state will be: or if there is no dust if there is dust in R 1 in R 1

Transition Between Belief States  Suppose the robot is initially in state:  After sensing this state, its belief state is:  Just after executing Left, its belief state will be:  After sensing the new state, its belief state will be: or if there is no dust if there is dust in R 1 in R 1 Left Clean(R 1 )  Clean(R 1 )

Transition Between Belief States Left A general algorithm for computing the forward projection of a belief state by a combined action- sensory operation is left as an exercise Clean(R 1 )  Clean(R 1 )

AND/OR Tree of Belief States Left Suck goal A goal belief state is one in which all states are goal states An action is applicable to a belief state B if its precondition is achieved in all states in B Right loop goal

AND/OR Tree of Belief States Left SuckRight loop Suck goal Right loop goal

AND/OR Tree of Belief States Left SuckRight Suck goal Right goal

Belief State Representation Solution #1:  Represent the set of states explicitly  Under the closed world assumption, if states are described with n propositions, there are O(2 n ) states  The number of belief states is  A belief state may contain O(2 n ) states  This can be hugely expensive

Belief State Representation Solution #2:  Represent only what is known  For example, if the vacuum robot knows that it is in R 1 (so, not in R 2 ) and R 2 is clean, then the representation is K(In(R 1 ))  K(  In(R 2 ))  K(Clean(R 2 )) where K stands for “Knows that...”  How many belief states can be represented?  Only 3 n, instead of

Successor of a Belief State Through an Action Left P = In(R 2 ) { E 1 = [D 1 = In(R 2 ) A 1 = In(R 1 )] E 2 = [D 2 = In(R 2 ), Clean(R 2 ) A 2 = In(R 1 )} K(In(R 2 ))  K(  In(R 1 ))  K(Clean(R 2 )) E 1  K(  In(R 2 ))  K(In(R 1 ))  K(Clean(R 2 )) E 2  K(  In(R 2 ))  K(In(R 1 ))  K(  Clean(R 2 )) K(  In(R 2 ))  K(In(R 1 )) An action does not depend on the agent’s belief state  K does not appear in the action description (different from R&N, p. 440)

Sensory Actions  So far, we have assumed a unique sensory operation automatically performed after executing of each action of a plan  But an agent may have several sensors, each having some cost (e.g., time) to use  In certain situations, the agent may like better to avoid the cost of using a sensor, even if using the sensor could reduce uncertainty  This leads to introducing specific sensory actions, each with its own representation  active sensing  Like with other actions, the agent chooses which sensory actions it want to execute and when

Example Check-Dust(r): P = In(Robot,r) {when Clean(r) D = K(  Clean(r)) A = K(Clean(r))]} {when  Clean(r) D = K(Clean(r)) A = K(  Clean(r))]} K(In(R 1 ))  K(  In(R 2 ))  K(  Clean(R 2 )) K(In(R 1 ))  K(  In(R 2 ))  K(  Clean(R 2 ))  K(Clean(R 1 )) K(In(R 1 ))  K(  In(R 2 ))  K(  Clean(R 2 ))  K(  Clean(R 1 )) Check-Dust(R 1 ): A sensory action maps a state into a belief state Its precondition is about the state Its effects are on the belief state

Intruder Finding Problem  A moving intruder is hiding in a 2-D workspace  The robot must “sweep” the workspace to find the intruder  Both the robot and the intruder are points robot’s visibility region hiding region 1 cleared region robot

Does a solution always exist? Easy to test: “Hole” in the workspace Hard to test: No “hole” in the workspace No !

Information State  Example of an information state = (x,y,a=1,b=1,c=0)  An initial state is of the form (x,y,1, 1,..., 1)  A goal state is any state of the form (x,y,0,0,..., 0) (x,y) a = 0 or 1 c = 0 or 1 b = 0 or 1 0  cleared region 1  hidding region

Critical Line a=0 b=1 a=0 b=1 Information state is unchanged a=0 b=0 Critical line

A BCD E Criticality-Based Discretization Each of the regions A, B, C, D, and E consists of “equivalent” positions of the robot, so it’s sufficient to consider a single position per region

Criticality-Based Discretization A B CD E (C, 1, 1) (D, 1)(B, 1)

Criticality-Based Discretization A BC D E (C, 1, 1) (D, 1)(B, 1)(E, 1)(C, 1, 0)

Criticality-Based Discretization A B CD E (C, 1, 1) (D, 1)(B, 1)(E, 1)(C, 1, 0) (B, 0)(D, 1)

Criticality-Based Discretization A CD E (C, 1, 1) (D, 1)(B, 1)(E, 1)(C, 1, 0) (B, 0)(D, 1) Much smaller search tree than with grid-based discretization ! B

Sensorless Planning

Next Classes Planning with probabilistic uncertainty Probabilistic inference & Bayesian networks

Readings R&N