public static bool isGoalState(Problem p, Node n) { bool isGoal = false; GoalTest gt = p.getGoalTest(); if (gt.isGoalState(n.getState())) { if (gt is SolutionChecker) { isGoal = ((SolutionChecker)gt).isAcceptableSolution( SearchUtils.actionsFromNodes(n.getPathFromRoot()), n .getState()); } else { isGoal = true; } } return isGoal; }
public static bool isGoalState(Problem p, Node n) { bool isGoal = false; GoalTest gt = p.getGoalTest(); if (gt.isGoalState(n.getState())) { if (gt is SolutionChecker) { isGoal = ((SolutionChecker)gt).isAcceptableSolution( SearchUtils.actionsFromNodes(n.getPathFromRoot()), n .getState()); } else { isGoal = true; } } return(isGoal); }