pacworld
Class Say
java.lang.Object
agent.Action
pacworld.Say
public class Say
- extends Action
A package delivery agent action that causes the agent to broadcast
a message to all other agents. There is no limit on the range or
size of the message.
Constructor Summary |
Say(java.lang.String s)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Say
public Say(java.lang.String s)
execute
public State execute(Agent agent,
State s)
- Return the state that results from the agent sending a message.
In order to avoid creating unnecessary objects, we
do not create a new state, but instead modify the old one. This
would have to change if the Environment needs to maintain a history
of states.
- Specified by:
execute
in class Action
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object