edu.columbia.cs.coms4701.agent.agentprograms
Interface AgentRule<K extends AgentAction,S extends AgentState>


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

A rule governing the behavior of reflex-based agents.

Each rule has a single associated action, and can evaluate any given state to determine whether the rule applies.

Remember that rules are usually applied in some predetermined order, so it may be possible to implement an agent that does not choose to apply a particular rule for a state, despite the fact that it returns true for that state.

Version:
0.1

User: aaron Date: Sep 11, 2006 Time: 4:12:49 PM

Author:
aaron@cs

Method Summary
 K getAction()
          Each rule can implement a single action.
 boolean matchesState(S theState)
          Evaluates a state, and decides whether this rule applies to the state.
 

Method Detail

matchesState

boolean matchesState(S theState)
Evaluates a state, and decides whether this rule applies to the state.

Presumably this method should inspect some particular feature of the state, e.g. for the simple vacuum world, whether the current square is dirty or not.

Parameters:
theState -
Returns:
true if this rule is applicable to the given state

getAction

K getAction()
Each rule can implement a single action.

Returns:
an action to perform if this rule is selected.