Package pfvisualizer.algorithms
Class JumpPointSearch
- java.lang.Object
-
- pfvisualizer.algorithms.Dijkstra
-
- pfvisualizer.algorithms.AStar
-
- pfvisualizer.algorithms.JumpPointSearch
-
- All Implemented Interfaces:
Pathfinder
public class JumpPointSearch extends AStar
Jump Point Search algorithm.
-
-
Field Summary
-
Fields inherited from class pfvisualizer.algorithms.Dijkstra
directions, end, grid, height, map, width
-
Fields inherited from interface pfvisualizer.algorithms.Pathfinder
CHECKED, DIAGONAL_DISTANCE, PATH, STRAIGHT_DISTANCE, UNVISITED, VISITED, WALL
-
-
Constructor Summary
Constructors Constructor Description JumpPointSearch()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildPath(Node node, int[][] map)Draws the path found by the algorithm to the map provided.protected floatgetDistanceBetween(Node first, Node second)Calculates the distance between two nodes.protected Node[]getSuccessors(Node node)Finds jump points.
-
-
-
Method Detail
-
buildPath
public void buildPath(Node node, int[][] map)
Description copied from interface:PathfinderDraws the path found by the algorithm to the map provided.- Parameters:
node- The end node of the pathmap- The map to draw the path into
-
getDistanceBetween
protected float getDistanceBetween(Node first, Node second)
Description copied from class:DijkstraCalculates the distance between two nodes.- Overrides:
getDistanceBetweenin classDijkstra- Parameters:
first- first nodesecond- second node- Returns:
- distance between the given nodes
-
getSuccessors
protected Node[] getSuccessors(Node node)
Finds jump points.- Overrides:
getSuccessorsin classDijkstra- Parameters:
node- the parent node- Returns:
- list of nodes that can be moved into from the parent node
-
-