Presentation is loading. Please wait.

Presentation is loading. Please wait.

Supplemental slides for CSE 327 Prof. Jeff Heflin

Similar presentations


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

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

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

3 Blocks World Example initial state goal actions
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 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) 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)) 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 goal state actions
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
Move(A,T,B) MoveToTable(B,C) Move(A,T,C) Move(B,T,A) Move(B,C,A) On(A,T) ^ On(B,T) ^ On(C,T) ^ Clear(A) ^ Clear(B) ^ Clear(C) ^ Clear(T) Move(B,T,C) On(A,T) ^ On(B,T) ^ On(C,T) ^ Clear(A) ^ Clear(B) ^ Clear(C) ^ Clear(T) ^ On(B,C) Move(A,T,B) On(A,T) ^ On(C,T) ^ Clear(A) ^ Clear(B) ^ Clear(T) ^ On(B,C) ^ On(A,B) Move(A,T,A) Move(C,T,A) spurious actions Move(B,C,B) Move(C,T,B) MoveToTable(A,T) MoveToTable(A,T) MoveToTable(B,T) MoveToTable(C,T) spurious actions Move(A,T,A) Move(B,T,B) Move(C,T,C)

7 Backward State-Space Search
On(B,C) ^ On(A,B) ^ On(C,T) GOAL: MoveToTable(C,x) Move(B,x,C) xC Move(A,x,B) xB Move(C,x,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) ? ? Move(B,y,C) yC Move(A,y,B)? On(C,T) ^ On(A,x) ^ Clear(A) ^ Clear(B) ^ On(B,y) ^ Clear(C) INITIAL STATE: (if x=T and y= T) Not relevant: has effect delete Clear(B) 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) Missing from book From Fig. 10.8, p. 380

9 GraphPlan function GRAPHPLAN(problem) returns solution or failure graph  INITIAL-PLANNING-GRAPH(problem) goals  CONJUNCTS(problem.GOAL) nogoods  an empty hash table for t = 0 to  do if goals all non-mutex in St of graph then solution  EXTRACT-SOLUTION(graph, goals, NUMLEVELS(graph), nogoods) if graph and nogoods have both leveled off then return failure graph  EXPAND-GRAPH(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 , p. 384


Download ppt "Supplemental slides for CSE 327 Prof. Jeff Heflin"

Similar presentations


Ads by Google