edu.columbia.cs.coms4701.agent.environments.simple
Class SimpleAgent<K extends AgentAction,P extends AgentPercept>

java.lang.Object
  extended by edu.columbia.cs.coms4701.agent.environments.simple.SimpleEnvironmentObject
      extended by edu.columbia.cs.coms4701.agent.environments.simple.SimpleAgent<K,P>
All Implemented Interfaces:
Agent<K,P>, EnvironmentObject
Direct Known Subclasses:
RoombaAgent

public class SimpleAgent<K extends AgentAction,P extends AgentPercept>
extends SimpleEnvironmentObject
implements Agent<K,P>

A simple Agent implementation, which handles the getters and setters for the various properties, and the property change notification.

Subclassing SimpleAgent probably won't be necessary, since all of the interesting stuff happens in the AgentAction, AgentPercept, and AgentProgram.

Version:
0.1

User: aaron Date: Aug 24, 2006 Time: 10:57:54 AM

Author:
aaron@cs

Field Summary
 
Fields inherited from class edu.columbia.cs.coms4701.agent.environments.simple.SimpleEnvironmentObject
changeSupport
 
Constructor Summary
SimpleAgent()
           
 
Method Summary
 AgentProgram<K,P> getAgentProgram()
          Returns the agent program for this agent
 java.lang.String getAuthor()
          Wrapper method to fetch the author (as a UNI) of the agent program.
 java.lang.String getDescription()
          Wrapper method to fetch a description of the the agent program.
 java.lang.Double getPerformanceMeasure()
          Returns the current performance measure for this agent
 K nextAction(java.util.Set<P> thePercepts)
          Wrapper method to fetch the next AgentAction from the AgentProgram, given a set of AgentPercepts
 void setAgentProgram(AgentProgram<K,P> theProgram)
          Sets the agent program for this agent.
 void setPerformanceMeasure(java.lang.Double theMeasure)
          Sets the performance measure for this agent.
 
Methods inherited from class edu.columbia.cs.coms4701.agent.environments.simple.SimpleEnvironmentObject
addPropertyChangeListener, isAlive, removePropertyChangeListener, setAlive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.columbia.cs.coms4701.agent.EnvironmentObject
addPropertyChangeListener, isAlive, removePropertyChangeListener, setAlive
 

Constructor Detail

SimpleAgent

public SimpleAgent()
Method Detail

nextAction

public K nextAction(java.util.Set<P> thePercepts)
Wrapper method to fetch the next AgentAction from the AgentProgram, given a set of AgentPercepts

Specified by:
nextAction in interface Agent<K extends AgentAction,P extends AgentPercept>
Parameters:
thePercepts - the percepts from the Environment
Returns:
a chosen action
See Also:
edu.columbia.cs.coms4701.agent.AgentProgram#nextAction(java.util.Set

)


getAgentProgram

public AgentProgram<K,P> getAgentProgram()
Returns the agent program for this agent

Specified by:
getAgentProgram in interface Agent<K extends AgentAction,P extends AgentPercept>
Returns:
the agent program for this agent

getPerformanceMeasure

public java.lang.Double getPerformanceMeasure()
Returns the current performance measure for this agent

Specified by:
getPerformanceMeasure in interface Agent<K extends AgentAction,P extends AgentPercept>
Returns:
the current performance measure

setPerformanceMeasure

public void setPerformanceMeasure(java.lang.Double theMeasure)
Sets the performance measure for this agent.

Specified by:
setPerformanceMeasure in interface Agent<K extends AgentAction,P extends AgentPercept>
Parameters:
theMeasure - new performance measure.

getAuthor

public java.lang.String getAuthor()
Wrapper method to fetch the author (as a UNI) of the agent program.

Specified by:
getAuthor in interface Agent<K extends AgentAction,P extends AgentPercept>
Returns:
the UNI of the agent program author (e.g. "awh2101")
See Also:
AgentProgram.getAuthor()

getDescription

public java.lang.String getDescription()
Wrapper method to fetch a description of the the agent program.

Specified by:
getDescription in interface Agent<K extends AgentAction,P extends AgentPercept>
Returns:
a short text description of the agent program
See Also:
AgentProgram.getDescription()

setAgentProgram

public void setAgentProgram(AgentProgram<K,P> theProgram)
Sets the agent program for this agent. Should probably not be changed once the environment begins running!

Specified by:
setAgentProgram in interface Agent<K extends AgentAction,P extends AgentPercept>
Parameters:
theProgram -