Path Finder (2D/3D) 1.0.1
Create and use simple navigation graphs for 2D/3D path finding with choice of 4 search algorithms.
|
Public Member Functions | |
LinkedList< GraphNode > | search (int startID, int targetID) |
LinkedList< GraphNode > | search (int startID, int targetID, boolean remember) |
GraphEdge[] | getExaminedEdges () |
public< T > T[] | getExaminedEdges (T[] array) |
GraphNode[] | getRoute () |
public< T > T[] | getRoute (T[] array) |
Any class that can be used to search the graph should implement this class.
GraphEdge[] pathfinder.IGraphSearch.getExaminedEdges | ( | ) |
Get all the edges examined during the search.
Implemented in pathfinder.GraphSearch_Astar, pathfinder.GraphSearch_BFS, pathfinder.GraphSearch_DFS, and pathfinder.GraphSearch_Dijkstra.
public< T > T[] pathfinder.IGraphSearch.getExaminedEdges | ( | T[] | array | ) |
Get all the edges examined during the search.
The type of each element in the array will be of type Object if the parameter is null otherwise it is T (where T is GraphEdge or any class that extends GraphEdge.
array | the array to populate |
GraphNode[] pathfinder.IGraphSearch.getRoute | ( | ) |
Get the path found as an array of GraphNode(s) in start->end order
Implemented in pathfinder.GraphSearch_Astar, pathfinder.GraphSearch_BFS, pathfinder.GraphSearch_DFS, and pathfinder.GraphSearch_Dijkstra.
public< T > T[] pathfinder.IGraphSearch.getRoute | ( | T[] | array | ) |
Get the path found as an array of T(s) in start->end order.
The type of each element in the array will be of type Object if the parameter is null otherwise it is T (where T is GraphNode or any class that extends GraphNode.
array | the array to populate |
LinkedList< GraphNode > pathfinder.IGraphSearch.search | ( | int | startID, |
int | targetID | ||
) |
Search for a route from node startID and ends at targetID.
This will return a linkedlist of the nodes that make up the route from start to end order.
If either the start or target node does not exist or if a route can't be found the returned list is empty.
startID | id of the start node |
targetID | id of the target node |
Implemented in pathfinder.GraphSearch_Astar, pathfinder.GraphSearch_BFS, pathfinder.GraphSearch_DFS, and pathfinder.GraphSearch_Dijkstra.
LinkedList< GraphNode > pathfinder.IGraphSearch.search | ( | int | startID, |
int | targetID, | ||
boolean | remember | ||
) |
Search for a route from node startID and ends at targetID.
This will return a linkedlist of the nodes that make up the route from start to end order.
If either the start or target node does not exist or if a route can't be found the returned list is empty.
startID | id of the start node |
targetID | id of the target node |
remember | whether to remember the examined edges. |
Implemented in pathfinder.GraphSearch_Astar, pathfinder.GraphSearch_BFS, pathfinder.GraphSearch_DFS, and pathfinder.GraphSearch_Dijkstra.