Class AStar<T>
java.lang.Object
io.github.tigerbotics7125.tigerlib.math.graph.AStar<T>
This class represents an A* algorithm as a class, which can be used continueously over its Graph.
- Since:
- 2023
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGenerate the path from their Vertex to Vertex mapping.double
Shortcut for accessing the heuristic function.
-
Constructor Details
-
AStar
- Parameters:
graph
- The Graph of which this AStar instance will operate over.hFunc
- The function which calculates the heuristic from any two Verticies.
-
-
Method Details
-
h
Shortcut for accessing the heuristic function.- Parameters:
v1
-v2
-- Returns:
- The heuristic between the two Verticies.
-
genPath
Generate the path from their Vertex to Vertex mapping.- Parameters:
cameFrom
- Map representing which Vertex "cameFrom" which Vertex.vertex
- The last vertex in the list.- Returns:
- The ordered list of verticies held in the map.
-
astar
- Parameters:
start
- The starting Vertex.end
- The ending, goal Vertex.- Returns:
- The list of Verticies, start to end, which represents the most cost effecient way of traversing the graph.
-