Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ch. 10 – Planning Supplemental slides for CSE 327 Prof. Jeff Heflin.

Similar presentations


Presentation on theme: "Ch. 10 – Planning Supplemental slides for CSE 327 Prof. Jeff Heflin."— Presentation transcript:

1 Ch. 10 – Planning Supplemental slides for CSE 327 Prof. Jeff Heflin

2 Goal-Based Agent sensors actuators Agent Environment What the world is like now What action I should do now Goals State How the world evolves What my actions do What it will be like if I do action A From Fig. 2.13, p. 52

3 Blocks World Example initial state –On(A,Table)  On(B,Table)  Clear(A)  Clear(B)  Clear(Table)  Block(A)  Block(B) goal –On(A,B) actions Action(Move(b,x,y), Precond: On(b,x)  Clear(b)  Clear(y)  Block(y), Effect: On(b,y)  Clear(x)   On(b,x)   Clear(y)) Action(MoveToTable(b,x), Precond: On(b,x)  Clear(b), Effect: On(b,Table)  Clear(x)   On(b,x))

4 Applicable Actions Action(Move(b,x,y), Precond: On(b,x)  Clear(b)  Clear(y)  Block(y), Effect: On(b,y)  Clear(x)   On(b,x)   Clear(y)) Action(MoveToTable(b,x), Precond: On(b,x)  Clear(b), Effect: On(b,Table)  Clear(x)   On(b,x)) an action a is applicable in any state that satisfies the precondition e.g., Move(A,Table,B) is applicable in initial state –unify with action description –apply substitution  = {b/A, x/Table, y/B} to the action’s Precondition –initial state satisfies On(A,Table)  Clear(A)  Clear(B)  Block(B) Initial State: On(A,Table)  On(B,Table)  Clear(A)  Clear(B)  Clear(Table)  Block(A)  Block(B)

5 A Blocks World Problem initial state –On(A,Table)  On(B,Table)  On(C,Table)  Clear(A)  Clear(B)  Clear(C)  Clear(Table)  Block(A)  Block(B)  Block(C) goal state –On(B,C)  On(A,B)  On(C,Table) actions –Action(Move(b,x,y), Precond: On(b,x)  Clear(b)  Clear(y)  Block(y), Effect: On(b,y)  Clear(x)   On(b,x)   Clear(y)) –Action(MoveToTable(b,x), Precond: On(b,x)  Clear(b), Effect: On(b,Table)  Clear(x)   On(b,x))

6 Forward State-Space Search On(A,T) ^ On(B,T) ^ On(C,T) ^ Clear(A) ^ Clear(B) ^ Clear(C) ^ Clear(T) On(A,T) ^ On(B,T) ^ On(C,T) ^ Clear(A) ^ Clear(B) ^ Clear(C) ^ Clear(T) ^ On(B,C) On(A,T) ^ On(C,T) ^ Clear(A) ^ Clear(B) ^ Clear(T) ^ On(B,C) ^ On(A,B) Move(A,T,B) Move(A,T,C) Move(B,T,A) Move(C,T,A) Move(C,T,B) Move(A,T,A) Move(B,T,C) Move(B,T,B) Move(C,T,C) MoveToTable(A,T) MoveToTable(B,T) MoveToTable(C,T) spurious actions Move(A,T,B) Move(B,C,A) MoveToTable(B,C) Move(A,T,A) Move(B,C,B) MoveToTable(A,T) spurious actions

7 Backward State-Space Search On(B,C) ^ On(A,B) ^ On(C,T) On(A,B) ^ On(C,T) ^ On(B,x) ^ Clear(B) ^ Clear(C) On(B,C) ^ On(C,T) ^ On(A,x) ^ Clear(A) ^ Clear(B) On(C,T) ^ On(A,x) ^ Clear(A) ^ Clear(B) ^ On(B,y) ^ Clear(C) Move(B,x,C) x  C Move(A,x,B) x  B Move(B,y,C) y  C GOAL: INITIAL STATE: (if x=T and y= T) Move(A,y,B)? Not relevant: has effect delete Clear(B) ?? Move(C,x,T) MoveToTable(C,x) bold – literal that was added to the predecessor underline – goal is not satisfied by initial state

8 Planning Graph Example Init(Have(Cake) Goal(Have(Cake)  Eaten(Cake)) Action(Eat(Cake) PRECOND: Have(Cake) EFFECT:  Have(Cake)  Eaten(Cake)) Action(Bake(Cake) PRECOND:  Have(Cake) EFFECT: Have(Cake) From Fig. 10.8, p. 380 Missing from book

9 GraphPlan function G RAPH P LAN (problem) returns solution or failure graph  I NITIAL -P LANNING -G RAPH (problem) goals  C ONJUNCTS (problem.G OAL ) nogoods  an empty hash table for t = 0 to  do if goals all non-mutex in S t of graph then solution  E XTRACT -S OLUTION (graph, goals, N UM L EVELS (graph), nogoods) if solution ≠ failure then return solution if graph and nogoods have both leveled off then return failure graph  E XPAND -G RAPH (graph, problem) From Fig. 10.9, p. 383

10 Spare Tire Problem Init(Tire(Flat)  Tire(Spare)  At(Flat,Axle)  At(Spare,Trunk)) Goal(At(Spare,Axle)) Action(Remove(obj,loc), PRECOND: At(obj,loc), EFFECT:  At(obj,loc)  At(obj,Ground)) Action(PutOn(t, Axle), PRECOND: Tire(t)  At(t,Ground)   At(Flat,Axle), EFFECT:  At(t,Ground)  At(t,Axle)) Action(LeaveOvernight, PRECOND: , EFFECT:  At(Spare,Ground)   At(Spare,Axle)   At(Spare,Trunk)   At(Flat,Ground)   At(Flat,Axle)   At(Flat,Trunk)) From Fig. 10.2, p. 370

11 Spare Tire Planning Graph From Fig. 10.10, p. 384


Download ppt "Ch. 10 – Planning Supplemental slides for CSE 327 Prof. Jeff Heflin."

Similar presentations


Ads by Google