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

All Superinterfaces:
SearchAlgorithm<K,S>
All Known Subinterfaces:
GraphSearch<K,S>

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

A Search Algorithm which can explore a state space that is a tree, i.e. in which each state can be reached by only one path.

Implementations should provide a constructor that accepts a SearchStrategy, so that subsequent calls to search with a new problem will automatically use the specified strategy.

If more than one node can contain the same state (for example, if the actions "North" then "East" reach the same state as the actions "East" then "North"), a GraphSearch is more appropriate, as it contains extra facilities for detecting repeated states.

Version:
0.1

User: aaron Date: Sep 11, 2006 Time: 8:17:59 PM

Author:
aaron@cs
See Also:
"Russell & Norvig p72"

Method Summary
 java.util.Set<SearchNode<K,S>> expand(SearchNode<K,S> node, SearchProblem<K,S> searchProblem)
          Returns a set of successor nodes for a given node.
 java.util.List<K> solution(SearchNode<K,S> node)
          Returns the sequence of actions obtained by following parent pointers back to the root.
 java.util.List<K> treeSearch(SearchProblem<K,S> theSearchProblem, SearchStrategy<K,S> theStrategy)
          Executes a search on the given problem using the specified strategy.
 
Methods inherited from interface edu.columbia.cs.coms4701.search.SearchAlgorithm
search
 

Method Detail

treeSearch

java.util.List<K> treeSearch(SearchProblem<K,S> theSearchProblem,
                             SearchStrategy<K,S> theStrategy)
Executes a search on the given problem using the specified strategy.

Parameters:
theSearchProblem -
theStrategy -
Returns:
a list of actions that will solve the problem

expand

java.util.Set<SearchNode<K,S>> expand(SearchNode<K,S> node,
                                      SearchProblem<K,S> searchProblem)
Returns a set of successor nodes for a given node.

In the normal tree-search implementation, this should simply accept the (action,result) pairs from the searchProblem's successor function,

Parameters:
node -
searchProblem -
Returns:
a set of successor nodes

solution

java.util.List<K> solution(SearchNode<K,S> node)
Returns the sequence of actions obtained by following parent pointers back to the root.

Parameters:
node -
Returns:
sequence of actions from the root to the given node.