Automated Planning PLG Group Universidad Carlos III de Madrid AI. - - PowerPoint PPT Presentation

automated planning
SMART_READER_LITE
LIVE PREVIEW

Automated Planning PLG Group Universidad Carlos III de Madrid AI. - - PowerPoint PPT Presentation

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Automated Planning PLG Group Universidad Carlos III de Madrid AI. 2008-09 Automated Planning 1 Introduction Classical planning Neoclassical


slide-1
SLIDE 1

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world

Automated Planning

PLG Group

Universidad Carlos III de Madrid

  • AI. 2008-09

Automated Planning 1

slide-2
SLIDE 2

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world

Indice

1

Introduction

2

Classical planning

3

Neoclassical planning

4

Heuristics Heuristic planning Hierarchical Task Networks Control knowledge Machine learning

5

Planning in the real world

Automated Planning 2

slide-3
SLIDE 3

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world

Indice

1

Introduction

2

Classical planning

3

Neoclassical planning

4

Heuristics Heuristic planning Hierarchical Task Networks Control knowledge Machine learning

5

Planning in the real world

Automated Planning 3

slide-4
SLIDE 4

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world

Indice

1

Introduction

2

Classical planning

3

Neoclassical planning

4

Heuristics Heuristic planning Hierarchical Task Networks Control knowledge Machine learning

5

Planning in the real world

Automated Planning 4

slide-5
SLIDE 5

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world

Indice

1

Introduction

2

Classical planning

3

Neoclassical planning

4

Heuristics Heuristic planning Hierarchical Task Networks Control knowledge Machine learning

5

Planning in the real world

Automated Planning 5

slide-6
SLIDE 6

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Heuristic planning

Types of heuristics

Domain-independent: they can be safely used in any domain, tipically for the selection of descendants Domain-dependent: especially devised for a given domain, they are usually employed for all the other steps Real planners do consist of a mixture of both!

Domain-independence ensures soundness Domain-dependence improves the performance

General idea: to automatically define domain-independent heuristic functions as opposed to ad-hoc domain-dependent functions as in the N-puzzle or the Sokoban domains.

Automated Planning 6

slide-7
SLIDE 7

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

Hierarchical Planning

Hierarchical planners implement heuristics that guide the branching process As in Classical Planning, every state is represented with a set of literals In contrast with Classical Planning:

Instead of aiming at satisfying a set of goal literals G, it aims at planning the set of actions that perform an activity or task Tasks are decomposed in subtasks according to the definition of various methods

There are two types:

Simple Task Networks (STNs): the decomposition is applied after meeting some preconditions according to a hierarchy Hierarchical Task Networks (HTNs): the decomposition is applied when some constraints are met

Automated Planning 7

slide-8
SLIDE 8

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

Types of hierarchical planning

Searching by iteratively considering increasingly detailed abstraction levels in preconditions: ABSTRIPS [Sacerdoti, 1974], ALPINE [Knoblock, 1994] Iteratively refining operators: NOAH [Sacerdoti, 1977],

MOLGEN [Stefik, 1981b,

Stefik, 1981a] Preprogramming how to divide each oeprator:

O-PLAN [Currie and Tate, 1991], SHOP2 [Nau et al., 2003]

Automated Planning 8

slide-9
SLIDE 9

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

Simple Task Networks (STNs)

A STN is a directed acyclic graph w = (U, E) where:

Each node u ∈ U is associated with a task:

Instantiated or not: in case it has or not free variables Primitive or not: in case it might be decomposed further

Each arc e ∈ E stands for an relation of order between two tasks: u ≺ v iff there is a path from u to v

Automated Planning 9

slide-10
SLIDE 10

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

Simple Task Networks. STNs

C B B C invertir−pila (B) dejar (B) quitar (B,C) invertir−sobre−pila (C,B) poner (C,B) levantar(C)

Automated Planning 10

slide-11
SLIDE 11

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

STN methods

A method is a tuple m = (name(m), task(m), precond(m), network(m)) where:

name(m) is the name of the method task(m) is a non-primitive task precond(m) are the preconditions of the method network(m) are the subtasks of the method

A STN planning task is a tuple P = (s0, w, O, M) where:

s0 is the initial state w is a hierarchy of tasks D = (O, M) is the planning domain —operators and methods

Automated Planning 11

slide-12
SLIDE 12

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

An example (I)

method: iniciar-inversi´

  • n (b1, b2)

task: invertir-pila (b1) preconds: libre (b1), encima (b1, b2) subtasks: quitar (b1, b2), dejar (b1), invertir-sobre-pila (b2, b1) method: invertir (b1, b2, b3) task: invertir-sobre-pila (b1, b2) preconds: libre (b1), libre (b2), encima (b1, b3) subtasks: quitar (b1, b3), poner (b1, b2), invertir-sobre-pila (b3, b1) method: finalizar-inversi´

  • n (b1, b2)

task: invertir-sobre-pila (b1, b2) preconds: libre (b1), libre (b2), en-mesa (b1) subtasks: levantar (b1), poner (b1, b2)

Automated Planning 12

slide-13
SLIDE 13

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

Example STN (cont.)

quitar (A,B) dejar (A) invertir−sobre−pila (B,A) poner (B,A) quitar (B,C) invertir−sobre−pila (C,B) B C A B C A poner (C,B) levantar (C) C A B A B C

iniciar−inversion (A,B)

invertir−pila (A)

invertir (B,A,C) finalizar−inversion (C,B)

Automated Planning 13

slide-14
SLIDE 14

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

Resolution

A plan π = a1, . . . , an solves a planning problem P = (s0, w, O, M) iff:

w = ∅ and π = ∅ Given a non-primitive task u ∈ w, π is said to be a solution

  • f P if a1 is applicable in s0 and π = a2, . . . , an is a

solution of P′ = (γ(s0, a1), w − u, O, M) Given a non-primitive task u ∈ w, π is a solution of P if there exists a hierarchy w′ which can be reached with a method m in such a way that π is a solution of (s0, w′, O, M)

Hierarchical models traverse states explicitly They do generate sequential plans However, it is possible to derive from them plans either in total order or partial order

Automated Planning 14

slide-15
SLIDE 15

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

Hierarchical Task Networks (HTNs)

An HTN is defined as w = (U, C) where C is a set of constraints:

  • f precedence: u ≺ v

before-constraint: before (U′,l) states that in every plan π which is a solution of P, l shall be true before U′ after-constraint: after (U′,l) specifies that in every plan π which is a solution of P, l shall be true after U′ between-constraint: between (U′,U′′,l) requires that l must be true just after U′ and shall be true in all the states in between until U′′

Thus, HTN methods are described as follows: m = (name(m), task(m), precond(m), network(m))

Automated Planning 15

slide-16
SLIDE 16

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

An example

method: iniciar-inversion (b1, b2) task: invertir-pila (b1) subtasks: u1 =quitar (b1, b2), u2 = dejar (b1), u3 = invertir-sobre-pila (b2, b1) constraints: u1 ≺ u2, u2 ≺ u3, before ({u1}, libre (b1)), before ({u1}, encima (b1,b2)), before ({u1}, brazo-libre), before ({u3}, libre (b1)) method: invertir (b1, b2, b3) task: invertir-sobre-pila (b1, b2) subtasks: u1 = quitar (b1, b3), u2 = poner (b1, b2), u3 = invertir-sobre-pila (b3, b1) constraints: u1 ≺ u2, u2 ≺ u3, before ({u3}, libre (b1)) before ({u1}, encima (b1,b3)), before ({u1}, brazo-libre), before ({u3}, libre (b1)) method: finalizar-inversion (b1, b2) task: invertir-sobre-pila (b1, b2) subtasks: u1 = levantar (b1), u2 = poner (b1, b2) constraints: u1 ≺ u2 Automated Planning 16

slide-17
SLIDE 17

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

Example of domain theory (actions)

(defdomain logistics ((:operator (!load-truck ?obj ?truck ?loc) ((obj-at ?obj ?loc) (:protection (truck-at ?truck ?loc))) ((in-truck ?obj ?truck))) (:operator (!unload-truck ?obj ?truck ?loc) ((in-truck ?obj ?truck) (:protection (truck-at ?truck ?loc))) ((obj-at ?obj ?loc))) . . .))

Automated Planning 17

slide-18
SLIDE 18

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

Methods (same-city-deliver)

(:method (obj-at ?obj ?loc-goal) same-city-deliver ((in-city ?loc-goal ?city-goal) (obj-at ?obj ?loc-now) (in-city ?loc-now ?city-goal) (truck ?truck ?city-goal)) ((:task in-city-delivery ?truck ?obj ?loc-now ?loc-goal)) different-city-deliver ((in-city ?loc-goal ?city-goal) (obj-at ?obj ?loc-now) (in-city ?loc-now ?city-now) (different ?city-goal ?city-now) (truck ?truck-now ?city-now) (truck ?truck-goal ?city-goal) (airport ?airport-now) (in-city ?airport-now ?city-now) (airport ?airport-goal) (in-city ?airport-goal ?city-goal)) (:ordered (:task in-city-delivery ?truck-now ?obj ?loc-now ?airport-now) (:task air-deliver-obj ?obj ?airport-now ?airport-goal) (:task in-city-delivery ?truck-goal ?obj ?airport-goal ?loc-goal))) Automated Planning 18

slide-19
SLIDE 19

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

SHOP2

SHOP2 is a domain-independent HTN planner whose methods shall be specialized in each domain As in other HTN planners, SHOP2 plans tasks in the same

  • rder they shall be executed

Besides tasks, methods and operadores, SHOP2 accepts axioms as Horn clauses and calls to external functions

Automated Planning 19

slide-20
SLIDE 20

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

SHOP2 (s, T, D)

1

Pick a task t ∈ T which has no predecessors according to the constraints

2

In case t is a primitive task:

Choose an action a that unifies with t according to θ and whose preconditions are true in s Update s deleting del(a) and adding add(a) Remove t from T and apply θ

3

In case t is a non-primitive task:

Choose a method m that decomposes t in subtasks according to θ Remove t from T and add the subtasks specified in m propagating the constraints

4

Go back to 1

Automated Planning 20

slide-21
SLIDE 21

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world Hierarchical Task Networks

Applications

SIPE: brewery O-PLAN: army operations BRIDGE-BARON: computational bridge champion, 1997 SIADEX: fire extinction

Automated Planning 21

slide-22
SLIDE 22

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world

Indice

1

Introduction

2

Classical planning

3

Neoclassical planning

4

Heuristics Heuristic planning Hierarchical Task Networks Control knowledge Machine learning

5

Planning in the real world

Automated Planning 22

slide-23
SLIDE 23

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world

References Ken Currie and Austin Tate. O-Plan: the open planning architecture. Artificial Intelligence, 52(1):49–86, 1991. Craig A. Knoblock. Automatically generating abstractions for planning. Artificial Intelligence, 68, 1994. Dana Nau, Tsz-Chiu Au, Okhtay Ilghami, Ugur Kuter, J. William Mur, and Dan Wu. SHOP2: An HTN planning system. Journal of Artificial Intelligence Research, 20:379–404, 2003. Earl D. Sacerdoti. Planning in a hierarchy of abstraction spaces. Artificial Intelligence, 5:115–135, 1974.

Automated Planning 23

slide-24
SLIDE 24

Introduction Classical planning Neoclassical planning Heuristics Planning in the real world

Earl D. Sacerdoti. A Structure for Plans and Behavior. American Elsevier, New York, 1977. Mark Stefik. Planning and meta-planning (MOLGEN: Part 2). Artificial Intelligence, 16:141–169, 1981. Mark Stefik. Planning with constraints (MOLGEN: Part 1). Artificial Intelligence, 16:111–140, 1981.

Automated Planning 24