public abstract class CommunicativeAgent extends Agent implements MessagingClient
agents
able to communicate with each other.Constructor and Description |
---|
CommunicativeAgent() |
Modifier and Type | Method and Description |
---|---|
UniqueIdentifier |
generateUniqueIdentifier()
Generates an identifier that is globally
unique throughout the whole multiagent system.
|
AgentIdentifier |
getAddress()
Returns the identifier of the agent itself.
|
boolean |
hasMessages()
Checks whether messages are available.
|
boolean |
hasMessages(MessagePattern pattern)
Checks whether messages matching a given pattern are available.
|
Message |
receive()
Receives a message if one is available.
|
Message |
receive(MessagePattern pattern)
Returns a message matching a given pattern if one is available.
|
Message |
send(Message message)
Sets the sender of the message and passes the message to the message
transport system.
|
currentTime, getAttribute, getIdentifier, hasAttribute, hasIdentifier, setAttributes, setup
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
call, hasTerminated
public AgentIdentifier getAddress()
MessagingClient
getAddress
in interface MessagingClient
public boolean hasMessages()
MessagingClient
hasMessages
in interface MessagingClient
true
if messages are available, false
otherwisepublic boolean hasMessages(MessagePattern pattern)
MessagingClient
hasMessages
in interface MessagingClient
pattern
- the pattern the messages should matchtrue
if messages match the given pattern,
false
otherwisepublic Message receive() throws IllegalStateException
MessagingClient
receive
in interface MessagingClient
IllegalStateException
public Message receive(MessagePattern pattern) throws IllegalStateException
MessagingClient
receive
in interface MessagingClient
pattern
- the pattern the message should matchIllegalStateException
public Message send(Message message)
MessagingClient
send
in interface MessagingClient
message
- the message to be sentpublic UniqueIdentifier generateUniqueIdentifier()
MessagingClient
Generates an identifier that is globally unique throughout the whole multiagent system. Such unique identifiers can be employed in order to identify messages in terms of the current conversation and the original message they reply to.
Without coordination with other agents, globally unique message identifiers can be created based on the agent identifier which is guaranteed to be unique.
generateUniqueIdentifier
in interface MessagingClient
Copyright © Aimpulse Intelligent Systems GmbH
All rights reserved.