|
AI for Games 1.1.1
|

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[] game2dai.graph.IGraphSearch.getExaminedEdges | ( | ) |
Get all the edges examined during the search.
Implemented in game2dai.graph.GraphSearch_Astar, game2dai.graph.GraphSearch_BFS, game2dai.graph.GraphSearch_DFS, and game2dai.graph.GraphSearch_Dijkstra.
| public< T > T[] game2dai.graph.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 |
Implemented in game2dai.graph.GraphSearch_Astar, game2dai.graph.GraphSearch_BFS, game2dai.graph.GraphSearch_DFS, and game2dai.graph.GraphSearch_Dijkstra.
| GraphNode[] game2dai.graph.IGraphSearch.getRoute | ( | ) |
Get the path found as an array of GraphNode(s) in start->end order
Implemented in game2dai.graph.GraphSearch_Astar, game2dai.graph.GraphSearch_BFS, game2dai.graph.GraphSearch_DFS, and game2dai.graph.GraphSearch_Dijkstra.
| public< T > T[] game2dai.graph.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 |
Implemented in game2dai.graph.GraphSearch_Astar, game2dai.graph.GraphSearch_BFS, game2dai.graph.GraphSearch_DFS, and game2dai.graph.GraphSearch_Dijkstra.
| LinkedList< GraphNode > game2dai.graph.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 game2dai.graph.GraphSearch_Astar, game2dai.graph.GraphSearch_BFS, game2dai.graph.GraphSearch_DFS, and game2dai.graph.GraphSearch_Dijkstra.
| LinkedList< GraphNode > game2dai.graph.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 game2dai.graph.GraphSearch_Astar, game2dai.graph.GraphSearch_BFS, game2dai.graph.GraphSearch_DFS, and game2dai.graph.GraphSearch_Dijkstra.