ai.search
Interface SearchStateForIntCostFn

All Known Implementing Classes:
AbstractSearchStateForIntCostFn

public interface SearchStateForIntCostFn

This class represents a state of the world in a search problem.

Together with an appropriate implementation for actions, an implementation of a SearchStateForIntCostFn defines a search problem, which consists of four components:

Given a definition of a search problem in terms of these components and implemented by a class for SearchStateForIntCostFns and a class for IntCostActions, a search engine can be used to attempt to solve the search problem.

Author:
Gerhard Wickler
See Also:
IntCostAction, SearchEngineForIntCostFn

Method Summary
 SearchStateForIntCostFn apply(IntCostAction action)
           This function computes a new search state that is the result of performing the given action in this search state.
 java.lang.Class<? extends IntCostAction> getActionClass()
           This function can be used to retrieve the action class which, together with this state class, defines a search problem.
 boolean isApplicable(IntCostAction action)
           This function tests whether the given action is applicable in this search state.
 boolean isGoalState()
           This function tests whether this search state is a goal state.
 java.util.Iterator<inf.util.Pair<IntCostAction,SearchStateForIntCostFn>> successors()
           This function indirectly generates the successors for this state in the context of the search problem defined by this class.
 

Method Detail

getActionClass

java.lang.Class<? extends IntCostAction> getActionClass()

This function can be used to retrieve the action class which, together with this state class, defines a search problem.

Returns:
Class a class extending IntCostAction

isGoalState

boolean isGoalState()

This function tests whether this search state is a goal state.

Returns:
true if and only if this is a goal state

isApplicable

boolean isApplicable(IntCostAction action)

This function tests whether the given action is applicable in this search state.

Parameters:
action - the IntCostAction to be tested for applicability
Returns:
true if and only if the given IntCostAction is applicable in this search state

apply

SearchStateForIntCostFn apply(IntCostAction action)

This function computes a new search state that is the result of performing the given action in this search state. Notice that this function does not test for applicability!

Parameters:
action - the IntCostAction to be performed in this state
Returns:
the resulting SearchStateForIntCostFn

successors

java.util.Iterator<inf.util.Pair<IntCostAction,SearchStateForIntCostFn>> successors()

This function indirectly generates the successors for this state in the context of the search problem defined by this class. The returned Iterator will generate a sequence of Pairs consisting of an IntCostAction and a SearchStateForIntCostFn, where the action if applied in this state will result in the paired state.

Returns:
an Iterator over the successor states of this state