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

All Superinterfaces:
AgentProgram<K,P>

public interface ReflexWithStateAgentProgram<K extends AgentAction,P extends AgentPercept,S extends AgentState>
extends AgentProgram<K,P>

An agent that keeps track of the parts of the world it can't see now, maintining internal state.

To implement such an agent program, we need two types of information:

  1. How the world changes independently of the agent.
  2. How the agent's actions affect the world.

Version:
0.1

User: aaron Date: Sep 11, 2006 Time: 4:21:31 PM

Author:
aaron@cs
See Also:
"Russell & Norvig pp48-49"

Method Summary
 K getLastAction()
          Gets the most recent action (initially none)
 java.util.List<AgentRule<K,S>> getRules()
          returns the set of condition-action rules
 S getState()
          returns a description of the current world state
 K ruleAction(AgentRule<K,S> theRule)
          Selects an action, given the applied rule.
 AgentRule<K,S> ruleMatch(S theState, java.util.List<AgentRule<K,S>> rules)
          Chooses the appropriate rule (i.e.
 S updateState(S previousState, K lastAction, java.util.Set<P> currentPercepts)
          Creates the new internal state description, using information from the current percept, the old internal state, and the last chosen action.
 
Methods inherited from interface edu.columbia.cs.coms4701.agent.AgentProgram
getAuthor, getDescription, nextAction
 

Method Detail

updateState

S updateState(S previousState,
              K lastAction,
              java.util.Set<P> currentPercepts)
Creates the new internal state description, using information from the current percept, the old internal state, and the last chosen action.

Parameters:
previousState -
lastAction -
currentPercepts -
Returns:
new world state (as known to the agent)

ruleMatch

AgentRule<K,S> ruleMatch(S theState,
                         java.util.List<AgentRule<K,S>> rules)
Chooses the appropriate rule (i.e. first whose condition matches the current state)

Parameters:
theState -
rules -
Returns:
a rule to apply

ruleAction

K ruleAction(AgentRule<K,S> theRule)
Selects an action, given the applied rule.

This should be a trivial method.


getState

S getState()
returns a description of the current world state

Returns:
the current world state (as known by the agent program)

getRules

java.util.List<AgentRule<K,S>> getRules()
returns the set of condition-action rules

Returns:
an ordered list of rules

getLastAction

K getLastAction()
Gets the most recent action (initially none)

Returns:
the last action performed.