/** * Back-tracks from the specified node, moving succesively upwards through the chain of parent nodes, until a node * is encountered that has unexamined successors. This method implements the backtracking searches reverse * direction. By checking for the presence of unexamined successors, this method only backtracks where necessary. * * @param checkNode The search node to start back-tracking from. */ protected void backtrack(SearchNode checkNode) { while ((checkNode != null) && (checkNode.unexaminedSuccessorCount == 0)) { Reversable undoState = (ReTraversable) checkNode.getState(); undoState.undoOperator(); checkNode = checkNode.getParent(); } } }
/** * Back-tracks from the specified node, moving succesively upwards through the chain of parent nodes, until a node * is encountered that has unexamined successors. This method implements the backtracking searches reverse * direction. By checking for the presence of unexamined successors, this method only backtracks where necessary. * * @param checkNode The search node to start back-tracking from. */ protected void backtrack(SearchNode checkNode) { while ((checkNode != null) && (checkNode.unexaminedSuccessorCount == 0)) { ReTraversable undoState = (ReTraversable) checkNode.getState(); undoState.undoOperator(); checkNode = checkNode.getParent(); } } }