CS340  Project 5 - Wumpus Agent Part II


Now that you have a wumpus knowledge-base, you need to complete the WumpusLogic methods closestMove, nextMove, and pathTo.


The method closestMove takes a Vector of moves, each move represented by a cell location. It determines which move is the closest to the agent's current location. Recall that the agent's current location is an instance variable to the WumpusLogic class.


The method nextMove returns a Location which will be the cell location where the agent wants to move to next.


The method pathTo takes a Location where the agent wants to move, and the agent's current heading and returns a Vector of moves (like "turn left", "forward", "turn right") which will take the agent to that Location. You will want to use the PathProblem class, which I have written for you, to solve this problem.


Now you should be ready to write your wumpus agent. Your wumpus agent class (which should be named with the usual conventions) should extend the WumpusAgent class that I have provided. You will most likely need an instance variable of your WumpusLogic class as part of your wumpus agent class. You can initialize this instance variable in the class constructor. You will need to write the determineAction method which will set the action instance variable inherited from the Agent class to one of the actions, "forward", "turn right", "turn left", "climb", "grab", and "shoot". You will need to use the methods of the WumpusLogic within determineAction to tell the WumpusLogic object the percepts of the agent, to tell the WumpusLogic object where the agent has moved, and to get the logical reasoning from the WumpusLogic object. The pathTo method will provide the agent with a list of moves which then must be returned one at a time, each time the determineAction method is invoked by the environment.


When you are satisfied with your code, e-mail your source code files (both the WumpusLogic and WumpusAgent) to me.