dana nau: lecture slides for automated planning licensed under the creative commons...

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

Upload: evelyn-waters

Post on 19-Jan-2018

217 views

Category:

Documents


0 download

DESCRIPTION

Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: 3 Definitions l Temporally Qualified Expression (tqe): u expression 1,t 2 ) »a is an atom »t 1, t 2 are temporal variables (not constants) range over the set of real numbers l Temporal database: a pair  = (F,C) u F is a finite set of tqes u C is a finite set of constraints »temporal constraints and object constraints u C must be consistent (i.e., there must exist variable assignments that satisfy it)

TRANSCRIPT

Page 1: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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 forAutomated Planning: Theory and Practice

Dana S. Nau

CMSC 722, AI PlanningUniversity of Maryland, Fall 2004

Page 2: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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 make

a'@[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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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: Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

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