-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pathfinder.java
47 lines (42 loc) · 1.32 KB
/
Pathfinder.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import java.awt.Point;
import java.util.List;
import java.util.Set;
/**
* Pathfinding algorithm
*/
public interface Pathfinder {
/**
* Initializes the pathfinder to an initial state ready to pathfind from a starting point to a
* target.
*
* @param start The starting point of the path that the pathfinder will start at.
* @param target The target endpoint of the path that the pathfinder will end at.
*/
void initialize(Point start, Point target);
/**
* Advances the pathfinding algorithm a single iteration.
*
* @return List of all nodes explored during this iteration.
*/
List<Point> step();
/**
* Returns all points that make up the solution path.
*
* @return List of all nodes in the solution path. If a solution path has not been found,
* returns null. Nodes are ordered starting from the path start point to the path endpoint.
*/
List<Point> getSolution();
/**
* Returns all points that are being considered at the current step by this pathfinder.
*
* @return Set of all points being considered at the current step.
* @since v1.5.3
*/
Set<Point> getFrontier();
/**
* Returns the full name of this algorithm.
*
* @return The full name of this algorithm.
*/
String toString();
}