A
- The kind of Amas the agent refers toE
- The kind of Environment the agent AND the Amas refer topublic abstract class CommunicatingAgent<A extends Amas<E>,E extends Environment> extends Agent<A,E> implements java.lang.Runnable
Agent.Phase
amas, criticalities, currentPhase, neighborhood, params
Constructor and Description |
---|
CommunicatingAgent(A amas,
IMessagingReader msgReader,
java.lang.Object... params)
The constructor automatically add the agent to the corresponding amas and
initialize the agent.
|
CommunicatingAgent(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> |
getAllMessages()
Get the received messages according to the message reader strategy. .
|
<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, setAsynchronous
public CommunicatingAgent(A amas, java.lang.Object... params)
MessagingReaderAllMsgsOfCycle
) will
be use.amas
- Amas the agent belongs toparams
- The params to initialize the agentpublic CommunicatingAgent(A amas, IMessagingReader msgReader, java.lang.Object... params)
amas
- Amas the agent belongs toparams
- The params to initialize the agentmsgReader
- The strategy of messaging reader.public 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> getAllMessages()
public <M extends IAmakMessage> java.util.Collection<M> getReceivedMessagesGivenType(java.lang.Class<M> clasz)