Lectur ture e 12 Planni anning: ng: Intro and For Forward - - PowerPoint PPT Presentation

lectur ture e 12 planni anning ng intro and for forward
SMART_READER_LITE
LIVE PREVIEW

Lectur ture e 12 Planni anning: ng: Intro and For Forward - - PowerPoint PPT Presentation

Computer Science CPSC 322 Lectur ture e 12 Planni anning: ng: Intro and For Forward Planning, Slide 1 Announ nouncem emen ents Material for midterm available in Connect 1. List of Learning Goals 2. Short questions on material


slide-1
SLIDE 1

Computer Science CPSC 322

Lectur ture e 12 Planni anning: ng: Intro and For Forward Planning,

Slide 1

slide-2
SLIDE 2
  • Material for midterm available in Connect
  • 1. List of Learning Goals
  • 2. Short questions on material (no solutions)
  • 3. Sample problem-solving questions (with solutions)
  • Material covered
  • Until Forward Planning included (covered today)
  • See corresponding learning goals and short questions on Connect
  • Midterm will be close textbook, no calculator or other devices
  • Part short questions similar or even verbatim from the list posted in

connect

  • Part more problem-solving style questions
  • There will be an individual exam followed by a group exam on the same

test

  • Groups will be formed on the spot, not predefined

Announ nouncem emen ents

slide-3
SLIDE 3
  • Indiv. Exam

Collect Group Exam (same or subset of Indiv. Exam) Form Groups

Exam Format

slide-4
SLIDE 4

Lect cture re O Overvi rview

  • Planning: Intro
  • STRIPS representation
  • Forward Planning
  • Heuristics for Forward Planning
slide-5
SLIDE 5

Course Overview

Environment Problem Type Query Planning Deterministic Stochastic Constraint Satisfaction Search Arc Consistency Search Search Logics STRIPS Vars + Constraints Value Iteration Variable Elimination Belief Nets Decision Nets Markov Processes Static Sequential

Representation Reasoning Technique

Variable Elimination

First Part of the Course

5

slide-6
SLIDE 6

Course Overview

Environment Problem Type Query Planning Deterministic Stochastic Constraint Satisfaction Search Arc Consistency Search Search Logics STRIPS Vars + Constraints Value Iteration Variable Elimination Belief Nets Decision Nets Markov Processes Static Sequential

Representation Reasoning Technique

Variable Elimination

We’ll focus

  • n Planning

6

slide-7
SLIDE 7
  • Goal
  • Description of states of the world
  • Description of available actions => when each action can

be applied and what its effects are

  • Planni

anning ng: build a sequence of actions that, if executed, takes the agent from the current state to a state that achieves the goal Planni anning P ng Probl

  • blem

em But ut, hav haven’ en’t w we e seen t een thi his bef before? Yes es, i in n sear earch, but but w we’ e’ll look

  • ok at

at a a new new R&R sui uitab able e for

  • r pl

planni anning ng

Slide 7

slide-8
SLIDE 8

Standard Search vs. Specific R&R systems

  • Constraint Satisfaction (Problems):
  • State: assignments of values to a subset of the variables
  • Successor function: assign values to a “free” variable
  • Goal test: all variables assigned a value and all constraints satisfied?
  • Solution: possible world that satisfies the constraints
  • Heuristic function: none (all solutions at the same distance from start)
  • Planning :
  • State
  • Successor function
  • Goal test
  • Solution
  • Heuristic function
  • Inference
  • State
  • Successor function
  • Goal test
  • Solution
  • Heuristic function

8

slide-9
SLIDE 9

CSP problems had some specific properties

  • States are represented in terms of features (variables with

a possible range of values)

  • Goal: no longer a black box => expressed in terms of

constraints (satisfaction of)

  • But actions are limited to assignments of values to

variables

  • No notion of path to a solution: only final assignment

matters

Standar andard S d Sear earch v ch vs. Spec pecific R c R&R s syst ystem ems

Slide 9

slide-10
SLIDE 10
  • “Open-up” the representation of states, goals and

actions

– Both states and goals as set of features – Actions as preconditions and effects defined on state features

  • agent can reason more deliberately about which

actions to consider to achieve its goals.

Key I Idea ea of Planni nning ng

Slide 10

slide-11
SLIDE 11
  • This representation lends itself to solve planning

problems either

  • As pure search problems
  • As CSP problems
  • We will look at one technique for each approach
  • this will only scratch the surface of planning

techniques

  • but will give you an idea of the general approaches in

this important area of AI

Key I Idea ea of Planni nning ng

Slide 11

slide-12
SLIDE 12

Planning Techniques and Application from:

  • Ghallab, Nau, and Traverso

Automated Planning: Theory and Practice

Morgan Kaufmann, May 2004 ISBN 1-55860-856-7

  • Web site:

 http://www.laas.fr/planning

applications

12

slide-13
SLIDE 13

Slide 13

Let’s start by introducing a very simple planning problem, as our running example

slide-14
SLIDE 14

Slide 14

Runni unning ng Exam ampl ple: D Del eliver very R Robot

  • bot (

(text extboo book) k)

  • Consider a del

delivery robo robot nam named ed Rob

  • b, who

must navigate the following environment, and can deliver coffee and mail to Sam, in his office

slide-15
SLIDE 15

Deliv livery R Robot E t Example le: fe features

  • RLoc - Rob's location
  • Domain: {coffee shop, Sam's office, mail room, lab}

short {cs, off, mr, lab}

  • RHC – Rob has coffee
  • Domain: {true, false}.

Alternatively notation for RHC = T/F: rhc indicates that Rob has coffee, and that Rob doesn't’have coffee

  • SWC – Sam wants coffee {true, false}
  • MW – Mail is waiting {true, false}
  • RHM – Rob has mail {true, false}
  • An example state is

rhc

15

slide-16
SLIDE 16

Deliv livery R Robot E t Example le: fe features

  • RLoc - Rob's location
  • Domain: {coffee shop, Sam's office, mail room, lab}

short {cs, off, mr, lab}

  • RHC – Rob has coffee
  • Domain: {true, false}.

Alternatively notation for RHC = T/F: rhc indicates that Rob has coffee, and that Rob doesn't’have coffee

  • SWC – Sam wants coffee {true, false}
  • MW – Mail is waiting {true, false}
  • RHM – Rob has mail {true, false}
  • An example state is

Rob is in the lab, it does not have coffee, Sam wants coffee, there is no mail waiting and Rob has mail

rhc

16

slide-17
SLIDE 17

Deliv livery R Robot E t Example le: Actio tions

The robot’s actions are:

puc - Rob picks up coffee

  • must be at the coffee shop and

not have coffee delC - Rob delivers coffee

  • must be at the office, and must have coffee

pum - Rob picks up mail

  • must be in the mail room, and mail must be waiting

delM - Rob delivers mail

  • must be at the office and have mail

17

move - Rob's move actions – there are 8 of them

  • move clockwise (mc-x ), move anti-clockwise (mcc-x )

from location x (where x can be any of the 4 rooms)

  • must be in location x

Preconditions for action application

slide-18
SLIDE 18

Model deling a ng actions

  • ns f

for planni anning ng

  • The key to sophisticated planning is modeling

actions

  • Leverage a feature-based representation:
  • Model when actions are possible, in terms of the

values of the features in the current state

  • Model state transitions caused by actions in terms of

changes in specific features

18

slide-19
SLIDE 19

Lect cture re O Overvi rview

  • Planning: Intro
  • STRIPS representation
  • Forward Planning
  • Heuristics for Forward Planning
slide-20
SLIDE 20

STRIPS r repr pres esent ntat ation

  • n

(ST STanf anfor

  • rd Res

esear earch h Insti titu tute te Probl

  • blem

em Solver er )

STRIPS - the planner in Shakey, first AI robot http://en.wikipedia.org/wiki/Shakey_the_robot In STRIPS, an action has two parts:

  • 1. Preconditions: a set of assignments to features

that must be satisfied in order for the action to be legal/valid/applicable

  • 2. Effects: a set of assignments to features that

are caused by the action

20

slide-21
SLIDE 21

ST STRIPS act ctions: Exa Example

STRIPS representation of the action pick up coffee, puc:

  • pr

prec econdi ditions

  • ns Loc = and RHC =
  • effe

fects ts RHC =

21

cs = coffee shop

  • ff = Sam’s office

mr = mail rom

slide-22
SLIDE 22

ST STRIPS act ctions: Exa Example

STRIPS representation of the action pick up coffee, puc:

  • pr

prec econdi ditions

  • ns Loc = cs and RHC = F
  • effe

fects ts RHC = T STRIPS representation of the action deliver coffee, Del :

  • pr

prec econdi ditions

  • ns Loc =

and RHC =

  • effe

fects ts RHC = and SWC =

22

cs = coffee shop

  • ff = Sam’s office

mr = mail rom

slide-23
SLIDE 23

ST STRIPS act ctions: Exa Example

STRIPS representation of the action pick up coffee, puc:

  • pr

prec econdi ditions

  • ns Loc = cs and RHC = F
  • effe

fects ts RHC = T STRIPS representation of the action deliver coffee, Del :

  • pr

prec econdi ditions

  • ns Loc = off and RHC = T
  • effe

fects ts RHC = F and SWC = F

23

cs = coffee shop

  • ff = Sam’s office

mr = mail rom

Not

  • te

e in this domain Sam doesn't have to want coffee for Rob to deliver it; one way or another, Sam doesn't want coffee after delivery.

slide-24
SLIDE 24

STRIPS ac actions: MC MC and and MA MAC

STRIPS representation of the actions related to moving clockwise

  • mc-cs

prec econd

  • nditions

ns Loc = cs effects Loc = off

  • mc-off

prec econd

  • nditions

ns Loc = off effects Loc = labf

  • mc-lab ….
  • mc-mc …

There are 4 more actions for Move Counterclockwise (mcc-cs, mcc-off, etc.)

24

cs = coffee shop

  • ff = Sam’s office

mr = mail rom

slide-25
SLIDE 25

The S STRIPS R Repr pres esen entat ation

  • n
  • For reference:

The book also discusses a feature-centric representation (not required for this course)

  • for every feature, where does its value come from?
  • causal rule: expresses ways in which a feature’s value can be

changed by taking an action.

  • frame rule: requires that a feature’s value is unchanged if none of

the relevant actions changes it.

  • STRIPS is an action-centric representation:
  • for every action, what does it do?
  • This leaves us with no way to state frame rules.
  • The STRIPS assumption:
  • all features not explicitly changed by an action stay unchanged

25

slide-26
SLIDE 26

ST STRIPS Act Actions ( (co cont’)

Th The S STRI TRIPS ass assum umption

  • n:

: all features not explicitly

changed by an action stay unchanged

  • So if the feature V has value vi in state Si , after action a

has been performed,

  • what can we conclude about a and/or the state of the world Si-1

immediately preceding the execution of a?

Si-1 V = vi Si a

26

slide-27
SLIDE 27

ST STRIPS Act Actions ( (co cont’)

Th The S STRI TRIPS ass assum umption

  • n:

: all features not explicitly

changed by an action stay unchanged

  • So if the feature V has value vi in state Si , after action a

has been performed,

  • what can we conclude about a and/or the state of the world Si-1

immediately preceding the execution of a?

Si-1 V = vi Si a

  • A. V = vi was TRUE in Si-1
  • B. One of the effects of

a is to set V = vi

  • C. At least one of A and B

D None of the above

27

slide-28
SLIDE 28

ST STRIPS Act Actions ( (co cont’)

Th The S STRI TRIPS ass assum umption

  • n:all features not explicitly

changed by an action stay unchanged

  • So if the feature V has value vi in state Si , after action a

has been performed,

  • what can we conclude about a and/or the state of the world Si-1

immediately preceding the execution of a?

Si-1 V = vi Si a

  • C. At least one of A and B

28

slide-29
SLIDE 29
  • STRIPS lends itself to solve planning problems

either

  • As pure search problems
  • As CSP problems
  • We will look at one technique for each approach

Sol

  • lving

g pl planni ning ng problems ems

Slide 29

slide-30
SLIDE 30

Lect cture re O Overvi rview

  • Planning: Intro
  • STRIPS representation
  • Forward Planning
  • Heuristics for Forward Planning
slide-31
SLIDE 31

Forwa ward p d planni nning ng

  • To find a plan, a solution : search in the state-space graph
  • The states are the possible worlds

 full assignments of values to features

  • The arcs from a state s represent all the actions that are possible

in state s

  • A plan is a path from the state representing the initial state to a

state that satisfies the goal

Which actions a are possible in a state s?

31

slide-32
SLIDE 32

Forwa ward p d planni nning ng

  • To find a plan, a solution : search in the state-space graph
  • The states are the possible worlds

 full assignments of values to features

  • The arcs from a state s represent all the actions that are possible

in state s

  • A plan is a path from the state representing the initial state to a

state that satisfies the goal

Which actions a are possible in a state s?

  • C. Those where the state s’ reached via a is on the way to

the goal

  • A. Those where a’s effects are satisfied in s
  • B. Those where a’s preconditions are satisfied in s
  • C. Both A and B

32

slide-33
SLIDE 33

Forwa ward p d planni nning ng

  • To find a plan, a solution : search in the state-space graph
  • The states are the possible worlds

 full assignments of values to features

  • The arcs from a state s represent all the actions that are possible

in state s

  • A plan is a path from the state representing the initial state to a

state that satisfies the goal

Which actions a are possible in a state s?

  • B. Those where a’s preconditions are satisfied in s

33

slide-34
SLIDE 34

Exa Example

  • Suppose that we are in a state where
  • Rob is in the coffee shop and does not have coffee;
  • Sam wants coffee
  • Mail is waiting
  • Rob does not have mail
  • And the goal is that Sam does not want coffee anymore

34

swc

slide-35
SLIDE 35

Example state-space graph: first level

Goal:swc

puc mc mcc

mcc: move counterclockwise

35

slide-36
SLIDE 36

Example state-space graph: first level

Goal:swc

puc mc mcc

mcc: move counterclockwise

36

slide-37
SLIDE 37

Example for state space graph

Goal:

a sequence of actions that gets us from the start to a goal

Solution:

swc

What is a solution to this planning problem?

38

slide-38
SLIDE 38

Example for state space graph

What is a solution to this planning problem?

Goal:

B (puc, mc, mc) C (puc, dc) A (puc, mc) D (puc, mc, dc)

a sequence of actions that gets us from the start to a goal

Solution:

swc

slide-39
SLIDE 39

Example for state space graph

What is a solution to this planning problem?

Goal:

D (puc, mc, dc)

a sequence of actions that gets us from the start to a goal

Solution:

swc

40

slide-40
SLIDE 40

Standard Search vs. Specific R&R systems

Constraint Satisfaction (Problems):

  • State: assignments of values to a subset of the variables
  • Successor function: assign values to a “free” variable
  • Goal test: set of constraints
  • Solution: possible world that satisfies the constraints
  • Heuristic function: none (all solutions at the same distance from start)

Planning :

  • State: full assignment of values to features
  • Successor function: states reachable by applying actions with preconditions

satisfied in the current state

  • Goal test: partial assignment of values to features
  • Solution: a sequence of actions
  • Heuristic function

Inference

  • State
  • Successor function
  • Goal test
  • Solution
  • Heuristic function

41

slide-41
SLIDE 41

Forward Planning

  • Any of the search algorithms we have seen can

be used in Forward Planning

  • Problem?
  • Complexity is defined by the branching factor, which is

42

  • C. Average number of preconditions in the actions

applicable in a state

  • A. Number of actions defined in the planning problem
  • B. Number of actions applicable in a state
  • D. Average number of effects in the actions applicable in

a state

slide-42
SLIDE 42

Forwa ward P d Planni nning ng

  • Any of the search algorithms we have seen can

be used in Forward Planning

  • Problem?
  • Complexity is defined by the branching factor, which

is Number of applicable actions to a state

  • Can be very large
  • Solution?

44

slide-43
SLIDE 43

Standard Search vs. Specific R&R systems

Constraint Satisfaction (Problems):

  • State: assignments of values to a subset of the variables
  • Successor function: assign values to a “free” variable
  • Goal test: set of constraints
  • Solution: possible world that satisfies the constraints
  • Heuristic function: none (all solutions at the same distance from start)

Planning :

  • State: full assignment of values to features
  • Successor function: states reachable by applying actions with preconditions

satisfied in the current state

  • Goal test: partial assignment of values to features
  • Solution: a sequence of actions
  • Heuristic function

Inference

  • State
  • Successor function
  • Goal test
  • Solution
  • Heuristic function

45

slide-44
SLIDE 44

Lect cture re O Overvi rview

  • Planning: Intro
  • STRIPS representation
  • Forward Planning
  • Heuristics for Forward Planning
slide-45
SLIDE 45

Heur uristics f for F Forwar ward P Planni nning ng

Not in textbook, but you can see details in Russel&Norvig, 10.3.2

  • Heur

euristic f func unction

  • n: estimate of the distance from a state to

the goal

  • In planning this distance

is the……………….

47

slide-46
SLIDE 46

Heur uristics f for F Forwar ward P Planni nning ng

Not in textbook, but you can see details in Russel&Norvig, 10.3.2

  • Heur

euristic f func unction

  • n: estimate of the distance from a state to

the goal

  • In planning this

distance is the……………. B. # of actions needed to get from s to the goal

  • C. # of legal actions in s
  • A. # of goal features not true in s

48

slide-47
SLIDE 47

Heur uristics f for F Forwar ward P Planni nning ng

Not in textbook, but you can see details in Russel&Norvig, 10.3.2

  • Heur

euristic f func unction

  • n: estimate of the distance from a state to the

goal

  • In planning this distance

is the……………….

  • Finding a good heuristics is what makes forward planning

feasible in practice

  • Factored representation of states and actions allows for

definition of domain-independent heuristics

  • We will look at one example of such domain-independent

heuristic that has proven to be quite successful in practice

B. # of actions needed to get from s to the goal

49

slide-48
SLIDE 48

Heur uristics f for F Forwar ward P Planni nning ng:

  • We make two simplifications in the STRIPS representation

All features are binary: T / F Goals and preconditions can only be assignments to T e.g. positive assertions

  • Defin

init itio ion: a subgoal is the specific assignment for one of the features in the goal

  • e.g., if the goal is <A=T, B=T, C=T> then….

S1 A = T B = F C = F Goal A = T B = T C = T

Slide 51

slide-49
SLIDE 49

Heur uristics f for F Forwar ward P Planni nning ng:

  • We make two simplifications in the STRIPS representation

All features are binary: T / F Goals and preconditions can only be assignments to T e.g. positive assertions

  • Defin

init itio ion: a subgoal is the specific assignment for one of the features in the goal

  • e.g., if the goal is <A=T, B=T, C=T> then….

S1 A = T B = F C = F Goal A = T B = T C = T

Slide 52

slide-50
SLIDE 50

Heur uristics f for F Forwar ward P Planni nning ng: igno gnore del delete-lis list

  • One strategy to find a non-trivial admissible heuristics is
  • to relax the original problem

Slide 53

slide-51
SLIDE 51

Heur uristics f for F Forwar ward P Planni nning ng: igno gnore del delete-lis list

  • One strategy to find a non-trivial admissible heuristics is
  • to relax the original problem
  • A. To set all h(n) values to 0

Slide 54

  • B. To relax some constraints on the

actions in the original problem

  • C. To simplify the goal in the original

problem

  • D. To run an uniformed search strategy

(e.g. DFS or BFS) in the original problem

slide-52
SLIDE 52

Heur uristics f for F Forwar ward P Planni nning ng: igno gnore del delete-lis list

  • One strategy to find an admissible heuristics is

Slide 55

  • B. To relax some constraints on the

actions in the original problem

slide-53
SLIDE 53

56

slide-54
SLIDE 54

Heur uristics f for F Forwar ward P Planni nning ng: igno gnore del delete-lis list

  • One strategy to find an admissible heuristics is
  • to relax the original problem
  • One way : remove all the effects that make a variable = F.
  • Name of this heuristic derives from complete STRIPS

representation

  • Action effects are divided into those that add elements to the new

state (add list) and those that remove elements (delete list)

  • If we find the path from the initial state to the goal using

this relaxed version of the actions:

  • the length of the solution is an underestimate of the actual solution
  • length. Why?

Action a effects (B=F, C=T)

Slide 57

slide-55
SLIDE 55

58

slide-56
SLIDE 56

Heur uristics f for F Forwar ward P Planni nning ng: igno gnore del delete-lis list

  • One strategy to find an admissible heuristics is
  • to relax the original problem
  • One way : remove all the effects that make a variable = F.
  • If we find the path from the initial state to the goal using

this relaxed version of the actions:

  • the length of the solution is an underestimate of the actual solution length
  • Why?

Action a effects (B=F, C=T)

S0 A = T B = F C = F Goal A = T B = T C = T

Slide 59

slide-57
SLIDE 57

Heur uristics f for F Forwar ward P Planni nning ng: igno gnore del delete-lis list

  • One strategy to find an admissible heuristics is
  • to relax the original problem
  • One way : remove all the effects that make a variable = F.
  • If we find the path from the initial state to the goal using

this relaxed version of the actions:

  • the length of the solution is an underestimate of the actual solution length
  • Why? In the original problem, one action (e.g. a above) might undo an

already achieved goal (e.g. by a1 below)

Action a effects (B=F, C=T)

S0 A = T B = F C = F Goal A = T B = T C = T

Slide 60

slide-58
SLIDE 58

Heur uristics f for F Forwar ward P Planni nning ng: igno gnore del delete-lis list

  • One strategy to find an admissible heuristics is
  • to relax the original problem
  • One way : remove all the effects that make a variable = F.
  • If we find the path from the initial state to the goal using

this relaxed version of the actions:

  • the length of the solution is an underestimate of the actual solution length
  • Why? In the original problem, one action (e.g. a above) might undo an

already achieved goal (e.g. by a1 below). It would have to be achieved again

Action a effects (B=F, C=T)

A = T B = F C = F A = T B = T C = T a1 B = T a C = T B = F

Slide 61

S0 Goal

slide-59
SLIDE 59

Exam ampl ple f e for

  • r i

ignor gnore-del delete-lis list

  • Let’s stay in the robot domain
  • But say our robot has to bring coffee to Bob, Sue, and

Steve:

  • G = {bob_has_coffee, sue_has_coffee,

steve_has_coffee}

  • They all sit in different offices
  • Original actions

“pick-up coffee” achieves rhc = T “deliver coffee” achieves rhc = F

  • “Ignore delete lists” ⇔ remove rhc = F from “deliver

coffee”

once you have coffee you keep it Problem gets easier: only need to pick up coffee once, navigate to the right locations, and deliver

Slide 62

slide-60
SLIDE 60

Heur uristics f for F Forwar ward P Planni nning ng: igno gnore del delete-lis list

But how do we compute the actual heuristics values for ignore delete-list ?

Slide 63

slide-61
SLIDE 61

Heur uristics f for F Forwar ward P Planni nning ng: igno gnore del delete-lis list

But how do we compute the actual heuristics values for ignore delete-list?

  • To compute h(si), run forward planner with
  • si as start state
  • Same goal as original problem
  • Actions without “delete list”
  • Often fast enough to be worthwhile

Planning is PSPACE-hard (that’s really hard, includes NP-hard) Without delete lists: often very fast

Slide 64

slide-62
SLIDE 62

Example P e Planne nner

  • FF or Fast Forward
  • Jörg Hoffmann: Where 'Ignoring Delete Lists' Works: Local Search

Topology in Planning Benchmarks. J. Artif. Intell. Res. (JAIR) 24: 685-758 (2005)

  • Winner of the 2001 AIPS Planning Competition
  • Estimates the heuristics by solving the relaxed planning

problem with a planning graph method (next class)

  • Uses Best First search with this heuristic to find a

solution

Slide 65

slide-63
SLIDE 63

Fina nal C Comm

  • mment
  • You should view Forward Planning as one of the basic

planning techniques (we’ll see another one next week)

  • By itself, it cannot go far, but it can work very well in

combination with other techniques, for specific domains

  • See, for instance, descriptions of competing planners in the

presentation of results for the 2002 and 2008 planning competition (posted in the class schedule)

Slide 66

slide-64
SLIDE 64

Lea Learning G Goal

  • als for P
  • r Plan

anning s so

  • Far

ar

  • Included in midterm
  • Represent a planning problem with the STRIPS representation
  • Explain the STRIPS assumption
  • Solve a planning problem by search (forward planning).

Specify states, successor function, goal test and solution.

  • Construct and justify a heuristic function for forward planning