package search; import java.util.List; import java.util.Objects; public abstract class Node { protected final T value; protected final int heuristicCosts; private final Node parent; private int heuristicEstimation; protected Node(final T value) { this(value, null, 0); } protected Node(final T value, final Node parent, final int heuristicCosts) { this.value = Objects.requireNonNull(value); this.parent = parent; this.heuristicCosts = heuristicCosts; } public T getValue() { return this.value; } public Node getParent() { return this.parent; } public int getHeuristic() { return heuristicCosts + heuristicEstimation; } public void setHeuristicEstimation(final int heuristicEstimation) { this.heuristicEstimation = heuristicEstimation; } public abstract boolean isTargetReached(final Node target); public abstract List> generateSuccessors(); }