|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TreeSearch<K extends AgentAction,S extends AgentState>
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.
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 |
---|
java.util.List<K> treeSearch(SearchProblem<K,S> theSearchProblem, SearchStrategy<K,S> theStrategy)
theSearchProblem
- theStrategy
-
java.util.Set<SearchNode<K,S>> expand(SearchNode<K,S> node, SearchProblem<K,S> searchProblem)
In the normal tree-search implementation, this should simply accept the (action,result) pairs from the searchProblem's successor function,
node
- searchProblem
-
java.util.List<K> solution(SearchNode<K,S> node)
node
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |