+ All Categories
Home > Documents > Chapter 4 - Planning

Chapter 4 - Planning

Date post: 30-Dec-2015
Category:
Upload: sylvester-haynes
View: 45 times
Download: 0 times
Share this document with a friend
Description:
Part II: Methods of AI. Chapter 4 - Planning. 4.1 State Space Planning. 4.2 Partial Order Planning. 4.3Planning in the Real World. Partial Order Planning (POP). See: Russell, Norvig, AI; chapter 11. a. b. c. c. a. b. Partial Plans. - PowerPoint PPT Presentation
Popular Tags:
22
Chapter 4 - Planning 4.1 State Space Planning 4.2 Partial Order Planning 4.3 Planning in the Real World Part II: Methods of AI Part II: Methods of AI
Transcript
Page 1: Chapter 4 - Planning

Chapter 4 - Planning

4.1 State Space Planning

4.2 Partial Order Planning

4.3 Planning in the Real World

Part II: Methods of AIPart II: Methods of AI

Page 2: Chapter 4 - Planning

Partial Order Planning (POP)Partial Order Planning (POP)

See: Russell, Norvig, AI; chapter 11

Page 3: Chapter 4 - Planning

Partial Plans

► Partial plan: a partially ordered set of operator instances

The partial order gives only some constraints on the order in which the operations have to be performed

► Start a dummy operator

► Finish another dummy operator

Start

pickup(b)

unstack(?x, a)putdown(?y) pickup(a)

stack(b, c)stack(a, b) Finish

c

ba

a

b

c

Page 4: Chapter 4 - Planning

Partial Plans

clear(a)

?x = ?y,?y = c

► Partial plans can also contain the following information:

?x = ?y,?y = c

♦ causal links

often called protected conditions

Start

pickup(b)

unstack(?x, a)putdown(?y) pickup(a)

stack(b, c)stack(a,b) Finish

♦ variable binding constraints

clear(a)unstack(?x, a)

pickup(a)

Page 5: Chapter 4 - Planning

Transform Partial Order Plan into Transform Partial Order Plan into Total-order Plan:Total-order Plan:

Start

LeftSock

LeftShoe

RightShoe

RightSock

Finish

LeftSockOn RightSockOn

LeftShoeOn, RightShoeOn

Start Start Start Start Start Start

LeftShoe

RightShoe

LeftSock

Finish Finish Finish Finish Finish

LeftSock

LeftSock

LeftSock

RightSock

RightSock

RightSock

LeftSock

RightShoe

RightSock

RightSock

LeftShoe

LeftShoe

LeftSock

RightShoe

RightShoe

RightSock

RightShoe

LeftShoe

LeftShoe

LeftShoe

RightShoe

Finish

Page 6: Chapter 4 - Planning

A - actionsO - order constraintsL – linksagenda - set of goalsQ - preconds of A

The Poplan AlgorithmThe Poplan AlgorithmPOP(<A,O,L>, agenda)

2. Goal selection: Let <Q,Aneed> be a pair on the agenda

3. Action selection: Let Aadd = choose an action that adds Qif no such action exists, then return failure

Let L’= L {Aadd → Aneed}, and let O’ = O {Aadd < Aneed}.If Aadd is newly instantiated, then A’ = A {Aadd} and

O’ = O {A0 < Aadd < A} (otherwise, A’ = A)4. Updating of goal set: Let agenda’ = agenda -{<Q,Aneed>}.If Aadd is newly instantiated, then for each conjunction, Qi,

of its precondition, add <Qi,Aneed> to agenda’5. Causal link protection: For every action At that might

threaten a causal link Ap → Ac, add a consistentordering constraint, either

(a) Demotion: Add At < Ap to O’(b) Promotion: Add Ac < At to O’ (c) Inequality constraintsIf neither constraint is consistent, then return failure6. Recursive invocation: POP((<A’,O’,L’>, agenda’, )

1. Termination: If agenda is empty return <A,O,L>

Page 7: Chapter 4 - Planning

THREATS THREATS

DEFINITION: Let s t be a causal link with condition c in a partial plan P.

Suppose P also contains a step r with an effect q such that

consistentP (s r ) and consistentP ( r t )

i.e., P’s ordering constraints allow putting r between s and t

Suppose q is unifiable with ~c, and P ’s variable-binding constraints

do not prevent us from unifying it either

Then r is a threat to the causal link s t

Page 8: Chapter 4 - Planning

Threats: Example Threats: Example

r = stack( b,?z) below is a threat to the causal link clear (a)

?x = ?y?y = c

Threats “threaten” correctness!

clear(a)Start

unstack(?x,a)putdown(?y) pickup(a)

stack(b,?z)Finish

Page 9: Chapter 4 - Planning

Threat Detection and Removal (1)Threat Detection and Removal (1)

• Detection: for each causal link s t and for each step r,

check positive and negative threats

• Threat removal:

• (i) demotion, (ii) promotion and (iii) separation

(i) Demotion: order r before s

?x=?y, ?y=c

putdown(?y)stack(b,?z)

pickup(a)

Start Finish

unstack(?x,a)

clear(a)

Page 10: Chapter 4 - Planning

Threat Detection and RemovalThreat Detection and Removal

(ii) Promotion: order r after t

(iii) Separation: introduce a variable-binding constraint

?x=?y, ?y=c

putdown(?y)

pickup(a)

StartFinish

unstack(?x,a)

clear(a)

stack(b,?z)

?x = ?y?y = c?z a

clear(a)Start

unstack(?x,a)putdown(?y) pickup(a)

stack(b,?z)Finish

Page 11: Chapter 4 - Planning

POPLAN Search Space (1)POPLAN Search Space (1)

on(c,a)ontable(a)clear(c)ontable(b)clear(b)handempty

A C

B

A

B

C

Start Finish

on(b,c)on(a,b)clear(a)

Page 12: Chapter 4 - Planning

Poplan Search Space (2)Poplan Search Space (2)

Start

Start Finish

Finish

Start

Start

Start

unstack(c,a)

unstack(c,a)

putdown(c)unstack(c,a)

unstack(c,a)

putdown(c)

putdown(c)

pickup(b)

pickup(b)

stack(b,c)

stack(a,b)

Finish

Finish

Finish

pickup(a)

stack(b,c)

... ...

......

Page 13: Chapter 4 - Planning

Plan Space SearchPlan Space Search

Move B to CMove A to B

Move A to Table,Move A to B

Move C to Table,Move B to CMove A to B

Move A to B

Page 14: Chapter 4 - Planning

State-Space SearchState-Space Search

CAB

CBA

ABC

BAC

ACB

BCA

A B

C

B C

A

A C

BA B

C

A C

B

B C

A

A B C

Initialstate

Goal

Page 15: Chapter 4 - Planning

Another ExampleAnother Example

• At(Home)• Sells(SM, Banana)• Sells(HS, Drill)• Have(Drill)• Have(Milk)• Have(Banana)

SM: Super MarketHS: Hardware Store

Page 16: Chapter 4 - Planning

Partial Order PlanningPartial Order Planning

Start

End

Buy(Banana) Buy(Milk) Buy(Drill)

At(Home) Have(Banana) Have(Milk) Have(Drill)

Causal links

At(Home)

Page 17: Chapter 4 - Planning

Refining the Plan (1)Refining the Plan (1)

Start

End

Buy(Banana) Buy(Milk) Buy(Drill)

At(Home) Have(Banana) Have(Milk) Have(Drill)

At(s) At(s) At(s) Sells(s,Drill)Sells(s,Milk)Sells(s,Banana)

NB: all causal linksare also ordering links

Ordering links

Causal links

At(Home)

Page 18: Chapter 4 - Planning

Refining the Plan (2)Refining the Plan (2)

Start

End

Buy(Banana) Buy(Milk) Buy(Drill)

At(Home) Have(Banana) Have(Milk) Have(Drill)

At(SM) At(SM) At(HWS) Sells(HWS,Drill)Sells(SM,Milk)Sells(SM,Banana)

NB: all causal linksare also ordering links

Causal links

At(Home)

Page 19: Chapter 4 - Planning

Refining the Plan (3)Refining the Plan (3)

Start

End

Buy(Banana) Buy(Milk) Buy(Drill)

At(Home) Have(Banana) Have(Milk) Have(Drill)

Go(SM) Go(HWS)

At(s) At(s)

At(SM) At(SM) At(HWS) Sells(HWS,Drill)Sells(SM,Milk)Sells(SM,Banana)

At(Home)

Page 20: Chapter 4 - Planning

Refining the Plan (4)Refining the Plan (4)

Start

End

Buy(Banana) Buy(Milk) Buy(Drill)

At(Home) Have(Banana) Have(Milk) Have(Drill)

Go(SM) Go(HWS)

At(Home) At(Home)

At(SM) At(SM) At(HWS) Sells(HWS,Drill)Sells(SM,Milk)Sells(SM,Banana)

At(Home)

Page 21: Chapter 4 - Planning

Threats to Causal LinksThreats to Causal Links

Start

End

Buy(Banana) Buy(Milk) Buy(Drill)

At(Home) Have(Banana) Have(Milk) Have(Drill)

Go(SM) Go(HWS)

At(Home) At(Home)

At(SM) At(SM) At(HWS) Sells(HWS,Drill)Sells(SM,Milk)Sells(SM,Banana)

At(Home)

Page 22: Chapter 4 - Planning

Threats to Causal Links: DemotionThreats to Causal Links: Demotion

Start

End

Buy(Banana) Buy(Milk) Buy(Drill)

At(Home) Have(Banana) Have(Milk) Have(Drill)

Go(SM) Go(HWS)

At(HWS) At(Home)

At(SM) At(SM) At(HWS) Sells(HWS,Drill)Sells(SM,Milk)Sells(SM,Banana)

Go(Home)

At(SM)

At(Home)


Recommended