Fix List to ArrayList
Add toString method for Box Add code to print the shortest path for this particular case.
This commit is contained in:
1 parent
fda73a2025
commit
d46b3c3b99
8 files changed
+19
-21
No files matched your search
+11
-3
@@ -1,5 +1,7 @@
|
||||
import dijkstra.Dijkstra;
|
||||
import maze.Maze;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import dijkstra.*;
|
||||
import maze.*;
|
||||
|
||||
public class MainTest {
|
||||
|
||||
@@ -7,7 +9,13 @@ public class MainTest {
|
||||
|
||||
Maze mazeTest = new Maze("data/labyrinthe.txt") ;
|
||||
|
||||
Dijkstra.dijkstra(mazeTest, mazeTest.getMaze()[1][1]) ;
|
||||
Previous previous = (Previous) Dijkstra.dijkstra(mazeTest, mazeTest.getMaze()[1][1]);
|
||||
|
||||
ArrayList<VertexInterface> shortest = previous.getShortestPathTo(mazeTest.getMaze()[5][5]);
|
||||
|
||||
for (VertexInterface vertex : shortest) {
|
||||
System.out.println(vertex);
|
||||
}
|
||||
|
||||
mazeTest.saveToTextFile("data/labyOutput.txt");
|
||||
|
||||
|
||||
Reference in new issue
Block a user