A - The kind of Amas the agent refers toE - The kind of Environment the agent AND the Amas refer topublic abstract class AgentCommunicant<A extends Amas<E>,E extends Environment> extends Agent<A,E> implements java.lang.Runnable
Agent.Phaseamas, criticalities, currentPhase, neighborhood, params| Constructor and Description |
|---|
AgentCommunicant(A amas,
java.lang.Object... params)
The constructor automatically add the agent to the corresponding amas and
initialize the agent
|
| Modifier and Type | Method and Description |
|---|---|
AID |
getAID() |
java.util.Collection<IAmakEnvelope> |
getAllReceivedMessages()
Get the received messages of the current cycle.
|
<M extends IAmakMessage> |
getReceivedMessagesGivenType(java.lang.Class<M> clasz) |
boolean |
sendMessage(IAmakMessage messageToSend,
AID receiver)
Send a message to an agent.
|
boolean |
sendMessage(IAmakMessage messageToSend,
AID receiver,
IAmakMessageMetaData metadata) |
java.lang.String |
toString()
Agent toString using the AID agent.
|
_computeExecutionOrder, _onBeforeReady, addNeighbor, computeCriticality, computeExecutionOrderLayer, destroy, getAmas, getCurrentPhase, getEnvironment, getExecutionOrder, getId, getMostCriticalNeighbor, isSynchronous, onAct, onAgentCycleBegin, onAgentCycleEnd, onDecide, onDecideAndAct, onDraw, onePhaseCycle, onExpose, onInitialization, onInitialize, onPerceive, onReady, onRenderingInitialization, onSystemCycleBegin, onSystemCycleEnd, onUpdateRender, phase1, phase2, run, setAsynchronouspublic AgentCommunicant(A amas, java.lang.Object... params)
amas - Amas the agent belongs toparams - The params to initialize the agentpublic java.lang.String toString()
public AID getAID()
AID object is mandatory to send message.public boolean sendMessage(IAmakMessage messageToSend, AID receiver)
messageToSend - receiver - public boolean sendMessage(IAmakMessage messageToSend, AID receiver, IAmakMessageMetaData metadata)
public java.util.Collection<IAmakEnvelope> getAllReceivedMessages()
public <M extends IAmakMessage> java.util.Collection<M> getReceivedMessagesGivenType(java.lang.Class<M> clasz)