Package lejos.robotics.pathfinding
Interface SearchAlgorithm
-
- All Known Implementing Classes:
AstarSearchAlgorithm
public interface SearchAlgorithmAn interface for defining generic node search algorithms. NOTE: Implementations of this interface should override Object.toString() with the name of the algorithm. e.g. "A*", "Dijkstra", "Best-First", "D* Lite"- Author:
- BB
- See Also:
Object.toString()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PathfindPath(Node startNode, Node goalNode)Method accepts a start node and a goal node, and returns a path consisting of a collection of waypoints which includes the startNode coordinates as the first waypoint, and the goal node coordinates as the final waypoint.
-
-
-
Method Detail
-
findPath
Path findPath(Node startNode, Node goalNode)
Method accepts a start node and a goal node, and returns a path consisting of a collection of waypoints which includes the startNode coordinates as the first waypoint, and the goal node coordinates as the final waypoint. Note: The startNode must be connected with other nodes (neighbors) that eventually connect to the goalNode.- Parameters:
startNode-goalNode-- Returns:
- A collection of waypoints. Returns null if it fails to find a path.
-
-