ai.worlds.wumpus
Class DefaultWumpusLogic

java.lang.Object
  extended byai.worlds.wumpus.WumpusLogic
      extended byai.worlds.wumpus.DefaultWumpusLogic

public class DefaultWumpusLogic
extends WumpusLogic

A generic wumpus logic unit. This code must be completed to perform logical reasoning.

Author:
Jill Zimmerman -- jill.zimmerman@goucher.edu

Nested Class Summary
 
Nested classes inherited from class ai.worlds.wumpus.WumpusLogic
WumpusLogic.PathProblemState
 
Field Summary
 
Fields inherited from class ai.worlds.wumpus.WumpusLogic
agentloc, grid, kb, size, wumpgrid
 
Constructor Summary
DefaultWumpusLogic(int x, int y)
           
 
Method Summary
 Location closestMove(java.util.Vector moves)
          Find the closest move from a list.
 void makeKB(HornKnowledgeBase kb)
          Make a knowledge base.
 Location nextMove()
          Determine the next location the agent will visit.
 java.util.Vector pathTo(Location loc, Location heading)
          Determine the sequence of actions which will take the agent to the given location.
 
Methods inherited from class ai.worlds.wumpus.WumpusLogic
display, distance, getStatus, move, okayMoves, percept, riskyMoves, succeeded, visited
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWumpusLogic

public DefaultWumpusLogic(int x,
                          int y)
Method Detail

makeKB

public void makeKB(HornKnowledgeBase kb)
Make a knowledge base.

Specified by:
makeKB in class WumpusLogic
Parameters:
kb - is the knowledge base that will be constructed.

closestMove

public Location closestMove(java.util.Vector moves)
Find the closest move from a list.

Specified by:
closestMove in class WumpusLogic
Parameters:
moves - is a list of locations to which the agent can move.
Returns:
the move that is closest to the agent's current location.

nextMove

public Location nextMove()
Determine the next location the agent will visit.

Specified by:
nextMove in class WumpusLogic
Returns:
the location that the agent will move to next.

pathTo

public java.util.Vector pathTo(Location loc,
                               Location heading)
Determine the sequence of actions which will take the agent to the given location.

Specified by:
pathTo in class WumpusLogic
Parameters:
loc - is the location we wish to travel to.
heading - is the agent's current heading.
Returns:
the sequence of actions which will take the agent to the given location.