Loading ...
Sorry, an error occurred while loading the content.

814fix to iterative deepening in lisp

Expand Messages
  • David Tolpin
    Mar 11, 2008
    • 0 Attachment
      Hello,

      Patch for

      http://www.cs.berkeley.edu/~russell/code/search/algorithms/simple.lisp

      so that iterative-deepening-search works.

      --- search/algorithms/simple.lisp.orig 2008-02-26 11:43:18.000000000 +0200
      +++ search/algorithms/simple.lisp 2008-02-26 11:31:38.000000000 +0200
      @@ -36,9 +36,13 @@
      "Search depth-first, but only up to LIMIT branches deep in the tree."
      (cond ((goal-test problem node) node)
      ((>= (node-depth node) limit) :cut-off)
      - (t (for each n in (expand node problem) do
      + (t (let (cut-off)
      + (for each n in (expand node problem) do
      (let ((solution (depth-limited-search problem limit n)))
      - (when solution (RETURN solution)))))))
      + (cond
      + ((eq solution :cut-off) (setf cut-off :cut-off))
      + (solution (RETURN solution)))))
      + cut-off))))

      ;;;; Search Algorithms That Use Heuristic Information

      David Tolpin
      http://davidashen.net/