uk.ac.ed.inf.sdp2012.group7.strategy.astar.heuristics
Class ClosestHeuristic

java.lang.Object
  extended by uk.ac.ed.inf.sdp2012.group7.strategy.astar.heuristics.ClosestHeuristic
All Implemented Interfaces:
OldAStarHeuristic

public class ClosestHeuristic
extends java.lang.Object
implements OldAStarHeuristic

A heuristic that uses the tile that is closest to the target as the next best tile.


Constructor Summary
ClosestHeuristic()
           
 
Method Summary
 float getEstimatedDistanceToGoal(int startX, int startY, int goalX, int goalY)
          The heuristic tries to guess how far a given Node is from the goal Node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClosestHeuristic

public ClosestHeuristic()
Method Detail

getEstimatedDistanceToGoal

public float getEstimatedDistanceToGoal(int startX,
                                        int startY,
                                        int goalX,
                                        int goalY)
Description copied from interface: OldAStarHeuristic
The heuristic tries to guess how far a given Node is from the goal Node. The lower the cost, the more likely a Node will be searched next.

Specified by:
getEstimatedDistanceToGoal in interface OldAStarHeuristic
Returns:
The cost associated with the given tile