ai.search
Interface SearchStateForDoubleCostFn

All Known Implementing Classes:
AbstractSearchStateForDoubleCostFn

public interface SearchStateForDoubleCostFn

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

Together with an appropriate implementation for actions, an implementation of a SearchStateForDoubleCostFn 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 SearchStateForDoubleCostFns and a class for DoubleCostActions, a search engine can be used to attempt to solve the search problem.

Author:
Gerhard Wickler
See Also:
DoubleCostAction, SearchEngineForDoubleCostFn

Method Summary
 SearchStateForDoubleCostFn apply(DoubleCostAction 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 DoubleCostAction> getActionClass()
           This function can be used to retrieve the action class which, together with this state class, defines a search problem.
 boolean isApplicable(DoubleCostAction 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<DoubleCostAction,SearchStateForDoubleCostFn>> 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 DoubleCostAction> 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 DoubleCostAction

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(DoubleCostAction action)

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

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

apply

SearchStateForDoubleCostFn apply(DoubleCostAction 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 DoubleCostAction to be performed in this state
Returns:
the resulting SearchStateForDoubleCostFn

successors

java.util.Iterator<inf.util.Pair<DoubleCostAction,SearchStateForDoubleCostFn>> 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 a DoubleCostAction and a SearchStateForDoubleCostFn, where the action if applied in this state will result in the paired state.

Returns:
an Iterator over the successor states of this state