Inheritance: AIMA.Core.Search.Framework.NodeExpander, Search
 // function ITERATIVE-DEEPENING-SEARCH(problem) returns a solution, or
 // failure
 public List<Action> search(Problem p)
 {
     iterationMetrics.set(METRIC_NODES_EXPANDED, 0);
     iterationMetrics.set(PATH_COST, 0);
     // for depth = 0 to infinity do
     for (int i = 0; i <= infinity; i++)
     {
         // result <- DEPTH-LIMITED-SEARCH(problem, depth)
         DepthLimitedSearch dls = new DepthLimitedSearch(i);
         List<Action> result = dls.search(p);
         iterationMetrics.set(METRIC_NODES_EXPANDED, iterationMetrics
                 .getInt(METRIC_NODES_EXPANDED)
                 + dls.getMetrics().getInt(METRIC_NODES_EXPANDED));
         // if result != cutoff then return result
         if (!dls.isCutOff(result))
         {
             iterationMetrics.set(PATH_COST, dls.getPathCost());
             return result;
         }
     }
     return failure();
 }
 // function ITERATIVE-DEEPENING-SEARCH(problem) returns a solution, or
 // failure
 public List <Action> search(Problem p)
 {
     iterationMetrics.set(METRIC_NODES_EXPANDED, 0);
     iterationMetrics.set(PATH_COST, 0);
     // for depth = 0 to infinity do
     for (int i = 0; i <= infinity; i++)
     {
         // result <- DEPTH-LIMITED-SEARCH(problem, depth)
         DepthLimitedSearch dls    = new DepthLimitedSearch(i);
         List <Action>      result = dls.search(p);
         iterationMetrics.set(METRIC_NODES_EXPANDED, iterationMetrics
                              .getInt(METRIC_NODES_EXPANDED)
                              + dls.getMetrics().getInt(METRIC_NODES_EXPANDED));
         // if result != cutoff then return result
         if (!dls.isCutOff(result))
         {
             iterationMetrics.set(PATH_COST, dls.getPathCost());
             return(result);
         }
     }
     return(failure());
 }