PkgAgentSystem.Experiences
Class ExperienceExchangeConversation
java.lang.Object
|
+--PkgAgentSystem.Conversation
|
+--PkgAgentSystem.Experiences.ExperienceExchangeConversation
- public class ExperienceExchangeConversation
- extends Conversation
A conversation to exchange experiences. Sends a single statement to all other local agents
using a broadcast. Agents might opt to ignore this message and do not add the statement
and recalculate their experiences if they are busy. This implementation however does
add all statements.
- Version:
- 1.0, 1.7.2000
- Author:
- Michael Sonntag
- See Also:
- PkgAgentSystem.Experiences, Serialized Form
Methods inherited from class PkgAgentSystem.Conversation |
broadcastMessage,
endConversation,
getAgent,
getConversationTypeID,
getCounterpartConvID,
getCounterpartIdentity,
getOwnConvID,
isInitiator,
isRunning,
newConversation,
sendMessage,
setCounterpartConvID,
setShouldArchive,
shouldArchive,
startConversation,
waitEnded |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
conversationTypeID
public static final long conversationTypeID
- The ID for this type of conversation (2).
ExperienceExchangeConversation
public ExperienceExchangeConversation(AgentBase myAgent)
- Creates a new conversation for exchanging experiences.
- Parameters:
myAgent
- the agent this conversation belongs to
setStatement
public void setStatement(Statement stat)
- Sets the statement to exchange.
- Parameters:
stat
- the statement to tell all other local agents (must be provided)
handleMessage
protected boolean handleMessage(Message msg)
- Handles the messages. Calls
super.handleMessage(msg)
first.
The sender broadcasts the statement to all other agents. If the statement was not set before
starting the conversation, an error occurs. The conversation is terminated in any case and
not archived.
The recipient adds this statement to its own experiences and then terminates the conversation,
which is not archived.
- Parameters:
msg
- the msg to handle- Returns:
true
if the message was handled (in this conversation all messages are
handled, so always returns true
)- Overrides:
- handleMessage in class Conversation
Submit a bug
Copyright 2000 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.