1 Chapter 11 Hierarchical Task Network Planning. 2 Motivation We may already have an idea how to go about solving problems in a planning domain Example:

Slides:



Advertisements
Similar presentations
TL-SHOP Derek MonnerNat Ayewah CMSC 722 Term Project, Spring 2007 University of Maryland, College Park Temporal Logic.
Advertisements

REVIEW : Planning To make your thinking more concrete, use a real problem to ground your discussion. –Develop a plan for a person who is getting out of.
In the name of God An Application of Planning An Application of PlanningJSHOP BY: M. Eftekhari and G. Yaghoobi.
CSE391 – 2005 NLP 1 Planning The Planning problem Planning with State-space search.
Hierarchical Task Networks Planning to perform tasks rather than to achieve goals.
Hierarchical Task Network (HTN) Planning Hai Hoang 4/17/2007.
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
Planning Module THREE: Planning, Production Systems,Expert Systems, Uncertainty Dr M M Awais.
SHOP2: An HTN Planning System Nau, D.S., Au, T.C., Ilghami, O., Kuter, U., Murdock, J.W., Wu, D. and Yaman, F. (2003) "SHOP2: An HTN Planning System",
CLASSICAL PLANNING What is planning ?  Planning is an AI approach to control  It is deliberation about actions  Key ideas  We have a model of the.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Classical Planning via Plan-space search COMP3431 Malcolm Ryan.
1Nau: Univ of Alberta, 2004 Forward-Chaining Planning in Nondeterministic Domains Ugur Kuter and Dana Nau Department of Computer Science and Institute.
1 Partial Order Reduction. 2 Basic idea P1P1 P2P2 P3P3 a1a1 a2a2 a3a3 a1a1 a1a1 a2a2 a2a2 a2a2 a2a2 a3a3 a3a3 a3a3 a3a3 a1a1 a1a1 3 independent processes.
EXPRESSIVE INTELLIGENCE STUDIO Lecture 10 CS148/248: Interactive Narrative UC Santa Cruz School of Engineering
Dynamic Bayesian Networks (DBNs)
Best-First Search: Agendas
1.2 Row Reduction and Echelon Forms
Linear Equations in Linear Algebra
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
Artificial Intelligence Chapter 11: Planning
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
1 Planning. R. Dearden 2007/8 Exam Format  4 questions You must do all questions There is choice within some of the questions  Learning Outcomes: 1.Explain.
Inference and Resolution for Problem Solving
Planning Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 11.
Lesson 6. Refinement of the Operator Model This page describes formally how we refine Figure 2.5 into a more detailed model so that we can connect it.
Automated Planning and HTNs Planning – A brief intro Planning – A brief intro Classical Planning – The STRIPS Language Classical Planning – The STRIPS.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Classical Planning Chapter 10.
1 Plan-Space Planning Dr. Héctor Muñoz-Avila Sources: Ch. 5 Appendix A Slides from Dana Nau’s lecture.
(Classical) AI Planning. Some Examples Route search: Find a route between Lehigh University and the Naval Research Laboratory Project management: Construct.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Planning, page 1 CSI 4106, Winter 2005 Planning Points Elements of a planning problem Planning as resolution Conditional plans Actions as preconditions.
First-Order Logic and Plans Reading: C. 11 (Plans)
Course: Software Engineering ©Alessandra RussoUnit 2: States and Operations, slide number 1 States and Operations This unit aims to:  Define: State schemas.
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Automated Planning Dr. Héctor Muñoz-Avila. What is Planning? Classical Definition Domain Independent: symbolic descriptions of the problems and the domain.
Introduction to Planning Dr. Shazzad Hosain Department of EECS North South Universtiy
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
1 Chapter 3 Complexity of Classical Planning. 2 Review: Classical Representation Function-free first-order language L Statement of a classical planning.
Intro to Planning Or, how to represent the planning problem in logic.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
(Classical) AI Planning. General-Purpose Planning: State & Goals Initial state: (on A Table) (on C A) (on B Table) (clear B) (clear C) Goals: (on C Table)
Hierarchical Task Network Planning Automated Planning: Theory and Practice, Chapter 11 소프트컴퓨팅 연구실
1 CMSC 471 Fall 2004 Class #21 – Thursday, November 11.
1 CMSC 471 Fall 2002 Class #24 – Wednesday, November 20.
Planning I: Total Order Planners Sections
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
1 1.2 Linear Equations in Linear Algebra Row Reduction and Echelon Forms © 2016 Pearson Education, Ltd.
1 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
SNS College of Engineering Department of Computer Science and Engineering AI Planning Presented By S.Yamuna AP/CSE 5/23/2018 AI.
Linear Equations in Linear Algebra
Class #20 – Wednesday, November 5
Linear Equations in Linear Algebra
Representations & Reasoning Systems (RRS) (2.2)
Hierarchical Task Networks
Class #17 – Tuesday, October 30
Presentation transcript:

1 Chapter 11 Hierarchical Task Network Planning

2 Motivation We may already have an idea how to go about solving problems in a planning domain Example: travel to a destination that’s far away:  Domain-independent planner: »many combinations vehicles and routes  Experienced human: small number of “recipes” e.g., flying: 1. buy ticket from local airport to remote airport 2. travel to local airport 3. fly to remote airport 4. travel to final destination How to enable planning systems to make use of such recipes?

3 Two Approaches Control rules (previous chapter):  Write rules to prune every action that doesn’t fit the recipe Hierarchical Task Network (HTN) planning:  Describe the actions and subtasks that do fit the recipe

4 HTN Planning travel(Sharif, Ferdowsi) get-ticket(THR, MSH) travel(Sharif, THR) fly(THR, MSH) travel(MSH, Ferdowsi) get-taxi ride(MSH, Ferdowsi) pay-driver go-to-agency find-flights(THR, MSH) buy-ticket(THR, MSH) get-taxi ride(Sharif, THR) pay-driver Task: Problem reduction  Tasks (activities) rather than goals  Methods to decompose tasks into subtasks  Enforce constraints »E.g., taxi not good for long distances  Backtrack if necessary Method: taxi-travel(x,y) get-taxi ride(x,y) pay-driver BACKTRACK travel(x,y) Method: air-travel(x,y) travel(a(y),y) get-ticket(a(x),a(y)) travel(x,a(x)) fly(a(x),a(y)) get-ticket(Sharif, Ferdowsi) go-to-agency find-flights(Sharif, Ferdowsi )

5 HTN Planning HTN planners may be domain-specific  e.g., Robotics (Chapters 20) and Bridge (Chapter 23) Or they may be domain-configurable  Domain-independent planning engine  Domain description »methods, operators  Problem description »domain description, initial state, initial task network

6 Simple Task Network (STN) Planning A special case of HTN planning States and operators  The same as in classical planning Task: an expression of the form t(u 1,…,u n )  t is a task symbol, and each u i is a term  Two kinds of task symbols (and tasks): »primitive: tasks that we know how to execute directly task symbol is an operator name »nonprimitive: tasks that must be decomposed into subtasks use methods (next slide)

7 Methods Totally-ordered method: a 4-tuple m = (name(m), task(m), precond(m), subtasks(m))  name(m): an expression of the form n(x 1,…,x n ) »x 1,…,x n are parameters - variable symbols  task(m): a nonprimitive task  precond(m): preconditions (literals)  subtasks(m): a sequence of tasks  t 1, …, t k  air-travel (x,y) task: travel (x,y) precond: long-distance (x,y) subtasks:  buy-ticket (a(x),a(y)), travel (x,a(x)), fly (a(x),a(y)), travel (a(y),y)  travel(x,y) buy-ticket (a(x), a(y))travel (x, a(x))fly (a(x), a(y))travel (a(y), y) long-distance(x,y) air-travel(x,y)

8 Partially ordered method: a 4-tuple m = (name(m), task(m), precond(m), subtasks(m))  name(m): an expression of the form n(x 1,…,x n ) »x 1,…,x n are parameters - variable symbols  task(m): a nonprimitive task  precond(m): preconditions (literals)  subtasks(m): a partially ordered set of tasks {t 1, …, t k } air-travel (x, y) task: travel (x, y) precond: long-distance (x, y) network:u 1 = buy-ticket (a(x), a(y)), u 2 = travel (x, a(x)), u 3 = fly (a(x), a(y)) u 4 = travel (a(y), y), {(u 1, u 3 ), (u 2, u 3 ), (u 3, u 4 )} travel(x,y) buy-ticket (a(x), a(y))travel (x, a(x))fly (a(x), a(y))travel (a(y), y) long-distance(x,y) air-travel(x,y) Methods

9 Domains, Problems, Solutions STN planning domain: methods, operators STN planning problem: methods, operators, initial state, task list Total-order STN planning domain and planning problem:  Same as above except that all subtasks are totally ordered Solution: any executable plan that can be generated by recursively applying  methods to nonprimitive tasks  operators to primitive tasks nonprimitive task precond method instance s0s0 precondeffectsprecondeffects s1s1 s2s2 primitive task operator instance

10 Example Suppose we want to move three stacks of containers in a way that preserves the order of the containers

11 Example (continued) A way to move each stack:  first move the containers from p to an intermediate pile r  then move them from r to q

12 Partial-Order Formulation

13 Total-Order Formulation

14 Solving Total-Order STN Planning Problems state s; task list T=( t 1,t 2,…) action a state  (s,a) ; task list T=(t 2, …) task list T=( u 1,…,u k,t 2,…) task list T=( t 1,t 2,…) method instance m

15 Expressivity Relative to Classical Planning Any classical planning planning problem can be translated into an ordered-task-planning problem in polynomial time Several ways to do this. One is roughly as follows:  For each goal or precondition e, create a task t e  For each operator o and effect e, create a method m o,e »Task: t e »Subtasks: t c1, t c2, …, t cn, o, where c 1, c 2, …, c n are the preconditions of o »Partial-ordering constraints: each t ci precedes o There are HTN planning problems that cannot be translated into classical planning problems at all Example on the next page

16 Two methods:  No arguments  No preconditions Two operators, a and b  Again, no arguments and no preconditions Initial state is empty, initial task is t Set of solutions is { a n b n | n > 0} No classical planning problem has this set of solutions  The state-transition system is a finite-state automaton  No finite-state automaton can recognize { a n b n | n > 0} method1 bt a t method2 ba t Example

17 Comparison to Forward and Backward Search In state-space planning, must choose whether to search forward or backward In HTN planning, there are two choices to make about direction:  forward or backward  up or down TFD goes down and forward s0s0 s1s1 s2s2 … … op 1 op 2 op i S i–1 s0s0 s1s1 s2s2 … task t m … … task t n op 1 op 2 op i S i–1 task t 0

18 Comparison to Forward and Backward Search Like a backward search, TFD is goal-directed  Goals correspond to tasks Like a forward search, it generates actions in the same order in which they’ll be executed Whenever we want to plan the next task  we’ve already planned everything that comes before it  Thus, we know the current state of the world s0s0 s1s1 s2s2 … task t m … … task t n op 1 op 2 op i S i–1 task t 0

19 Knowing the current state makes it easy to do things that would be difficult otherwise  States can be arbitrary data structures  Preconditions and effects can include »logical inferences (e.g., Horn clauses) »complex numeric computations e.g., SHOP: Increasing Expressivity Further

20 Example Simple travel-planning domain  Go from one location to another  State-variable formulation

21 Precond: distance(home,park) ≤ 2 Precond: cash(me) ≥ *distance(home,park) Initial task: travel(me,home,park) Precondition succeeds travel-by-foottravel-by-taxi Precondition fails Decomposition into subtasks home park Planning Problem: I am at home, I have $20, I want to go to a park 8 miles away s 1 = {location(me)=home, location(taxi)=home, cash(me)=20, distance(home,park)=8} Initial state s 0 = {location(me)=home, cash(me)=20, distance(home,park)=8} call-taxi(me,home)ride(me,home,park)pay-driver(me,home,park) Precond: … Effects: … Precond: … Effects: … Precond: … Effects: … s 2 = {location(me)=park, location(taxi)=park, cash(me)=20, distance(home,park)=8 s 3 = {location(me)=park, location(taxi)=park, cash(me)=14.50, distance(home,park)=8} Final state s 1 s 2 s 3 s 0

22 Cannot interleave subtasks of different tasks Sometimes this can make things awkward Need methods that reason globally instead of locally walk(a,b) pickup(p) walk(b,a) get(p)get(q) get-both(p,q) goto(b) pickup(p)pickup(q) get-both(p,q) Limitation of Ordered-Task Planning pickup-both(p,q) walk(a,b) pickup(q) walk(b,a) walk(a,b) goto(a) walk(b,a)

23 Generalize the Methods Generalize methods to allow the subtasks to be partially ordered Consequence: plans may interleave subtasks of different tasks This makes the planning algorithm more complicated walk(a,b)pickup(p) get(p) stay-at(b)pickup(q) get(q) get-both(p,q) walk(b,a)stay-at(a)

24 π={a 1 …, a k, a }; w’={t 2,t 3 …} w={ t 1,t 2,…} method instance m w’={ u 1,…,u k,t 2,…} π={a 1,…, a k }; w={ t 1,t 2, t 3 …} operator instance a Generalize TFD to interleave subtasks

25 w={ t 1,t 2,…} method instance m w’={ u 1,…,u k,t 2,…}  (w, u, m,  ) has a complicated definition in the book. Here’s what it means:  We selected t 1 because it’s possible for t 1 to come first  We’re planning for t 1 under the assumption that it will come first  Insert ordering constraints to ensure it will come first  The same constraints also must apply to all subtasks of t 1 Generalize TFD to interleave subtasks

26 Discussion PFD is sound and complete Can generalize in the same ways as TFD SHOP2: implementation of PFD -like algorithm + generalizations  Won one of the top four awards in the AIPS-2002 Planning Competition  Freeware, open source  Implementation available at