aima.search.framework
Class SearchFactory

java.lang.Object
  extended by aima.search.framework.SearchFactory

public class SearchFactory
extends java.lang.Object

Useful factory for configuring search objects. Implemented as a singleton.


Field Summary
static int ASTAR_SEARCH
          Search strategy: A* search.
static int BF_SEARCH
          Search strategy: Depth first search.
static int DF_SEARCH
          Search strategy: Depth first search.
static int GBF_SEARCH
          Search strategy: Greedy best first search.
static int GRAPH_SEARCH
          Search mode: graph search.
static int HILL_SEARCH
          Search strategy: Hill climbing search.
static int ID_SEARCH
          Search strategy: Iterative deepening search.
static int RBF_SEARCH
          Search strategy: Recursive best first search.
static int TREE_SEARCH
          Search mode: tree search.
static int UC_SEARCH
          Search strategy: Uniform cost search.
 
Method Summary
 Search createSearch(int strategy, int mode)
          Creates a search instance.
static SearchFactory getInstance()
          Provides access to the factory.
 java.lang.String[] getSearchModeNames()
          Returns the names of all search modes, which are supported by this factory.
 java.lang.String[] getSearchStrategyNames()
          Returns the names of all search strategies, which are supported by this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DF_SEARCH

public static final int DF_SEARCH
Search strategy: Depth first search.

See Also:
Constant Field Values

BF_SEARCH

public static final int BF_SEARCH
Search strategy: Depth first search.

See Also:
Constant Field Values

ID_SEARCH

public static final int ID_SEARCH
Search strategy: Iterative deepening search.

See Also:
Constant Field Values

UC_SEARCH

public static final int UC_SEARCH
Search strategy: Uniform cost search.

See Also:
Constant Field Values

GBF_SEARCH

public static final int GBF_SEARCH
Search strategy: Greedy best first search.

See Also:
Constant Field Values

ASTAR_SEARCH

public static final int ASTAR_SEARCH
Search strategy: A* search.

See Also:
Constant Field Values

RBF_SEARCH

public static final int RBF_SEARCH
Search strategy: Recursive best first search.

See Also:
Constant Field Values

HILL_SEARCH

public static final int HILL_SEARCH
Search strategy: Hill climbing search.

See Also:
Constant Field Values

TREE_SEARCH

public static final int TREE_SEARCH
Search mode: tree search.

See Also:
Constant Field Values

GRAPH_SEARCH

public static final int GRAPH_SEARCH
Search mode: graph search.

See Also:
Constant Field Values
Method Detail

getInstance

public static SearchFactory getInstance()
Provides access to the factory. Implemented with lazy instantiation.


getSearchStrategyNames

public java.lang.String[] getSearchStrategyNames()
Returns the names of all search strategies, which are supported by this factory. The indices correspond to the parameter values of method createSearch(int, int).


getSearchModeNames

public java.lang.String[] getSearchModeNames()
Returns the names of all search modes, which are supported by this factory. The indices correspond to the parameter values of method createSearch(int, int).


createSearch

public Search createSearch(int strategy,
                           int mode)
Creates a search instance.

Parameters:
strategy - search strategy. See static constants.
mode - search mode: TREE_SEARCH or GRAPH_SEARCH