1bb4ba01b4c2e6b20acb1c5b7ce4890d.ppt
- Количество слайдов: 21
Lecture slides for Automated Planning: Theory and Practice Chapter 5 Plan-Space Planning Dana S. Nau CMSC 722, AI Planning University of Maryland, Fall 2004 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 1
Motivation l Problem with state-space search u In some cases we may try many different orderings of the same actions before realizing there is no solution dead end a b dead end … b a dead end l … … … b a b c a c c b goal a Least-commitment strategy: don’t commit to orderings, instantiations, etc. , until necessary Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 2
Outline l l l Basic idea Open goals Threats The PSP algorithm Long example Comments Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 3
Plan-Space Planning - Basic Idea Backward search from the goal l Each node of the search space is a partial plan » A set of partially-instantiated actions b(y) » A set of constraints x≠y Precond: p(y) u Make more and more refinements, Effects: … until we have a solution a(x) l Types of constraints: Precond: … u precedence constraint: Effects: p(x) c(x) a must precede b p(x) Precond: p(x) u binding constraints: Effects: … » inequality constraints, e. g. , v 1 ≠ v 2 or v ≠ c » equality constraints (e. g. , v 1 = v 2 or v = c) or substitutions u causal link: » use action a to establish the precondition p needed by action b l How to tell we have a solution: no more flaws in the plan u Will discuss flaws and how to resolve them l Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 4
Open Goal l l Flaw: u An action a has a precondition p that we haven’t decided how to establish a(y) Precond: … Effects: p(y) Resolving the flaw: u Find an action b • (either already in the plan, or insert it) u that can be used to establish p • can precede a and produce p u Instantiate variables a(x) u Create a causal link Precond: … Effects: p(x) c(x) Precond: p(x) Effects: … c(x) p(x) Precond: p(x) Effects: … Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 5
Threat Flaw: a deleted-condition interaction u Action a establishes a condition (e. g. , p(x)) for action b u Another action c is capable of deleting this condition p(x) l Resolving the flaw: u impose a constraint to prevent c from deleting p(x) l Three possibilities: a(x) b(x) u Make b precede c Precond: … p(x) Precond: p(x) Effects: … u Make c precede a u Constrain variable(s) c(y) to prevent c from Precond: … deleting p(x) l Effects: p(y) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 6
The PSP Procedure l PSP is both sound and complete Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 7
Example Similar (but not identical) to an example in Russell and Norvig’s Artificial Intelligence: A Modern Approach (1 st edition) l Operators: l Start Precond: none Effects: At(Home), sells(HWS, Drill), Sells(SM, Milk), Sells(SM, Banana) u Finish Precond: Have(Drill), Have(Milk), Have(Banana), At(Home) u Go(l, m) Precond: At(l) Effects: At(m), At(l) u Buy(p, s) Precond: At(s), Sells(s, p) Effects: Have(p) u Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 8
Example (continued) l Initial plan At(Home), Sells(HWS, Drill), Have(Drill), Have(Milk), Sells(SM, Milk), Sells(SM, Bananas) Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 9
Example (continued) l The only possible ways to establish the “Have” preconditions At(s 1), Sells(s 1, Drill) Buy(Drill, s 1) At(s 2), Sells(s 2, Milk) Buy(Milk, s 2) At(s 3), Sells(s 3, Bananas) Buy(Bananas, s 2) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 10
Example (continued) l The only possible way to establish the “Sells” preconditions At(HWS), Sells(HWS, Drill) Buy(Drill, HWS) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Milk, SM) Buy(Bananas, SM) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 11
Example (continued) l The only ways to establish At(HWS) and At(SM) u Note threats At(l 1) At(l At(x)2) Go(l 1, HWS) Go(l 2, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) Buy(Milk, SM) Buy(Bananas, SM) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 12
Example (continued) l To resolve third threat, make Buy(Drill) precede Go(SM) u This resolves all three threats At(l 1) At(l At(x)2) Go(l 1, HWS) Go(l 2, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) Buy(Milk, SM) Buy(Bananas, SM) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 13
Example (continued) l Establish At(l 1) with l 1=Home At(Home) At(l At(x)2) Go(Home, HWS) Go(l 2, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) Buy(Milk, SM) Buy(Bananas, SM) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 14
Example (continued) l Establish At(l 2) with l 2=HWS At(Home) At(HWS) At(x) Go(Home, HWS) Go(HWS, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) Buy(Milk, SM) Buy(Bananas, SM) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 15
Example (continued) l Establish At(Home) for Finish At(Home) At(HWS) At(x) Go(Home, HWS) Go(HWS, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) Buy(Milk, SM) Buy(Bananas, SM) At(l 3) Go(l 3, Home) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 16
Example (continued) l Constrain Go(Home) to remove threats to At(SM) At(Home) At(HWS) At(x) Go(Home, HWS) Go(HWS, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) Buy(Milk, SM) Buy(Bananas, SM) At(l 3) Go(l 3, Home) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 17
Final Plan l Establish At(l 3) with l 3=SM At(Home) At(HWS) At(x) Go(Home, HWS) Go(HWS, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) Buy(Milk, SM) Buy(Bananas, SM) At(SM) Go(SM, Home) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 18
Comments l PSP doesn’t commit to orderings and instantiations until necessary u Avoids generating search trees like this one: a b b a a c b c c b l b goal a Problem: how to prune infinitely long paths? u Loop detection is based on recognizing states we’ve seen before u In a partially ordered plan, we don’t know the states l c Can we prune if we see the same action more than once? • • • go(b, a) go(a, b) go(b, a) at(a) No. Sometimes we might need the same action several times in different states of the world (see next slide) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 19
Example 3 -digit binary counter starts at 000, want to get to 110 s 0 = {d 3=0, d 2=0, d 1=0} g = {d 3=1, d 2=1, d 1=0} l Operators to increment the counter by 1: incr 0 Precond: d 1=0 Effects: d 1=1 l incr 01 Precond: d 2=0, d 1=1 Effects: d 2=1, d 1=0 incr 011 Precond: d 3=0, d 2=1, d 1=1 Effects: d 3=1, d 2=0, d 1=0 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 20
A Weak Pruning Technique l Can prune all paths of length > n, where n = |{all possible states}| u This doesn’t help very much l I’m not sure whethere’s a good pruning technique for planspace planning Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 21


