javaff.JavaFF.infoOutput.println(bestHValue);
while (!open.isEmpty()) // whilst still states to consider
{
State s = removeNext(); // get the next one
Set successors = s.getNextStates(filter.getActions(s)); // and find its neighbourhood
Iterator succItr = successors.iterator();
while (succItr.hasNext()) {
State succ = (State) succItr.next(); // next successor
if (needToVisit(succ)) {
if (succ.goalReached()) { // if we've found a goal state - return it as the solution
return succ;
} else if (succ.getHValue().compareTo(bestHValue) < 0) {
// if we've found a state with a better heuristic value than the best seen so far
bestHValue = succ.getHValue(); // note the new best avlue
javaff.JavaFF.infoOutput.println(bestHValue);
open = new LinkedList(); // clear the open list
open.add(succ); // put this on it
break; // and skip looking at the other successors
} else {