defstruct) and Chapter 6 (use of keywords and
default values). You also need to understand the notation #'.
(load "aima.lisp") (aima-load 'agents) ; loads the agents subsystem (aima-load 'search) ; loads the search subsystem (aima-compile 'agents) ; compiles the agents subsystem (aima-compile 'search) ; compiles the search subsystem (test 'search) ; tests the functions in the search subsystemWhen I did this part, using CLISP, I got an error message in the file agents/environments/wumpus.lisp, since kill is a system defined macro and should not be redefined. I fixed the problem by changing all occurrences of kill to something else. Alternatively you can remove wumpus.lisp from the agents susbsystem definition in aima.lisp. I also got a warning about redefining agent-body, but the progarm compiled fine.
(test 'search) ; tests the functions in the search subsystem
Check that there are no errors (look at the last line printed).
breadth-first-search, no-duplicates-breadth-first-search,
no-returns-breadth-first-search, A*-search.
Compare the algorithms using
the function compare-search-algorithms
(look for how to use it in the documentation or in search/test-search.lisp).
compare-search-algorithms function,
the performance of the following search
algorithms A*-search, greedy-search, uniform-cost-search
to solve a TSP problem on the same randomly generated network of 15 cities.
Look in the file search/domains/tsp.lisp to find out how to specify the
number of cities. Make sure you run the three algorithms on the same
set of cities. Do not change any of the functions in tsp.lisp.
The time it takes to do the search depends on the
specific of the random network. A* and greedy-search run fast, but
uniform cost search can take a huge amount of time (hours and hours).
So, instead of using uniform-cost-search in your comparison you are free
to select a different algorithm from the algorithm collection
available.
The question I listed originally was used in an old midterm. It has been replaced with a new one. Sorry for the inconvenience. Discuss the possible advantages of the following state-space search strategy: obtain by some method a path to a goal node and its associated cost C. This cost is not necessarily minimal but it gives an upper bound on the minimal cost. Now use A* with an admissible h function and discard immediately any open nodes reached whose f values are greater than C.