p /acting in real world -...

36
PLANNING/ACTING IN REAL WORLD Chapter 11

Upload: others

Post on 04-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

PLANNING/ACTING IN REAL WORLD

Chapter 11

Page 2: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Topics

• The real world • Time, schedules, resources • Hierarchical planning • Planning in nondeterministic domains • Multi-agent planning

Page 3: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

The real world

~Flat(Spare) Intact(Spare) Off(Spare) On(Tire1) Flat(Tire1)

START FINISH

On(x) ~Flat(x)

Remove(x)

On(x)

Off(x) ClearHub

Puton(x)

Off(x) ClearHub

On(x) ~ClearHub

Inflate(x)

Intact(x) Flat(x)

~Flat(x)

Chapter 12.3 - 12.5 3

Page 4: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Things go wrong

Incomplete informationUnknown preconditions, e.g., Intact(Spare)?Disjunctive effects, e.g., Inflate(x) causes

Inflated(x) ∨ SlowHiss(x) ∨ Burst(x) ∨ BrokenPump ∨ . . .

Incorrect informationCurrent state incorrect, e.g., spare NOT intactMissing/incorrect postconditions in operators

Qualification problem:can never finish listing all the required preconditions andpossible conditional outcomes of actions

Chapter 12.3 - 12.5 4

Page 5: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Time, Schedule, Resources

Page 6: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Hierarchical Planning – High Level Actions

Reachable states Goal achievement

Page 7: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Planning and Acting with Nondeterminism

• Conformant planning (w/o observations) • Contingency planning (for partially

observable/nondeterministic environments) • Online planning/replanning (for unknown

environments)

Page 8: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Indeterminacy in the World

Bounded indeterminacy: actions can have unpredictable effects, but the pos-sible effects can be listed in the action description axioms

Unbounded indeterminacy: set of possible preconditions or effects either isunknown or is too large to be completely enumerated

Closely related to qualification problem

Chapter 12.3 - 12.5 5

Page 9: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Solutions

Conformant or sensorless planningDevise a plan that works regardless of state or outcome

Such plans may not exist

Conditional planningPlan to obtain information (observation actions)Subplan for each contingency, e.g.,[Check(Tire1), if Intact(Tire1) then Inflate(Tire1) else CallAAA

Expensive because it plans for many unlikely cases

Monitoring/ReplanningAssume normal states, outcomesCheck progress during execution, replan if necessary

Unanticipated outcomes may lead to failure (e.g., no AAA card)

(Really need a combination; plan for likely/serious eventualities,deal with others when they arise, as they must eventually)

Chapter 12.3 - 12.5 6

Page 10: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Conformant planning

Search in space of belief states (sets of possible actual states)L

R

L R

S

L RS S

S S

R

L

S S

L

R

R

L

R

L

Chapter 12.3 - 12.5 7

Page 11: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Conditional planning

If the world is nondeterministic or partially observablethen percepts usually provide information,i.e., split up the belief state

ACTION PERCEPT

Chapter 12.3 - 12.5 8

Page 12: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Conditional planning (con’t.)

Conditional plans check (any consequence of KB +) percept

[. . . , if C then PlanA else PlanB, . . .]

Execution: check C against current KB, execute “then” or “else”

Chapter 12.3 - 12.5 9

Page 13: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Conditional planning (con’t.)

Need to handle nondeterminism by building into the plan conditional stepsthat check the state of the environment at run time, and then decide whatto do.

Augment STRIPS to allow for nondeterminism:Add Disjunctive effects (e.g., to model when action sometimes fails):

Action(Left, Precond:AtR, Effect: AtL ∨ AtR)Add Conditional effects (i.e., depends on state in which it’s executed):

Form: when <condition> : <effect>

Action(Suck, Precond:,Effect: (when AtL: CleanL) ∧ (when AtR: CleanR))

Create Conditional steps:if <test> then plan-A else plan-B

Chapter 12.3 - 12.5 10

Page 14: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Conditional planning (con’t.)

Need some plan for every possible percept and action outcome

(Cf. game playing: some response for every opponent move)(Cf. backward chaining: some rule such that every premise satisfied

Use: AND–OR tree search (very similar to backward chaining algorithm)Similar to game tree in minimax searchDifferences: Max and Min nodes become Or and And nodes

Robot takes action in “state” nodes.

Nature decides outcome at “chance” nodes.

Plan needs to take some action at every state it reaches (i.e., Or nodes)

Plan must handle every outcome for the action it takes (i.e., And nodes)

Solution is a subtree with (1) goal node at every leaf, (2) one action specifiedat each state node, and (3) includes every outcome branch at chance nodes.

Chapter 12.3 - 12.5 11

Page 15: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Example: “Game Tree”, Fully Observable World

Double Murphy: sucking or arriving may dirty a clean square

8

3 6 8 7

1 5 7 8 4 2

Left Suck

Right Suck Left SuckGOAL

GOAL

LOOP

LOOP

Plan: [Left, if AtL ∧ CleanL ∧ CleanR then [] else Suck ]

Chapter 12.3 - 12.5 12

Page 16: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Example

Triple Murphy: also sometimes stays put instead of moving

8

Left Suck

6 3 7

GOAL

[L1 : Left, if AtR then L1 else [if CleanL then [ ] else Suck]]

or [while AtR do [Left], if CleanL then [ ] else Suck]

“Infinite loop” but will eventually work unless action always fails

Chapter 12.3 - 12.5 13

Page 17: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Execution Monitoring

“Failure” = preconditions of remaining plan not met

Preconditions of remaining plan= all preconditions of remaining steps not achieved by remaining steps= all causal links crossing current time point

On failure, resume POP to achieve open conditions from current state

IPEM (Integrated Planning, Execution, and Monitoring):keep updating Start to match current statelinks from actions replaced by links from Start when done

Chapter 12.3 - 12.5 14

Page 18: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Example

At(SM)

At(Home)

At(HWS)

Buy(Drill)

Buy(Milk) Buy(Ban.)

Go(Home)

Go(HWS)

Go(SM)

Finish

Start

Sells(SM,Milk)

At(Home) Have(Ban.) Have(Drill)Have(Milk)

Sells(SM,Milk)At(SM) Sells(SM,Ban.)At(SM)

Sells(HWS,Drill)At(HWS)

At(Home)

Sells(SM,Ban.)Sells(HWS,Drill)

Chapter 12.3 - 12.5 15

Page 19: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Example

At(SM)

At(HWS)

Buy(Drill)

Buy(Milk) Buy(Ban.)

Go(Home)

Go(HWS)

Go(SM)

Finish

Start

Sells(SM,Milk)

At(Home) Have(Ban.) Have(Drill)Have(Milk)

Sells(SM,Milk)At(SM) Sells(SM,Ban.)At(SM)

Sells(HWS,Drill)At(HWS)

Sells(SM,Ban.)Sells(HWS,Drill)At(HWS)

At(Home)

Chapter 12.3 - 12.5 16

Page 20: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Example

At(SM)

At(Home)

At(HWS)

Buy(Drill)

Buy(Milk) Buy(Ban.)

Go(Home)

Go(HWS)

Go(SM)

Finish

Start

At(HWS)Have(Drill)Sells(SM,Ban.)Sells(SM,Milk)

At(Home) Have(Ban.) Have(Drill)Have(Milk)

Sells(SM,Milk)At(SM) Sells(SM,Ban.)At(SM)

Sells(HWS,Drill)At(HWS)

Chapter 12.3 - 12.5 17

Page 21: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Example

At(SM)

At(Home)

At(HWS)

Buy(Drill)

Buy(Milk) Buy(Ban.)

Go(Home)

Go(HWS)

Go(SM)

Finish

Start

Have(Drill)Sells(SM,Ban.)Sells(SM,Milk)

At(Home) Have(Ban.) Have(Drill)Have(Milk)

Sells(SM,Milk)At(SM) Sells(SM,Ban.)At(SM)

Sells(HWS,Drill)At(HWS)

At(SM)

Chapter 12.3 - 12.5 18

Page 22: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Example

At(SM)

At(Home)

At(HWS)

Buy(Drill)

Buy(Milk) Buy(Ban.)

Go(Home)

Go(HWS)

Go(SM)

Finish

Start

Have(Drill)

At(Home) Have(Ban.) Have(Drill)Have(Milk)

Sells(SM,Milk)At(SM) Sells(SM,Ban.)At(SM)

Sells(HWS,Drill)At(HWS)

At(SM)

Have(Ban.)Have(Milk)

Chapter 12.3 - 12.5 19

Page 23: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Example

At(SM)

At(Home)

At(HWS)

Buy(Drill)

Buy(Milk) Buy(Ban.)

Go(Home)

Go(HWS)

Go(SM)

Finish

Start

Have(Drill)At(Home) Have(Ban.) Have(Drill)Have(Milk)

Sells(SM,Milk)At(SM) Sells(SM,Ban.)At(SM)

Sells(HWS,Drill)At(HWS)

Have(Ban.)Have(Milk)

At(Home)

Chapter 12.3 - 12.5 20

Page 24: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Emergent behavior

START

Get(Red)

Color(Chair,Blue) ~Have(Red)

Paint(Red)

Have(Red)

FINISH

Color(Chair,Red)

FAILURE RESPONSE

Have(Red)

PRECONDITIONS

Fetch more red

Chapter 12.3 - 12.5 21

Page 25: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Emergent behavior

START

Get(Red)

Color(Chair,Blue) ~Have(Red)

Paint(Red)

Have(Red)

FINISH

Color(Chair,Red)

FAILURE RESPONSE PRECONDITIONS

Color(Chair,Red) Extra coat of paint

Chapter 12.3 - 12.5 22

Page 26: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Emergent behavior

START

Get(Red)

Color(Chair,Blue) ~Have(Red)

Paint(Red)

Have(Red)

FINISH

Color(Chair,Red)

FAILURE RESPONSE PRECONDITIONS

Color(Chair,Red) Extra coat of paint

“Loop until success” behavior emerges from interaction between monitor/replanagent design and uncooperative environment

Chapter 12.3 - 12.5 23

Page 27: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Summarizing Example

Assume: You have a chair, a table, and some cans of paint; all colors areunknown. Goal: chair and table have same color.

How would each of the following handle this problem?

Classical planning:

Chapter 12.3 - 12.5 24

Page 28: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Summarizing Example

Assume: You have a chair, a table, and some cans of paint; all colors areunknown. Goal: chair and table have same color.

How would each of the following handle this problem?

Classical planning: Can’t handle it, because initial state isn’t fully specified.

Chapter 12.3 - 12.5 25

Page 29: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Summarizing Example

Assume: You have a chair, a table, and some cans of paint; all colors areunknown. Goal: chair and table have same color.

How would each of the following handle this problem?

Classical planning: Can’t handle it, because initial state isn’t fully specified.

Sensorless/Conformant planning:

Chapter 12.3 - 12.5 26

Page 30: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Summarizing Example

Assume: You have a chair, a table, and some cans of paint; all colors areunknown. Goal: chair and table have same color.

How would each of the following handle this problem?

Classical planning: Can’t handle it, because initial state isn’t fully specified.

Sensorless/Conformant planning: Open can of paint and apply it to bothchair and table.

Chapter 12.3 - 12.5 27

Page 31: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Summarizing Example

Assume: You have a chair, a table, and some cans of paint; all colors areunknown. Goal: chair and table have same color.

How would each of the following handle this problem?

Classical planning: Can’t handle it, because initial state isn’t fully specified.

Sensorless/Conformant planning: Open can of paint and apply it to bothchair and table.

Conditional planning:

Chapter 12.3 - 12.5 28

Page 32: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Summarizing Example

Assume: You have a chair, a table, and some cans of paint; all colors areunknown. Goal: chair and table have same color.

How would each of the following handle this problem?

Classical planning: Can’t handle it, because initial state isn’t fully specified.

Sensorless/Conformant planning: Open can of paint and apply it to bothchair and table.

Conditional planning: Sense the color of the table and chair. If same, thenwe’re done. If not, sense labels on the paint cans; if there is a can that isthe same color as one piece of furniture, then apply the paint to the otherpiece. Otherwise, paint both pieces with any color.

Chapter 12.3 - 12.5 29

Page 33: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Summarizing Example

Assume: You have a chair, a table, and some cans of paint; all colors areunknown. Goal: chair and table have same color.

How would each of the following handle this problem?

Classical planning: Can’t handle it, because initial state isn’t fully specified.

Sensorless/Conformant planning: Open can of paint and apply it to bothchair and table.

Conditional planning: Sense the color of the table and chair. If same, thenwe’re done. If not, sense labels on the paint cans; if there is a can that isthe same color as one piece of furniture, then apply the paint to the otherpiece. Otherwise, paint both pieces with any color.

Monintoring/replanning:

Chapter 12.3 - 12.5 30

Page 34: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Summarizing Example

Assume: You have a chair, a table, and some cans of paint; all colors areunknown. Goal: chair and table have same color.

How would each of the following handle this problem?

Classical planning: Can’t handle it, because initial state isn’t fully specified.

Sensorless/Conformant planning: Open can of paint and apply it to bothchair and table.

Conditional planning: Sense the color of the table and chair. If same, thenwe’re done. If not, sense labels on the paint cans; if there is a can that isthe same color as one piece of furniture, then apply the paint to the otherpiece. Otherwise, paint both pieces with any color.

Monintoring/replanning: Similar to conditional planner, but perhaps withfewer branches at first, which are filled in as needed at runtime. Also, wouldcheck for unexpected outcomes (e.g., missed a spot in painting, so repaint)

Chapter 12.3 - 12.5 31

Page 35: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Summary

♦ Incomplete info: use conditional plans, conformant planning (can usebelief states)

♦ Incorrect info: use execution monitoring and replanning

Chapter 12.3 - 12.5 32

Page 36: P /ACTING IN REAL WORLD - UTKweb.eecs.utk.edu/~leparker/Courses/CS594-fall13/Lectures/13-Real-World-Planning-Oct-22.pdfOn failure, resume POP to achieve open conditions from current

Multiagent Planning

• Multieffector planning • Multibody planning • Decentralized planning • Coordination, cooperation • Multiactor settings • Joint actions/joint plans