edu.columbia.cs.coms4701.search.uninformed
Interface DepthLimitedSearch<K extends AgentAction,S extends AgentState>

All Superinterfaces:
SearchAlgorithm<K,S>

public interface DepthLimitedSearch<K extends AgentAction,S extends AgentState>
extends SearchAlgorithm<K,S>

A tree search with a predetermined depth limit.

Note that this interface is suggested as a modification of tree search, but the algorithm can also be formulated as a recursive depth-first search.

Since the tree-search implementation is more general (could be used with any search strategy), we prefer that one.

Implementations should offer both the general #searchWithDepthLimit method, and a constructor that accepts a particular depth, allowing subsequent calls to the usual #search that will use the predetermined depth.

Version:
0.1

User: aaron Date: Sep 11, 2006 Time: 5:11:13 PM

Author:
aaron@cs
See Also:
"Russell & Norvig p.77"

Method Summary
 int getDepth()
          Accessor for the preset depth parameter.
 java.util.List<K> search(SearchProblem<K,S> theSearchProblem)
          Given a formal statement of a problem, returns a sequence of actions that will reach a goal state.
 java.util.List<K> searchWithDepthLimit(SearchProblem<K,S> theSearchProblem, int depth)
          Performs a search with the given
 

Method Detail

search

java.util.List<K> search(SearchProblem<K,S> theSearchProblem)
                                             throws SearchFailureException,
                                                    DepthCutoffSearchFailureException
Given a formal statement of a problem, returns a sequence of actions that will reach a goal state.

Uses a predetermined depth limit set at construction time.

Specified by:
search in interface SearchAlgorithm<K extends AgentAction,S extends AgentState>
Parameters:
theSearchProblem -
Returns:
list of actions to reach a goal state.
Throws:
SearchFailureException
DepthCutoffSearchFailureException

searchWithDepthLimit

java.util.List<K> searchWithDepthLimit(SearchProblem<K,S> theSearchProblem,
                                       int depth)
                                                           throws SearchFailureException,
                                                                  DepthCutoffSearchFailureException
Performs a search with the given

Parameters:
theSearchProblem -
Returns:
Throws:
SearchFailureException
DepthCutoffSearchFailureException

getDepth

int getDepth()
Accessor for the preset depth parameter.

Returns:
depth limit