edu.ou.pacman.client
Class DepthFirstClient

java.lang.Object
  extended by edu.ou.pacman.client.AbstractPacmanClient
      extended by edu.ou.pacman.client.DepthFirstClient
All Implemented Interfaces:
Client<ImmutablePacmanState,ImmutablePacmanCharacter,Direction>

public class DepthFirstClient
extends AbstractPacmanClient


Constructor Summary
DepthFirstClient()
           
 
Method Summary
 Direction DFS(javax.swing.tree.DefaultMutableTreeNode tree, ImmutablePacmanState world, ImmutablePacmanCharacter client, Location2D goalLocation)
          Method to recursively search a node following Depth First Search protocol.
 void endAction(ImmutablePacmanState world, ImmutablePacmanCharacter client)
           
 void initialize(java.io.File config)
           
 void loadData(java.io.File data)
           
 void shutdown()
           
 Direction startAction(ImmutablePacmanState world, ImmutablePacmanCharacter client)
           
 
Methods inherited from class edu.ou.pacman.client.AbstractPacmanClient
getDisplayName, setDisplayName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DepthFirstClient

public DepthFirstClient()
Method Detail

startAction

public Direction startAction(ImmutablePacmanState world,
                             ImmutablePacmanCharacter client)

DFS

public Direction DFS(javax.swing.tree.DefaultMutableTreeNode tree,
                     ImmutablePacmanState world,
                     ImmutablePacmanCharacter client,
                     Location2D goalLocation)
Method to recursively search a node following Depth First Search protocol. New locations added to the tree are assumed to be +/- 1, which isn't fully correct as you can wrap around the board.

Parameters:
tree - - The tree holding the locations
world - - The world state
client - - The client you are guiding
goalLocation - - The location you would like to reach
Returns:
The direction to take to get from the root node to the second node in the path.

endAction

public void endAction(ImmutablePacmanState world,
                      ImmutablePacmanCharacter client)

initialize

public void initialize(java.io.File config)

loadData

public void loadData(java.io.File data)

shutdown

public void shutdown()