mam.agent
Class InformationPersonaeAgent

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--mam.agent.Agent
              |
              +--mam.agent.TransactionalAgent
                    |
                    +--mam.agent.InformationPersonaeAgent

public class InformationPersonaeAgent
extends TransactionalAgent

Description of the Class

Author:
nideffer
created October 8, 2001

Field Summary
 final static RoutingTagAGENT_TRAITS_LISTENER_ROUTING_TAG
           
 protected final static StringDO_QUERY_KNOWLEDGE_AGENTS_MESSAGE_WAITER_ID
           
 protected final static StringDO_QUERY_KNOWN_AGENTS_MESSAGE_WAITER_ID
           
 protected final static StringGET_VISUALIZER_NODES_MESSAGE_WAITER_ID
           
 final static RoutingTagINFORMATION_PERSONAE_ROUTING_TAG
           
 final static RoutingTagIP_AGENT_FUNDS_LISTENER_ROUTING_TAG
           
 final static RoutingTagIP_AGENT_KNOWLEDGE_ACTIVITY_LISTENER_TAG
           
 protected final static StringKNOWLEDGE_AGENT_MAM_ID_TAG_NAME
           
 protected final static StringKNOWLEDGE_AGENT_MAM_ID_VALUE_ATTRIBUTE
           
 protected final static StringKNOWLEDGE_AGENT_TAG_NAME
           
 protected final static StringKNOWLEDGE_AGENTS_TAG_NAME
           
 (package private) static CategoryLog
           
 private longLONELINESS_CHECK_INTERVAL
           
 private doubleLONELINESS_TRAIT_DELTA
           
 private RoutingTagm_attrMonitorAgentRoutingTag
           
 private Stringm_attrPassword
           
 private Stringm_attrUserName
           
 private Mapm_backupTraits
           
 protected Collectionm_knowledgeAgents
           
 private Datem_lastLonelinessCheck
           
 private doublem_oldAlienation
           
 private doublem_oldAmbition
           
 private doublem_oldAnxiety
           
 private doublem_requiredRelevance
           
 private Stackm_traitsStack
           
 protected final static StringMONITOR_AGENT_TAG_NAME
           
 protected final static StringPASSWORD_TAG_NAME
           
 protected final static longQUERY_IP_TIME_OUT
           
 protected final static longQUERY_IP_UPDATE_PERIOD
           
 protected final static longQUERY_KNOWN_AGENTS_TIMEOUT
           
 protected final static longQUERY_KNOWN_AGENTS_UPDATE_PERIOD
           
 protected final static StringUSER_NAME_TAG_NAME
           

Fields inherited from class mam.agent.TransactionalAgent
m_messageWaiters

Fields inherited from class mam.agent.Agent
AGENT_ACCESS_STATISTICS_TAG_NAME, AGENT_PROPERTIES_TAG_NAME, AGENT_TRAITS_TAG_NAME, ALL_AGENTS_ROUTING_TAG, DEFAULT_TAG_NAME, m_accessStatisticsGroup, m_agentProperties, m_facility, m_incomingMessageQueue, m_shutdown, m_sleepManager, ROLE_TAG_NAME

Fields inherited from class java.lang.Thread
MIN_PRIORITY, NORM_PRIORITY, MAX_PRIORITY

Constructor Summary
InformationPersonaeAgent(String userName, String password)
          Constructor for the InformationPersonaeAgent object
InformationPersonaeAgent()
          Constructor for the InformationPersonaeAgent object
InformationPersonaeAgent(Facility facility, AgentProperties defaultAgentProperties)
          Constructor for the InformationPersonaeAgent object

Method Summary
 protected voidcheckLoneliness()
          Description of the Method
 voidfinished(MessageWaiter messageWaiter)
          Description of the Method
 voidfromXmlElement(Element source)
          Description of the Method
 protected CollectiongetKnowledgeAgents()
          Gets the KnowledgeAgents attribute of the InformationPersonaeAgent object
 RoutingTaggetMonitorAgentRoutingTag()
          Gets the MonitorAgentRoutingTag attribute of the InformationPersonaeAgent object
 protected StringgetPassword()
          Gets the Password attribute of the InformationPersonaeAgent object
 StringgetQuote()
          Gets the Quote attribute of the InformationPersonaeAgent object
 protected doublegetRequiredRelevance()
          Gets the RequiredRelevance attribute of the InformationPersonaeAgent object
 protected StackgetTraitsStack()
          Gets the TraitsStack attribute of the InformationPersonaeAgent object
 protected StringgetUserName()
          Gets the UserName attribute of the InformationPersonaeAgent object
 protected voidgetVisualizerNodesFinished(MessageWaiter messageWaiter)
          Gets the VisualizerNodesFinished attribute of the InformationPersonaeAgent object
 voidhandleDoAddKnowledgeAgentMessage(AgentMessage m)
          Message: doAddKnowledgeAgent Parameters: Required: MamId:
 voidhandleDoAdjustFundsMessage(AgentMessage m)
           
 voidhandleDoAdjustTraitsMessage(AgentMessage m)
          Description of the Method
 voidhandleDoLoginMessage(AgentMessage m)
          Description of the Method
 voidhandleDoModifyTraitsMessage(AgentMessage m)
          Description of the Method
 voidhandleDoMooCombatDeathMessage(AgentMessage m)
          Description of the Method
 voidhandleDoQueryInformationPersonaeMessage(AgentMessage m)
          Message: doQueryIP Parameters: Required: QueryPhrase: Response message: eventQueryIPResults Parameters: Required: QueryPhrase: FoundResults: Optional: (only if FoundResults == true) KnowledgeAgents: -- of MamId, Integer, where MamId references URLKnowledgeAgents and Integer is a relevance rating 0-100 example: elementAt(0) == MamId, elementAt(1) == Integer, elementAt(2) == MamId, elementAt(3) == Integer, etc...
 voidhandleDoQueryKnownAgentsMessage(AgentMessage m)
          Description of the Method
 voidhandleDoRemoveKnowledgeAgentMessage(AgentMessage m)
          Message: doRemoveKnowledgeAgent Parameters: Required: MamId:
 voidhandleDoRestoreTraitsMessage(AgentMessage m)
          Description of the Method
 voidhandleDoSetMonitorAgentMessage(AgentMessage m)
          Description of the Method
 voidhandleDoShowMarketingTextMessage(AgentMessage message)
          Description of the Method
 voidhandleDoStreamKnownAgentsMessage(AgentMessage m)
          Description of the Method
 voidhandleEventDeclareFacilityShutdownMessage(AgentMessage m)
          Description of the Method
 voidhandleEventDeclareKnowledgeMessage(AgentMessage m)
          Description of the Method
 voidhandleEventQueryKnowledgeResultsMessage(AgentMessage m)
          Description of the Method
 voidhandleGetMonitorAgentMessage(AgentMessage m)
          Description of the Method
 voidhandleGetVisualizerNodesMessage(AgentMessage m)
          Description of the Method
 voidhandleSetLoginInfoMessage(AgentMessage m)
          Message: doSetUserNamePassword Sets the UserName/Password of this IP So far, username / password don't actually do much useful...
 protected voididleActivity()
          Description of the Method
 protected voidpopAgentTraits()
          Description of the Method
 protected voidpushAgentTraits()
          Description of the Method
 protected voidqueryKnowledgeAgentsFinished(MessageWaiter messageWaiter)
          Description of the Method
 protected voidqueryKnownAgentsFinished(MessageWaiter messageWaiter)
          Description of the Method
 protected voidqueryKnownAgentsIteration(MessageWaiter messageWaiter, Collection responses)
          Description of the Method
 protected voidregisterRoutingTags()
          Description of the Method
 voidresponsesReceived(MessageWaiter messageWaiter, Serializable identifier, Collection recentResponses)
          Description of the Method
 voidrun()
          Main processing method for the InformationPersonaeAgent object
 voidsetGuest(boolean b)
          Sets the Guest attribute of the InformationPersonaeAgent object
 protected voidsetKnowledgeAgents(Collection knowledgeAgents)
          Sets the KnowledgeAgents attribute of the InformationPersonaeAgent object
 voidsetMonitorAgentRoutingTag(RoutingTag monitorAgentRoutingTag)
          Sets the MonitorAgentRoutingTag attribute of the InformationPersonaeAgent object
 voidsetPassword(String password)
          Sets the Password attribute of the InformationPersonaeAgent object
 voidsetUserName(String userName)
          Sets the UserName attribute of the InformationPersonaeAgent object
 StringtoString()
          Description of the Method
 ElementtoXmlElement()
          Description of the Method
 ElementtoXmlElement(String tagName)
          Description of the Method
 protected voidunregisterRoutingTags()
          Description of the Method

Methods inherited from class mam.agent.TransactionalAgent
enqueueMessage, getMessageWaiters

Methods inherited from class mam.agent.Agent
getAccessStatisticsGroup, getAccount, getAgentProperties, getAgentTraits, getDescription, getFacility, getMamId, getNickname, getRole, getRoutingTagToSelf, getXmlSerializable, handleDoAgentShutdownMessage, handleGetAccessStatisticsMessage, handleGetAgentPropertiesMessage, handleGetAgentTraitsMessage, handleGetQuoteMessage, handleMessages, handleSetDescriptionMessage, handleSetNicknameMessage, invokeMessageHandler, requiresPersistence, setAccount, setAgentTraits, setDescription, setFacility, setMamId, setNickname, setRole, setXmlSerializable

Methods inherited from class java.lang.Thread
currentThread, yield, sleep, sleep, start, stop, stop, interrupt, interrupted, isInterrupted, destroy, isAlive, suspend, resume, setPriority, getPriority, setName, getName, getThreadGroup, activeCount, enumerate, countStackFrames, join, join, join, dumpStack, setDaemon, isDaemon, checkAccess, getContextClassLoader, setContextClassLoader

Methods inherited from class java.lang.Object
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize

Field Detail

AGENT_TRAITS_LISTENER_ROUTING_TAG

public final static RoutingTag AGENT_TRAITS_LISTENER_ROUTING_TAG

DO_QUERY_KNOWLEDGE_AGENTS_MESSAGE_WAITER_ID

protected final static String DO_QUERY_KNOWLEDGE_AGENTS_MESSAGE_WAITER_ID

DO_QUERY_KNOWN_AGENTS_MESSAGE_WAITER_ID

protected final static String DO_QUERY_KNOWN_AGENTS_MESSAGE_WAITER_ID

GET_VISUALIZER_NODES_MESSAGE_WAITER_ID

protected final static String GET_VISUALIZER_NODES_MESSAGE_WAITER_ID

INFORMATION_PERSONAE_ROUTING_TAG

public final static RoutingTag INFORMATION_PERSONAE_ROUTING_TAG

IP_AGENT_FUNDS_LISTENER_ROUTING_TAG

public final static RoutingTag IP_AGENT_FUNDS_LISTENER_ROUTING_TAG

IP_AGENT_KNOWLEDGE_ACTIVITY_LISTENER_TAG

public final static RoutingTag IP_AGENT_KNOWLEDGE_ACTIVITY_LISTENER_TAG

KNOWLEDGE_AGENT_MAM_ID_TAG_NAME

protected final static String KNOWLEDGE_AGENT_MAM_ID_TAG_NAME

KNOWLEDGE_AGENT_MAM_ID_VALUE_ATTRIBUTE

protected final static String KNOWLEDGE_AGENT_MAM_ID_VALUE_ATTRIBUTE

KNOWLEDGE_AGENT_TAG_NAME

protected final static String KNOWLEDGE_AGENT_TAG_NAME

KNOWLEDGE_AGENTS_TAG_NAME

protected final static String KNOWLEDGE_AGENTS_TAG_NAME

Log

static Category Log

LONELINESS_CHECK_INTERVAL

private long LONELINESS_CHECK_INTERVAL

LONELINESS_TRAIT_DELTA

private double LONELINESS_TRAIT_DELTA

m_attrMonitorAgentRoutingTag

private RoutingTag m_attrMonitorAgentRoutingTag

m_attrPassword

private String m_attrPassword

m_attrUserName

private String m_attrUserName

m_backupTraits

private Map m_backupTraits

m_knowledgeAgents

protected Collection m_knowledgeAgents

m_lastLonelinessCheck

private Date m_lastLonelinessCheck

m_oldAlienation

private double m_oldAlienation

m_oldAmbition

private double m_oldAmbition

m_oldAnxiety

private double m_oldAnxiety

m_requiredRelevance

private double m_requiredRelevance

m_traitsStack

private Stack m_traitsStack

MONITOR_AGENT_TAG_NAME

protected final static String MONITOR_AGENT_TAG_NAME

PASSWORD_TAG_NAME

protected final static String PASSWORD_TAG_NAME

QUERY_IP_TIME_OUT

protected final static long QUERY_IP_TIME_OUT

QUERY_IP_UPDATE_PERIOD

protected final static long QUERY_IP_UPDATE_PERIOD

QUERY_KNOWN_AGENTS_TIMEOUT

protected final static long QUERY_KNOWN_AGENTS_TIMEOUT

QUERY_KNOWN_AGENTS_UPDATE_PERIOD

protected final static long QUERY_KNOWN_AGENTS_UPDATE_PERIOD

USER_NAME_TAG_NAME

protected final static String USER_NAME_TAG_NAME
Constructor Detail

InformationPersonaeAgent

public InformationPersonaeAgent(String userName, String password)
Constructor for the InformationPersonaeAgent object
Parameters:
userName - Description of Parameter
password - Description of Parameter
Since:

InformationPersonaeAgent

public InformationPersonaeAgent()
Constructor for the InformationPersonaeAgent object
Since:

InformationPersonaeAgent

public InformationPersonaeAgent(Facility facility, AgentProperties defaultAgentProperties)
Constructor for the InformationPersonaeAgent object
Parameters:
facility - Description of Parameter
defaultAgentProperties - Description of Parameter
Since:
Method Detail

checkLoneliness

protected void checkLoneliness()
Description of the Method
Since:

finished

public void finished(MessageWaiter messageWaiter)
Description of the Method
Parameters:
messageWaiter - Description of Parameter
Since:

fromXmlElement

public void fromXmlElement(Element source)
Description of the Method
Parameters:
source - Description of Parameter
Since:

getKnowledgeAgents

protected Collection getKnowledgeAgents()
Gets the KnowledgeAgents attribute of the InformationPersonaeAgent object
Returns: The KnowledgeAgents value
Since:

getMonitorAgentRoutingTag

public RoutingTag getMonitorAgentRoutingTag()
Gets the MonitorAgentRoutingTag attribute of the InformationPersonaeAgent object
Returns: The MonitorAgentRoutingTag value
Since:

getPassword

protected String getPassword()
Gets the Password attribute of the InformationPersonaeAgent object
Returns: The Password value
Since:

getQuote

public String getQuote()
Gets the Quote attribute of the InformationPersonaeAgent object
Returns: The Quote value
Since:

getRequiredRelevance

protected double getRequiredRelevance()
Gets the RequiredRelevance attribute of the InformationPersonaeAgent object
Returns: The RequiredRelevance value
Since:

getTraitsStack

protected Stack getTraitsStack()
Gets the TraitsStack attribute of the InformationPersonaeAgent object
Returns: The TraitsStack value
Since:

getUserName

protected String getUserName()
Gets the UserName attribute of the InformationPersonaeAgent object
Returns: The UserName value
Since:

getVisualizerNodesFinished

protected void getVisualizerNodesFinished(MessageWaiter messageWaiter)
Gets the VisualizerNodesFinished attribute of the InformationPersonaeAgent object
Parameters:
messageWaiter - Description of Parameter
Since:

handleDoAddKnowledgeAgentMessage

public void handleDoAddKnowledgeAgentMessage(AgentMessage m)
Message: doAddKnowledgeAgent Parameters: Required: MamId:
Parameters:
m - Description of Parameter
Since:

handleDoAdjustFundsMessage

public void handleDoAdjustFundsMessage(AgentMessage m)

handleDoAdjustTraitsMessage

public void handleDoAdjustTraitsMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleDoLoginMessage

public void handleDoLoginMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleDoModifyTraitsMessage

public void handleDoModifyTraitsMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleDoMooCombatDeathMessage

public void handleDoMooCombatDeathMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleDoQueryInformationPersonaeMessage

public void handleDoQueryInformationPersonaeMessage(AgentMessage m)
Message: doQueryIP Parameters: Required: QueryPhrase: Response message: eventQueryIPResults Parameters: Required: QueryPhrase: FoundResults: Optional: (only if FoundResults == true) KnowledgeAgents: -- of MamId, Integer, where MamId references URLKnowledgeAgents and Integer is a relevance rating 0-100 example: elementAt(0) == MamId, elementAt(1) == Integer, elementAt(2) == MamId, elementAt(3) == Integer, etc...
Parameters:
m - Description of Parameter
Since:

handleDoQueryKnownAgentsMessage

public void handleDoQueryKnownAgentsMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleDoRemoveKnowledgeAgentMessage

public void handleDoRemoveKnowledgeAgentMessage(AgentMessage m)
Message: doRemoveKnowledgeAgent Parameters: Required: MamId:
Parameters:
m - Description of Parameter
Since:

handleDoRestoreTraitsMessage

public void handleDoRestoreTraitsMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleDoSetMonitorAgentMessage

public void handleDoSetMonitorAgentMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleDoShowMarketingTextMessage

public void handleDoShowMarketingTextMessage(AgentMessage message)
Description of the Method
Parameters:
message - Description of Parameter
Since:

handleDoStreamKnownAgentsMessage

public void handleDoStreamKnownAgentsMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleEventDeclareFacilityShutdownMessage

public void handleEventDeclareFacilityShutdownMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleEventDeclareKnowledgeMessage

public void handleEventDeclareKnowledgeMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleEventQueryKnowledgeResultsMessage

public void handleEventQueryKnowledgeResultsMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleGetMonitorAgentMessage

public void handleGetMonitorAgentMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleGetVisualizerNodesMessage

public void handleGetVisualizerNodesMessage(AgentMessage m)
Description of the Method
Parameters:
m - Description of Parameter
Since:

handleSetLoginInfoMessage

public void handleSetLoginInfoMessage(AgentMessage m)
Message: doSetUserNamePassword Sets the UserName/Password of this IP So far, username / password don't actually do much useful... Arguments: Required: UserName: Password: Optional: CurrUserName: --these are required in order to change an already existing CurrPassword: --username/password
Parameters:
m - Description of Parameter
Since:

idleActivity

protected void idleActivity()
Description of the Method
Since:

popAgentTraits

protected void popAgentTraits()
Description of the Method
Since:

pushAgentTraits

protected void pushAgentTraits()
Description of the Method
Since:

queryKnowledgeAgentsFinished

protected void queryKnowledgeAgentsFinished(MessageWaiter messageWaiter)
Description of the Method
Parameters:
messageWaiter - Description of Parameter
Since:

queryKnownAgentsFinished

protected void queryKnownAgentsFinished(MessageWaiter messageWaiter)
Description of the Method
Parameters:
messageWaiter - Description of Parameter
Since:

queryKnownAgentsIteration

protected void queryKnownAgentsIteration(MessageWaiter messageWaiter, Collection responses)
Description of the Method
Parameters:
messageWaiter - Description of Parameter
responses - Description of Parameter
Since:

registerRoutingTags

protected void registerRoutingTags()
Description of the Method
Since:

responsesReceived

public void responsesReceived(MessageWaiter messageWaiter, Serializable identifier, Collection recentResponses)
Description of the Method
Parameters:
messageWaiter - Description of Parameter
identifier - Description of Parameter
recentResponses - Description of Parameter
Since:

run

public void run()
Main processing method for the InformationPersonaeAgent object
Since:

setGuest

public void setGuest(boolean b)
Sets the Guest attribute of the InformationPersonaeAgent object
Parameters:
b - The new Guest value
Since:

setKnowledgeAgents

protected void setKnowledgeAgents(Collection knowledgeAgents)
Sets the KnowledgeAgents attribute of the InformationPersonaeAgent object
Parameters:
knowledgeAgents - The new KnowledgeAgents value
Since:

setMonitorAgentRoutingTag

public void setMonitorAgentRoutingTag(RoutingTag monitorAgentRoutingTag)
Sets the MonitorAgentRoutingTag attribute of the InformationPersonaeAgent object
Parameters:
monitorAgentRoutingTag - The new MonitorAgentRoutingTag value
Since:

setPassword

public void setPassword(String password)
Sets the Password attribute of the InformationPersonaeAgent object
Parameters:
password - The new Password value
Since:

setUserName

public void setUserName(String userName)
Sets the UserName attribute of the InformationPersonaeAgent object
Parameters:
userName - The new UserName value
Since:

toString

public String toString()
Description of the Method
Returns: Description of the Returned Value
Since:

toXmlElement

public Element toXmlElement()
Description of the Method
Returns: Description of the Returned Value
Since:

toXmlElement

public Element toXmlElement(String tagName)
Description of the Method
Parameters:
tagName - Description of Parameter
Returns: Description of the Returned Value
Since:

unregisterRoutingTags

protected void unregisterRoutingTags()
Description of the Method
Since: