edu.columbia.cs.coms4701.search
Interface SearchProblem<K extends AgentAction,S extends AgentState>


public interface SearchProblem<K extends AgentAction,S extends AgentState>

A formal definition of a problem.

Version:
0.1

User: aaron Date: Sep 11, 2006 Time: 4:33:37 PM

Author:
aaron@cs
See Also:
"Russell & Norvig, p62"

Method Summary
 S getInitialState()
          The initial state that the agent starts in.
 boolean goalTest(S theState)
          Determines whether a given state is a goal state.
 double pathCost(java.util.List<S> thePath)
          Assigns a numeric cost to each path, where a path is an ordered list of states.
 double stepCost(S firstState, K theAction, S resultingState)
          Determines the cost of taking the given action to go from the first to the second state.
 java.util.Map<K,S> successorFunction(S theState)
          Given a particular state x, returns a set of (action, successor) ordered pairs, where each action is one of the legal actions in state x and each successor is a state that can be reached from x by applying the action.
 

Method Detail

getInitialState

S getInitialState()
The initial state that the agent starts in.

Returns:
an initial state

successorFunction

java.util.Map<K,S> successorFunction(S theState)
Given a particular state x, returns a set of (action, successor) ordered pairs, where each action is one of the legal actions in state x and each successor is a state that can be reached from x by applying the action.

Parameters:
theState -
Returns:
set of possible actions and their resulting states

goalTest

boolean goalTest(S theState)
Determines whether a given state is a goal state.

Parameters:
theState -
Returns:
true if the given state is a goal state.

pathCost

double pathCost(java.util.List<S> thePath)
Assigns a numeric cost to each path, where a path is an ordered list of states.

In chapter 3, we assume path cost is simple the sum of step costs.

Parameters:
thePath -
Returns:
the cost of the path.

stepCost

double stepCost(S firstState,
                K theAction,
                S resultingState)
Determines the cost of taking the given action to go from the first to the second state.

Step costs are assumed to be nonnegative.

Parameters:
firstState -
theAction -
resultingState -
Returns:
the cost of taking the given action to go from the first to second state.