MapFunctionFactory.getActionsFunction(romaniaMap),
MapFunctionFactory.getResultFunction(), new DefaultGoalTest(
SimplifiedRoadMapOfPartOfRomania.BUCHAREST),
new MapStepCostFunction(romaniaMap));
Search search = new AStarSearch(new GraphSearch(),
new StraightLineDistanceHeuristicFunction(
SimplifiedRoadMapOfPartOfRomania.BUCHAREST, romaniaMap));
SearchAgent agent = new SearchAgent(problem, search);
List<Action> actions = agent.getActions();
Assert.assertEquals(
"[Action[name==moveTo, location==RimnicuVilcea], Action[name==moveTo, location==Pitesti], Action[name==moveTo, location==Bucharest]]",
actions.toString());
Assert.assertEquals("278.0",
search.getMetrics().get(QueueSearch.METRIC_PATH_COST));
}