ai.search
Interface IntCostAction

All Known Subinterfaces:
IntCostReversibleAction

public interface IntCostAction

Instances implementing this interface represent a possible action that can be used to transform one search state into another. Together with an appropriate implementation of the class SearchStateForIntCostFn, actions define a search problem.

The functionality to compute states that result from the application of actions is provided with the class SearchStateForIntCostFn. All an action knows is the cost of applying the action (itself) in a given search state, which will be an int for this class.

Author:
Gerhard Wickler
See Also:
IntCostReversibleAction, SearchStateForIntCostFn

Method Summary
 int getCost(SearchStateForIntCostFn state)
           This function returns the cost of applying this action in the given search state.
 java.lang.Class<? extends SearchStateForIntCostFn> getStateClass()
           This function can be used to retrieve the state class which, together with this action class, defines a search problem.
 

Method Detail

getStateClass

java.lang.Class<? extends SearchStateForIntCostFn> getStateClass()

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

Returns:
Class a class extending SearchStateForIntCostFn

getCost

int getCost(SearchStateForIntCostFn state)

This function returns the cost of applying this action in the given search state. Implementations of this function will often ignore the given state, meaning that the cost of the action does not depend on the context in which it is applied.

Parameters:
state - the SearchStateForIntCostFn in which this action is applied; the origin of the state transition
Returns:
the cost of applying this action in the given state