net.sourceforge.jsl
Interface Search

All Known Subinterfaces:
ScoringSearch
All Known Implementing Classes:
AbstractOpenClosedListSearch, AbstractScoringSearch

public interface Search

Interface for a search on a graph. Search starts at a search node set by setSeed(net.sourceforge.jsl.SearchNode). You can either search for a single goal, i.e. the first node found that is a goal, using search() or a number of goals using search(int).


Method Summary
 SearchNode search()
          Searches for the search node that is marked as a goal and returns it.
 Collection search(int maxGoals)
          Searches for search nodes marked as a goal and returns them.
 void setSeed(SearchNode seed)
          Sets the seed of the search, i.e. the root node of the search.
 

Method Detail

setSeed

public void setSeed(SearchNode seed)
Sets the seed of the search, i.e. the root node of the search.

Parameters:
seed - the root node of the search

search

public SearchNode search()
                  throws SearchException
Searches for the search node that is marked as a goal and returns it.

Returns:
the first goal search node found or null if none was found
Throws:
SearchException - signals an abnormal termination of the search

search

public Collection search(int maxGoals)
                  throws SearchException
Searches for search nodes marked as a goal and returns them. The search stops either when there are no nodes left to process or the maximum number of goals are reached.

Parameters:
maxGoals - the maximum number of goals to search for.
Returns:
a collection of all goal nodes found; if no goals have been found an empty collection is returned
Throws:
SearchException - signals an abnormal termination of the search


Copyright © 2003-2004 Henrik Heine, Oliver Zeigermann. All Rights Reserved.