getGoalTest() public method

public getGoalTest ( ) : GoalTest
return GoalTest
示例#1
0
 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;
 }
示例#2
0
        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);
        }