40 likes | 200 Views
Chapter 4 Practical Reasoning Agents. CSE 431 – Intelligent Agents. 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(C,Table) On(B,C) On(A,B)
E N D
Chapter 4Practical Reasoning Agents CSE 431 – Intelligent Agents
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(C,Table) On(B,C) 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))
Practical Reasoning Agent B B0;I I0;while true do get next percept p through see() function; B brf(B, p)D options(B,I); I filter(B,D,I); plan(B,I,Ac); while not (empty() or succeeded(I,B) or impossible(I,B)) do hd(); execute(); tail(); get next percept p through see() function; B brf(B, p); if reconsider(I,B) then D options(B,I); I filter(B,D,I); end-if if not sound(,I,B) then plan(B,I,Ac) end-if end-whileend-while From Fig. 4.3, p. 76