public int runAStar(PrintWriter writer) { int expanded = search.run(cells, true, true, false); maze.printMaze("RepeatedAStar.txt"); if (expanded == 0) { writer.println("Repeated A* cannot reach the target."); writer.println(); } else { writer.println("Repeated A* have reached the target."); writer.println(expanded + " cells expanded."); writer.println(); } return expanded; }
public int testTiebreak(PrintWriter writer) { int expanded = search.run(cells, false, true, false); maze.printMaze("PreferSmallG.txt"); if (expanded == 0) { writer.println("Repeated A* by preferring smaller g value cannot reach the target."); writer.println(); } else { writer.println("Repeated A* by preferring smaller g value have reached the target."); writer.println(expanded + " cells expanded."); writer.println(); } return expanded; }
public int testAdaptive(PrintWriter writer) { int expanded = search.run(cells, true, true, true); maze.printMaze("AdaptiveAStar.txt"); if (expanded == 0) { writer.println("Adaptive A* cannot reach the target."); writer.println(); } else { writer.println("Adaptive A* have reached the target."); writer.println(expanded + " cells expanded."); writer.println(); } return expanded; }