edu.columbia.awh2101
Class AWHOnlineDFSAgentProgram

java.lang.Object
  extended by edu.columbia.awh2101.AWHOnlineDFSAgentProgram
All Implemented Interfaces:
AgentProgram<RobotAction,RobotPercept>, OnlineAgentProgram<RobotAction,RobotPercept,edu.columbia.awh2101.DFSAgentState>, OnlineDFSAgentProgram<RobotAction,RobotPercept,edu.columbia.awh2101.DFSAgentState>

public class AWHOnlineDFSAgentProgram
extends java.lang.Object
implements OnlineDFSAgentProgram<RobotAction,RobotPercept,edu.columbia.awh2101.DFSAgentState>

An implementation of Online-DFS-Agent for the Roomba environment.

This implementation is strictly know-nothing; it does not pose the problem to itself such that it has a successor function. For example, after going North from (1,1) to (1,2), this agent has no idea that going South will return it to (1,1). Hence you'll see some pretty silly behavior out of this guy.

This implementation simply uses robot location as its representation of state.

Version:
0.1

User: aaron Date: Sep 1, 2006 Time: 2:46:07 PM

Author:
aaron@cs
See Also:
"Russell & Norvig p.126"

Constructor Summary
AWHOnlineDFSAgentProgram()
           
 
Method Summary
 java.util.Set<edu.columbia.awh2101.DFSAgentState> formulateGoal(edu.columbia.awh2101.DFSAgentState initialState)
          Given an initial state (and knowledge of the environment), formulates a set of goal states.
 OnlineSearchProblem<RobotAction,edu.columbia.awh2101.DFSAgentState> formulateProblem(edu.columbia.awh2101.DFSAgentState initialState, java.util.Set<edu.columbia.awh2101.DFSAgentState> goalStates)
          Formulates a formal problem description given an initial state and a set of goals.
 java.util.List<RobotAction> getActionSequence()
          Gets the sequence of actions to perform.
 java.lang.String getAuthor()
          Should return the UNI of the author of the program.
 java.lang.String getDescription()
          Should return a short description of the program, used to distinguish different agent agentprograms by the same author.
 java.util.Set<edu.columbia.awh2101.DFSAgentState> getGoal()
          Returns the set of final states in which the goal condition is satisfied.
 OnlineSearchProblem<RobotAction,edu.columbia.awh2101.DFSAgentState> getProblem()
          Returns the problem formulated by the agent.
 edu.columbia.awh2101.DFSAgentState getState()
          Gets the current world state (as known to the agent)
 RobotAction nextAction(java.util.Set<RobotPercept> thePercepts)
          The essence of agent AI: Given a set of percepts, chooses an action.
 edu.columbia.awh2101.DFSAgentState updateState(edu.columbia.awh2101.DFSAgentState thePreviousState, java.util.Set<RobotPercept> thePercepts)
          Updates the current state given a set of percepts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWHOnlineDFSAgentProgram

public AWHOnlineDFSAgentProgram()
Method Detail

updateState

public edu.columbia.awh2101.DFSAgentState updateState(edu.columbia.awh2101.DFSAgentState thePreviousState,
                                                      java.util.Set<RobotPercept> thePercepts)
Updates the current state given a set of percepts.

Specified by:
updateState in interface OnlineAgentProgram<RobotAction,RobotPercept,edu.columbia.awh2101.DFSAgentState>
Parameters:
thePreviousState -
thePercepts -
Returns:
the new state

formulateGoal

public java.util.Set<edu.columbia.awh2101.DFSAgentState> formulateGoal(edu.columbia.awh2101.DFSAgentState initialState)
Given an initial state (and knowledge of the environment), formulates a set of goal states.

Specified by:
formulateGoal in interface OnlineAgentProgram<RobotAction,RobotPercept,edu.columbia.awh2101.DFSAgentState>
Parameters:
initialState -
Returns:
set of states reachable from the initial state that meet the goal condition

formulateProblem

public OnlineSearchProblem<RobotAction,edu.columbia.awh2101.DFSAgentState> formulateProblem(edu.columbia.awh2101.DFSAgentState initialState,
                                                                                            java.util.Set<edu.columbia.awh2101.DFSAgentState> goalStates)
Formulates a formal problem description given an initial state and a set of goals.

Specified by:
formulateProblem in interface OnlineAgentProgram<RobotAction,RobotPercept,edu.columbia.awh2101.DFSAgentState>
Parameters:
initialState -
goalStates -
Returns:
a problem description

getProblem

public OnlineSearchProblem<RobotAction,edu.columbia.awh2101.DFSAgentState> getProblem()
Returns the problem formulated by the agent.

Specified by:
getProblem in interface OnlineAgentProgram<RobotAction,RobotPercept,edu.columbia.awh2101.DFSAgentState>
Returns:
a problem description.

getGoal

public java.util.Set<edu.columbia.awh2101.DFSAgentState> getGoal()
Returns the set of final states in which the goal condition is satisfied.

Specified by:
getGoal in interface OnlineAgentProgram<RobotAction,RobotPercept,edu.columbia.awh2101.DFSAgentState>
Returns:
goal states

getState

public edu.columbia.awh2101.DFSAgentState getState()
Gets the current world state (as known to the agent)

Specified by:
getState in interface OnlineAgentProgram<RobotAction,RobotPercept,edu.columbia.awh2101.DFSAgentState>
Returns:
current world state

getActionSequence

public java.util.List<RobotAction> getActionSequence()
Gets the sequence of actions to perform.

Returns:
a list of actions.

nextAction

public RobotAction nextAction(java.util.Set<RobotPercept> thePercepts)
The essence of agent AI: Given a set of percepts, chooses an action.

Specified by:
nextAction in interface AgentProgram<RobotAction,RobotPercept>
Parameters:
thePercepts - set of percepts from the environment
Returns:
the next action.
See Also:
"Russell & Norvig p.44 (2.4)"

getAuthor

public java.lang.String getAuthor()
Should return the UNI of the author of the program.

Specified by:
getAuthor in interface AgentProgram<RobotAction,RobotPercept>
Returns:
a UNI, e.g. "awh2101"

getDescription

public java.lang.String getDescription()
Should return a short description of the program, used to distinguish different agent agentprograms by the same author. e.g. "SMA* search with a crappy heuristic function"

Specified by:
getDescription in interface AgentProgram<RobotAction,RobotPercept>
Returns:
short description of program