diff --git a/src/main/java/Assignments/A1/models/Solver.java b/src/main/java/Assignments/A1/models/Solver.java new file mode 100644 index 0000000..5285802 --- /dev/null +++ b/src/main/java/Assignments/A1/models/Solver.java @@ -0,0 +1,9 @@ +package Assignments.A1.models; + +import Assignments.A1.models.Board; +import Assignments.A1.models.BoardNode; + +public interface Solver { + + BoardNode traverse(Board board); +} diff --git a/src/main/java/Assignments/A1/solving_algorithms/AStar.java b/src/main/java/Assignments/A1/solving_algorithms/AStar.java index 667148b..d297b51 100644 --- a/src/main/java/Assignments/A1/solving_algorithms/AStar.java +++ b/src/main/java/Assignments/A1/solving_algorithms/AStar.java @@ -3,13 +3,14 @@ package Assignments.A1.solving_algorithms; import Assignments.A1.models.Board; import Assignments.A1.models.BoardNode; import Assignments.A1.models.Move; +import Assignments.A1.models.Solver; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.PriorityQueue; -public class AStar { +public class AStar implements Solver { private final Board solved = new Board(); private final HashSet visited = new HashSet<>(); diff --git a/src/main/java/Assignments/A1/solving_algorithms/BFS.java b/src/main/java/Assignments/A1/solving_algorithms/BFS.java index 3d06d4d..8e97e4d 100644 --- a/src/main/java/Assignments/A1/solving_algorithms/BFS.java +++ b/src/main/java/Assignments/A1/solving_algorithms/BFS.java @@ -3,13 +3,14 @@ package Assignments.A1.solving_algorithms; import Assignments.A1.models.Board; import Assignments.A1.models.BoardNode; import Assignments.A1.models.Move; +import Assignments.A1.models.Solver; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.PriorityQueue; -public class BFS { +public class BFS implements Solver { private final HashSet visited = new HashSet<>(); private static final Board solved = new Board(); diff --git a/src/main/java/Assignments/A1/solving_algorithms/UCS.java b/src/main/java/Assignments/A1/solving_algorithms/UCS.java index d0a4cb9..888cca2 100644 --- a/src/main/java/Assignments/A1/solving_algorithms/UCS.java +++ b/src/main/java/Assignments/A1/solving_algorithms/UCS.java @@ -3,13 +3,14 @@ package Assignments.A1.solving_algorithms; import Assignments.A1.models.Board; import Assignments.A1.models.BoardNode; import Assignments.A1.models.Move; +import Assignments.A1.models.Solver; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.PriorityQueue; -public class UCS { +public class UCS implements Solver { private final Board solved = new Board(); private final HashSet visited = new HashSet<>();