1 package cz.cuni.amis.utils.astar;
2
3 import java.util.Collection;
4
5 /**
6 * This class defines the goal of A* algorithm, it allows you to provide complex implementation
7 * of the {@link AStarGoal#isGoalReached(Object)} method.
8 */
9 public interface AStarGoal<NODE> extends AStarEvaluator<NODE> {
10
11 /**
12 * This is called at the beginning of the A* algorithm to bind the open list
13 * to the goal (you may use it check which nodes we've visited, etc... for
14 * extra cost for instance). DON'T CHANGE IT!
15 */
16 public void setOpenList(Collection<NODE> openList);
17
18 /**
19 * This is called at the beginning of the A* algorithm to bind the close list
20 * to the goal (you may use it check which nodes we've visited, etc... for
21 * extra cost for instance). DON'T CHANGE IT!
22 */
23 public void setCloseList(Collection<NODE> closeList);
24
25 /**
26 * Returns true, if we've reached the goal ... e.g. actualNode
27 * is node we were trying to get to
28 * if this function never returns true, A* will run until
29 * all nodes are evaluated
30 * @param actualNode
31 */
32 public boolean isGoalReached(NODE actualNode);
33 }