edu.ou.pacman.heuristic
Class GhostPathFinding

java.lang.Object
  extended by edu.ou.pacman.heuristic.GhostPathFinding

public final class GhostPathFinding
extends java.lang.Object

Class to house static methods for pac-man's pathfinding heuristic methods.

Author:
Derek Rushing

Constructor Summary
GhostPathFinding()
           
 
Method Summary
static Direction aStar(GameBoard board, CharacterType character)
          Method to determine the direction a player should go using the aStar algorithm.
static Direction greedyBestFirst(GameBoard board, CharacterType character)
          Method to determine the direction a player should go using the greedy best first search algorithm.
static Direction pacmanFinder(GameBoard board, CharacterType character)
          Check pacman's current location and follow him, regardless of him being powered up.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GhostPathFinding

public GhostPathFinding()
Method Detail

aStar

public static Direction aStar(GameBoard board,
                              CharacterType character)
Method to determine the direction a player should go using the aStar algorithm.

Parameters:
board - - The board to traverse.
character - - The character to determine a direction for
Returns:
The direction to move the player.

greedyBestFirst

public static Direction greedyBestFirst(GameBoard board,
                                        CharacterType character)
Method to determine the direction a player should go using the greedy best first search algorithm.

Parameters:
board - - The board to traverse.
character - - The character to determine a direction for
Returns:
The direction to move the player.

pacmanFinder

public static Direction pacmanFinder(GameBoard board,
                                     CharacterType character)
Check pacman's current location and follow him, regardless of him being powered up. Not an efficient algorithm, but does not get stuck in any set location. Ghosts all have different directions to start with before choosing a random one if necessary.

Parameters:
board - - The game board
character - - The character to choose a direction for
Returns:
The direction pacman should be move.