com.ebmwebsourcing.geasytools.geasygraph.impl.alphastar
Class AlphaStarPathFinder
java.lang.Object
com.ebmwebsourcing.geasytools.geasygraph.impl.PathFinder
com.ebmwebsourcing.geasytools.geasygraph.impl.alphastar.AlphaStarPathFinder
- All Implemented Interfaces:
- IAlphaStarPathFinder, IPathFinder
public class AlphaStarPathFinder
- extends PathFinder
- implements IAlphaStarPathFinder
Based on resource found at:
http://www.policyalmanac.org/games/aStarTutorial.htm
- Author:
- nfleury
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AlphaStarPathFinder
public AlphaStarPathFinder(IGraph graph,
INode source,
INode target)
getLowestCostNode
public IAlphaNode getLowestCostNode()
- Gets lowest cost node in open list
- Specified by:
getLowestCostNode in interface IAlphaStarPathFinder
- Returns:
getShortestPath
public java.util.LinkedHashSet<INode> getShortestPath()
- Specified by:
getShortestPath in interface IPathFinder- Specified by:
getShortestPath in class PathFinder
getGCost
public double getGCost(IAlphaNode node1,
IAlphaNode node2)
getHCost
public double getHCost(IAlphaNode node)
- Manhattan (only orthogonal movements) distance between a node and the
target destination
- Parameters:
node -
- Returns:
nodesAreOthogonal
public boolean nodesAreOthogonal(INode node1,
INode node2)
addNodeToOpenseList
public void addNodeToOpenseList(IAlphaNode node)
- Specified by:
addNodeToOpenseList in interface IAlphaStarPathFinder
addNodeToClosedList
public void addNodeToClosedList(IAlphaNode node)
- Specified by:
addNodeToClosedList in interface IAlphaStarPathFinder
getOpenList
public java.util.LinkedHashSet<IAlphaNode> getOpenList()
- Specified by:
getOpenList in interface IAlphaStarPathFinder
getClosedList
public java.util.LinkedHashSet<IAlphaNode> getClosedList()
- Specified by:
getClosedList in interface IAlphaStarPathFinder
Copyright © 2010-2011 Petals Link. All Rights Reserved.