-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSolver.pde
38 lines (33 loc) · 933 Bytes
/
Solver.pde
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
import java.util.AbstractCollection;
import java.util.LinkedList;
public abstract class Solver
{
protected Maze maze;
protected String result;
protected AbstractCollection<Node<Maze>> frontier;
protected AbstractCollection<Square> closedSquares;
protected int nodesCounter;
protected int pathLength;
protected Boolean manhattan;
/*
* Solves the maze with the related (BFS, DFS, A*) algorithm and
* sets the result in this format :
* - Path trace
* - Path length
* - Number of nodes created
* - The maze with the path written
*/
public abstract String solve();
/*
* Get the nexts ("walkables") squares from the given square
*/
public abstract LinkedList<Node<Maze>> getNextSquares();
/*
* Returns the result from the last solving
*/
public abstract String getResult();
/*
* Returns the frontier from the last solving
*/
public abstract AbstractCollection<Node<Maze>> getFrontier();
}