Chapter 14 Temporal Planning

37
1 ture slides for Automated Planning r the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ Chapter 14 Temporal Planning Lecture slides for Automated Planning: Theory and Practice Dana S. Nau CMSC 722, AI Planning University of Maryland, Fall 2004

description

Lecture slides for Automated Planning: Theory and Practice. Chapter 14 Temporal Planning. Dana S. Nau CMSC 722, AI Planning University of Maryland, Fall 2004. Temporal Planning. Motivation: want to do planning in situations where actions have nonzero duration may overlap in time - PowerPoint PPT Presentation

Transcript of Chapter 14 Temporal Planning

Page 1: Chapter 14 Temporal Planning

1Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Chapter 14Temporal Planning

Lecture slides for

Automated Planning: Theory and Practice

Dana S. Nau

CMSC 722, AI Planning

University of Maryland, Fall 2004

Page 2: Chapter 14 Temporal Planning

2Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Temporal Planning Motivation: want to do planning in situations where actions

have nonzero duration may overlap in time

Need an explicit representation of time Two equivalent approaches:

(1) use logical atoms, and extend the usual planning operators to include temporal conditions on those atoms

» temporal databases (2) use state variables, and specify change and persistence

constraints on the state variables

» chronicles In each case, the chapter gives a planning algorithm that’s like a

temporal-planning version of PSP

Page 3: Chapter 14 Temporal Planning

3Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Definitions Temporally Qualified Expression (tqe):

expression a@[t1,t2)

» a is an atom

» t1, t2 are temporal variables (not constants)

• range over the set of real numbers Temporal database: a pair = (F,C)

F is a finite set of tqes C is a finite set of constraints

» temporal constraints and object constraints C must be consistent (i.e., there must exist variable assignments

that satisfy it)

Page 4: Chapter 14 Temporal Planning

4Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Example rob1 remains at location loc1, rob2 moves from loc2 to loc3

Page 5: Chapter 14 Temporal Planning

5Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Enabling Conditions A set of tqes F supports a tqe e = a@[t1,t2) if F contains

a tqe e' = a'@[t'1,t'2) such that a and a' are unifiable

Enabling condition: a set of constraints sufficient to makea'@[t'1,t'2) a@[t1,t2)

Express the unifier as a collection of constraints Add two additional constraints: t'1 ≤ t1 and t2 ≤ t'2

There may be more than one enabling condition F may contain more than one e' that can support e

(e/F) = {enabling conditions for e in F}

If = (F,C), then (e/)

= {enabling conditions for e in F that are consistent with C} For sets of tqes, the obvious generalizations (see next slide)

Page 6: Chapter 14 Temporal Planning

6Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Enabling Conditions and Entailment A set of tqes F supports a set of tqes E = {e1, e2, …, en} if there is a

substitution that unifies each ei in E with an e'i = a'i@[t’i1,t’i2) in F

Enabling condition:a set of constraints sufficient to make e'i ei for every i

Express the substitution as a collection of constraints For each i, add additional constraints t'i1 ≤ ti1 and ti2 ≤ t'i2

(E/F) = {enabling conditions for E in F}

If = (F,C), then (E/)

= {enabling conditions for E in F that are consistent with C}

= (F,C) entails ' = (F',C') if supports F', and there is an enabling condition C'' in (F'/)

such that C entails C'' U C'

Page 7: Chapter 14 Temporal Planning

7Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Temporal Planning Operators

o = (name(o), precond(o), effects(o), const(o)) name(o): name & variables; last two variables are ts, te

precond, effects: sets of tqes const(o): temporal constraints and object constraints

Note: tqes don’t have negations; thus no precond– and effects–

Can get the same effect with domain axioms» will describe later

Page 8: Chapter 14 Temporal Planning

8Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Actions

Action: partially instantiated operator (like in plan-space planning) An action a is applicable to = (F,C) if

F supports precond(a) there is an enabling condition C' in (a/F) such that

C U const(a) U C' is consistent

The result of applying a to is a set of possible databases e.g., suppose a = pickup(x)@[t1,t2)

» different possible values for x, t1, t2

A temporary definition (we’ll revise this later): 0(,a) = {(F U effects(a), C U const(a) U C' | C' is in (a/F)}

short for (precond(a)/F)

Page 9: Chapter 14 Temporal Planning

9Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

move(rob1,loc1,loc2)@[ts,te) is enabled

Enabling condition is

Example

Page 10: Chapter 14 Temporal Planning

10Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Suppose we also have adjacent(loc3,loc2) Then move(rob2,loc3,loc2)@[t's,t'e) is also enabled

Suppose we also have adjacent(loc1,loc3) Then move(rob1,loc1,loc3)@[t''s,t''e) is also enabled

Page 11: Chapter 14 Temporal Planning

11Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Domain Axioms Format: set of tqes disjunct of constraints For an axiom r: cond(r) disj(r)

(r/F) is short for (cond(r)/F)

Page 12: Chapter 14 Temporal Planning

12Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Negative Effects

Axioms can be used to take the place of negative effects

Axiom: no object can be intwo places at the same time

Page 13: Chapter 14 Temporal Planning

13Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Augment with the effects of move(rob1,loc1,loc2)@[ts,te)

The axiom is supported for r = r' = rob1, l = loc1, l' = routes Can infer that

Page 14: Chapter 14 Temporal Planning

14Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Negative Preconditions

Axioms can also be used to take the place of negative preconditions

Axiom: a robot cannot be in a location atthe same time that the location is free

Page 15: Chapter 14 Temporal Planning

15Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Consistency = (F,C) is consistent with an axiom r if

for every enabling condition c in (r/F) there is a condition c' in disj(r) such that C U c U c' is consistent

is consistent with a set of axioms X if is consistent with every axiom in X Consistency condition: a set of constraints that needs to be met to ensure that

is consistent with the supported axioms

There can be more than one consistency condition Each disj(r) may contain more than one constraint c2

Analogy: a consistency condition is like a way to resolve all existing threats

Page 16: Chapter 14 Temporal Planning

16Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Satisfaction = (F,C) satisfies a set of axioms X if either (X/) is empty or there is

a consistency condition c that is entailed by C If satisfies X then it will continue to satisfy X when additional

constraints are added If is consistent with X but does not satisfy X then an additional

constraint c in (X/) needs to be added to to make it satisfy X The set of all databases obtained from that satisfy X is

Page 17: Chapter 14 Temporal Planning

17Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Page 18: Chapter 14 Temporal Planning

18Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Plans

sequence.

Page 19: Chapter 14 Temporal Planning

19Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Concurrent Interfering

Actions

Here, each action provides some of the conditions needed to enable the other

This could not happen in classical planning, but does happen in temporal planning

Page 20: Chapter 14 Temporal Planning

20Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Applying pairs of actions

Page 21: Chapter 14 Temporal Planning

21Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Applying sets of actions

Page 22: Chapter 14 Temporal Planning

22Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Planning Search space similar to the one for PSP (Chapter 5) CSP-based techniques to handle the constraints

Page 23: Chapter 14 Temporal Planning

23Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Algorithm

Similar to a temporal database

Page 24: Chapter 14 Temporal Planning

24Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Flaws

Intuitively, open goals are like open goals in PSP, and the ways of resolving them are analogous to how open goals are resolved in PSP.

Page 25: Chapter 14 Temporal Planning

25Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Flaws (Continued)

Recall that the primary use of axioms is to entail negative preconditions and effects. Resolving an unsatisfied-axiom flaw consists of asserting those preconditions/effects into the database.

Intuitively, threats are like threats in PSP, and the ways of resolving them are analogous to how threats are resolved in PSP.

Page 26: Chapter 14 Temporal Planning

26Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Page 27: Chapter 14 Temporal Planning

27Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Page 28: Chapter 14 Temporal Planning

28Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Page 29: Chapter 14 Temporal Planning

29Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

State variables are partially specified functions May never specify the entire function

Page 30: Chapter 14 Temporal Planning

30Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Page 31: Chapter 14 Temporal Planning

31Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Page 32: Chapter 14 Temporal Planning

32Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Chronicle State-variable equivalent of a temporal database

Page 33: Chapter 14 Temporal Planning

33Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Page 34: Chapter 14 Temporal Planning

34Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Page 35: Chapter 14 Temporal Planning

35Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Page 36: Chapter 14 Temporal Planning

36Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/

Page 37: Chapter 14 Temporal Planning

37Dana Nau: Lecture slides for Automated PlanningLicensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/