public abstract class Agent
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
Agent() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
computeAMessage(Message m)
Compute A message.
|
void |
die()
Die.
|
int |
getID()
Gets the id.
|
java.util.Stack<Message> |
getMessages()
Gets the messages.
|
java.util.Stack<Message> |
getMessagesBin()
Gets the messages bin.
|
java.lang.String |
getName()
Gets the name.
|
boolean |
isDying()
Checks if is dying.
|
void |
play()
Play one agent step.
|
void |
readMessage()
Read message.
|
void |
sendExpressMessage(java.lang.Object object,
MessageType type,
Agent a)
Send express message.
|
void |
sendMessage(Message message,
Agent a)
Send message.
|
void |
sendMessage(java.lang.Object object,
MessageType type,
Agent a)
Send message.
|
void |
setDying(boolean isDying)
Sets the dying.
|
void |
setID(int iD)
Sets the id.
|
void |
setMessages(java.util.Stack<Message> messages)
Sets the messages.
|
void |
setMessagesBin(java.util.Stack<Message> messagesBin)
Sets the messages bin.
|
void |
setName(java.lang.String name)
Sets the name.
|
public void play()
public int getID()
public void setID(int iD)
iD - the new idpublic java.lang.String getName()
public void setName(java.lang.String name)
name - the new namepublic java.util.Stack<Message> getMessages()
public void setMessages(java.util.Stack<Message> messages)
messages - the new messagespublic void sendMessage(Message message, Agent a)
message - the messagea - the apublic void sendMessage(java.lang.Object object,
MessageType type,
Agent a)
object - the objecttype - the typea - the apublic void sendExpressMessage(java.lang.Object object,
MessageType type,
Agent a)
object - the objecttype - the typea - the apublic void readMessage()
public java.util.Stack<Message> getMessagesBin()
public void setMessagesBin(java.util.Stack<Message> messagesBin)
messagesBin - the new messages binpublic abstract void computeAMessage(Message m)
m - the mpublic void die()
public boolean isDying()
public void setDying(boolean isDying)
isDying - the new dying