pacworld
Class PacAgent

java.lang.Object
  extended by agent.Agent
      extended by pacworld.PacAgent

public class PacAgent
extends Agent

An agent for the Package World.


Constructor Summary
PacAgent(int i)
          Create a new PacAgent.
 
Method Summary
 java.lang.String getId()
          Return a unique string that identifies the agent.
 void see(Percept p)
          Provide a Percept to the agent.
 Action selectAction()
          Have the agent select its next action to perform.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PacAgent

public PacAgent(int i)
Create a new PacAgent. The agent is provided with a unique sequence number.

Method Detail

getId

public java.lang.String getId()
Description copied from class: Agent
Return a unique string that identifies the agent. This is particularly useful in multi-agent environments.

Specified by:
getId in class Agent

see

public void see(Percept p)
Description copied from class: Agent
Provide a Percept to the agent. This function is called by the environment at the beginning of each agent's turn. If the agent has internal state, this method should also update it.

Specified by:
see in class Agent

selectAction

public Action selectAction()
Description copied from class: Agent
Have the agent select its next action to perform. Implements the action: Per -> Ac function or the action: I -> Ac function, depending on whether or not the agent has internal state. Note, Per (or I) is not passed as a parameter, because we assume this information is recorded in an instance variable by the see() method.

Specified by:
selectAction in class Agent