use of aima.core.search.uninformed.IterativeDeepeningSearch in project aima-java by aimacode.
the class IterativeDeepeningSearchTest method testIterativeDeepeningSearch.
@Test
public void testIterativeDeepeningSearch() {
try {
Problem<NQueensBoard, QueenAction> problem = new GeneralProblem<>(new NQueensBoard(8), NQueensFunctions::getIFActions, NQueensFunctions::getResult, NQueensFunctions::testGoal);
SearchForActions<NQueensBoard, QueenAction> search = new IterativeDeepeningSearch<>();
List<QueenAction> actions = search.findActions(problem);
assertCorrectPlacement(actions);
Assert.assertEquals("3656", search.getMetrics().get("nodesExpanded"));
} catch (Exception e) {
e.printStackTrace();
Assert.fail("Exception should not occur");
}
}
Aggregations