400 likes | 556 Views
A SNePS Approach to The Wumpus World Agent or Cassie Meets the Wumpus. Stuart C. Shapiro & Michael Kandefer Department of Computer Science and Engineering, and Center for Cognitive Science University at Buffalo, The State University of New York 201 Bell Hall, Buffalo, NY 14260-2000
E N D
A SNePS Approach to The Wumpus World Agentor Cassie Meets the Wumpus Stuart C. Shapiro & Michael Kandefer Department of Computer Science and Engineering, and Center for Cognitive Science University at Buffalo, The State University of New York 201 Bell Hall, Buffalo, NY 14260-2000 {shapiro|mkw3}@cse.buffalo.edu http://www.cse.buffalo.edu/~{shapiro|mkw3}/
: perform get(gold) No breeze here. No stench here. Exploring the cave... Found a safe room... S. C. Shapiro & M. Kandefer
I am in room (1, 0), facing east No breeze here. No stench here. Exploring the cave... Found a safe room... S. C. Shapiro & M. Kandefer
I am in room (1, 1), facing south I feel a breeze. No stench here. Exploring the cave... Found a safe room... S. C. Shapiro & M. Kandefer
I am in room (0, 1), facing west No breeze here. No stench here. Exploring the cave... Found a safe room... S. C. Shapiro & M. Kandefer
I am in room (0, 2), facing south I feel a breeze. No stench here. Exploring the cave... Visiting an old room... This is boring. S. C. Shapiro & M. Kandefer
Exploring the cave... Visiting an old room... This is boring. S. C. Shapiro & M. Kandefer
Exploring the cave... Visiting an old room... This is boring. S. C. Shapiro & M. Kandefer
Exploring the cave... Found a safe room... S. C. Shapiro & M. Kandefer
I am in room (2, 0), facing east I feel a breeze. No stench here. Exploring the cave... Visiting an old room... This is boring. S. C. Shapiro & M. Kandefer
Exploring the cave... Visiting an old room... This is boring. S. C. Shapiro & M. Kandefer
Exploring the cave... Visiting an old room... This is boring. S. C. Shapiro & M. Kandefer
Exploring the cave... Visiting an old room... This is boring. S. C. Shapiro & M. Kandefer
Exploring the cave... I'll chance a move... S. C. Shapiro & M. Kandefer
I am in room (1, 2), facing south No breeze here. I'm grabbing for the gold. No stench here. I'm going home! S. C. Shapiro & M. Kandefer
Score = 966. S. C. Shapiro & M. Kandefer
Formalism Used • SNePS KRR system • SNeRE acting subsystem S. C. Shapiro & M. Kandefer
Strategy • Wander semi-randomly until find gold • Opportunistically shoot the wumpus • Grab the gold • Go home • Stop S. C. Shapiro & M. Kandefer
Semi-Random Exploration • If have an adjacent safe new room, go there • Else if totally bored, • Risk going to any adjacent new room • Might die! • If none move randomly (boring) • Else go to an old room (boring) S. C. Shapiro & M. Kandefer
Finding Home • Lay down VisitedFrom(r2, r1) “arrows” while exploring. • No two with same r2 to cut loops. • Follow backwards to find home. S. C. Shapiro & M. Kandefer
Finding Walls • Two walls adjacent to home room known • When bump, believe wall location S. C. Shapiro & M. Kandefer
Important SNePS Features 1 • First-person beliefs • Not third-person “truth” about agent or world • Beliefs are current beliefs • Even if about the past • On-line acting • Reified propositions as well as acts & … • Neither states nor times are privileged S. C. Shapiro & M. Kandefer
Important SNePS Features 2 • SNeRE acts with operational semantics • External acts: • go(right) • do(grab) • senseFor(breeze) • Control acts: • snsequence(go(right), go(right)) • Mental acts: • believe(p) • disbelieve(p) S. C. Shapiro & M. Kandefer
Important SNePS Features 3 • SNeRE policies integrate reasoning & acting • whendo(See(glitter), do(grab)) • ActPlan(find(home), snif({if(In(cell(0,0)), do(stop)), else(…)})) S. C. Shapiro & M. Kandefer
Important SNePS Features 4 Use of SNePS andor connective and belief revision for state constraints: andor(1,1){Facing(north), Facing(south), Facing(east), Facing(west)} Facing(east) => ~Facing(north), ~Facing(south), ~Facing(west) believe(Facing(south)) Facing(south), ~Facing(north), ~Facing(east), ~Facing(west) S. C. Shapiro & M. Kandefer
Important SNePS Features 5Nondeterministic Choice ~Have(gold) =>(all(r1)(In(r1) => ActPlan(explore(cave), withsome({?r2, ?d1}, SafeNewRoom(r1, ?r2, ?d1), snsequence3(turn(?d1), move(forward), believe(Bored(0))), <else clause>)))) S. C. Shapiro & M. Kandefer
Important SNePS Features 6Numerical Quantifier wheneverdo(Feel(breeze), withsome/3(?r, In(?r), believe(nexists(1,4,4)(c)({Adjacent(?r,c)}: {Contains(c,pit)})))) S. C. Shapiro & M. Kandefer
Problems • The SNePS control structure • Asynchronous • Multiprocessing • Producer/consumer • Message passing • Focused bidirectional inference • Made designing the agent, viewed as a programming task, somewhat difficult. S. C. Shapiro & M. Kandefer