All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lejos.robotics.pathfinding.SearchAlgorithm Maven / Gradle / Ivy

Go to download

leJOS (pronounced like the Spanish word "lejos" for "far") is a tiny Java Virtual Machine. In 2013 it was ported to the LEGO EV3 brick.

The newest version!
package lejos.robotics.pathfinding;

/**
 * An 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 java.lang.Object#toString()
 */
public interface SearchAlgorithm {
	
	/**
	 * 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.
	 * @param startNode
	 * @param goalNode
	 * @return A collection of waypoints. Returns null if it fails to find a path.
	 */
	public Path findPath(Node startNode, Node goalNode);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy