Package FAtiMA.Core
Class AgentCore
- java.lang.Object
-
- FAtiMA.Core.AgentCore
-
- All Implemented Interfaces:
AgentModel,IGetModelStrategy,java.io.Serializable
public class AgentCore extends java.lang.Object implements java.io.Serializable, AgentModel, IGetModelStrategy
- See Also:
- Serialized Form
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description AgentCore(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddComponent(IComponent c)voidagentCoreLoad(short agentPlatform, java.lang.String host, int port, java.lang.String directory, java.lang.String fileName)static NameapplyPerspective(Name n, java.lang.String agentName)java.lang.StringdisplayName()Gets the agent's name that is displayed externallyvoidEnforceCopingStrategy(AgentModel am, java.lang.String coping)AgentModelexecute(Symbol ToM)ActionLibrarygetActionLibrary()booleangetAgentLoad()IComponentgetComponent(java.lang.String name)java.util.Collection<IComponent>getComponents()EmotionalStategetEmotionalState()GoalLibrarygetGoalLibrary()MemorygetMemory()AgentModelgetModelToTest(Symbol ToM)java.lang.StringgetName()Gets the name of the agentjava.util.Collection<IProcessExternalRequestComponent>getProcessExternalRequestComponents()RemoteAgentgetRemoteAgent()java.lang.StringgetSerializedState()returns a String that contains the serialized internal state of the agent in a String formatvoidinitialize(java.lang.String scenariosFile, java.lang.String scenarioName, java.lang.String agentName)booleanisSelf()voidLoadAgentState(java.lang.String fileName)voidPerceiveActionFailed(Event e)voidPerceiveEntityRemoved(java.lang.String entity)voidPerceiveEvent(Event e)Perceives a given event from the virtual worldvoidPerceiveLookAt(java.lang.String subject, java.lang.String target)voidPerceivePropertyChanged(java.lang.String ToM, Name propertyName, java.lang.String value)voidPerceivePropertyChanged(java.lang.String ToM, java.lang.String subject, java.lang.String property, java.lang.String value)voidPerceivePropertyRemoved(java.lang.String subject, java.lang.String property)static NameremovePerspective(Name n, java.lang.String agentName)voidRequestAgentSave()voidRequestMemorySave()voidReset()Resets the agent's reasoning layers (deliberative + cognitive)java.lang.Stringrole()Gets the agent's rolevoidRun()Runs the agent, endless loop until there is a shutdownvoidsetModelStrategy(IGetModelStrategy strat)voidsetSerializedState(java.lang.String state)sets the internal state of the agent to the state which is contained in the passed stringjava.lang.Stringsex()Gets the gender of the agentEmotionalStatesimulateEmotionalState(Event simulatedEvent, IComponent callingComponent)voidStartAgent()Starting the agent added by Meiyii 19/11/09voidupdateEmotions(AppraisalFrame af)
-
-
-
Field Detail
-
MIND_PATH
public static final java.lang.String MIND_PATH
- See Also:
- Constant Field Values
-
MIND_PATH_ANDROID
public static final java.lang.String MIND_PATH_ANDROID
- See Also:
- Constant Field Values
-
MEMORY_FILENAME
public static final java.lang.String MEMORY_FILENAME
- See Also:
- Constant Field Values
-
ACTION_CONTEXT
public static final Name ACTION_CONTEXT
-
_generalComponents
protected java.util.HashMap<java.lang.String,IComponent> _generalComponents
-
_processEmotionComponents
protected java.util.ArrayList<IProcessEmotionComponent> _processEmotionComponents
-
_behaviourComponents
protected java.util.ArrayList<IBehaviourComponent> _behaviourComponents
-
_modelOfOtherComponents
protected java.util.ArrayList<IModelOfOtherComponent> _modelOfOtherComponents
-
_processExternalRequestComponents
protected java.util.ArrayList<IProcessExternalRequestComponent> _processExternalRequestComponents
-
_processPerceptionsComponents
protected java.util.ArrayList<IAdvancedPerceptionsComponent> _processPerceptionsComponents
-
_affectDerivationComponents
protected java.util.ArrayList<IAffectDerivationComponent> _affectDerivationComponents
-
_appraisalComponents
protected java.util.ArrayList<IAppraisalDerivationComponent> _appraisalComponents
-
_detectThreatStrat
protected IDetectThreatStrategy _detectThreatStrat
-
_centralParser
protected CentralXMLParser _centralParser
-
_emotionalState
protected EmotionalState _emotionalState
-
_memory
protected Memory _memory
-
_goalLibrary
protected GoalLibrary _goalLibrary
-
_actionLibrary
protected ActionLibrary _actionLibrary
-
_shutdown
protected boolean _shutdown
-
_actionsForExecution
protected java.util.ArrayList<ValuedAction> _actionsForExecution
-
_perceivedEvents
protected java.util.ArrayList<Event> _perceivedEvents
-
_remoteAgent
protected RemoteAgent _remoteAgent
-
_role
protected java.lang.String _role
-
_name
protected java.lang.String _name
-
_sex
protected java.lang.String _sex
-
_displayName
protected java.lang.String _displayName
-
_speechAct
protected SpeechAct _speechAct
-
_currentEmotion
protected java.lang.String _currentEmotion
-
_numberOfCycles
protected long _numberOfCycles
-
_totalexecutingtime
protected long _totalexecutingtime
-
_agentDisplay
protected AgentDisplay _agentDisplay
-
_showStateWindow
protected boolean _showStateWindow
-
_logger
protected java.util.logging.Logger _logger
-
-
Method Detail
-
initialize
public void initialize(java.lang.String scenariosFile, java.lang.String scenarioName, java.lang.String agentName) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException, UnknownGoalException, ActionsParsingException, GoalLibParsingException- Throws:
javax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXExceptionjava.io.IOExceptionUnknownGoalExceptionActionsParsingExceptionGoalLibParsingException
-
agentCoreLoad
public void agentCoreLoad(short agentPlatform, java.lang.String host, int port, java.lang.String directory, java.lang.String fileName)
-
isSelf
public boolean isSelf()
- Specified by:
isSelfin interfaceAgentModel
-
addComponent
public void addComponent(IComponent c)
-
getRemoteAgent
public RemoteAgent getRemoteAgent()
- Specified by:
getRemoteAgentin interfaceAgentModel
-
getComponent
public IComponent getComponent(java.lang.String name)
- Specified by:
getComponentin interfaceAgentModel
-
getComponents
public java.util.Collection<IComponent> getComponents()
-
getProcessExternalRequestComponents
public java.util.Collection<IProcessExternalRequestComponent> getProcessExternalRequestComponents()
-
getActionLibrary
public ActionLibrary getActionLibrary()
- Specified by:
getActionLibraryin interfaceAgentModel
-
PerceiveActionFailed
public void PerceiveActionFailed(Event e)
-
displayName
public java.lang.String displayName()
Gets the agent's name that is displayed externally- Returns:
- the agent's external name
-
getEmotionalState
public EmotionalState getEmotionalState()
- Specified by:
getEmotionalStatein interfaceAgentModel
-
getMemory
public Memory getMemory()
- Specified by:
getMemoryin interfaceAgentModel
-
getAgentLoad
public boolean getAgentLoad()
-
getGoalLibrary
public GoalLibrary getGoalLibrary()
- Specified by:
getGoalLibraryin interfaceAgentModel
-
getName
public java.lang.String getName()
Gets the name of the agent- Specified by:
getNamein interfaceAgentModel- Returns:
- the agent's name
-
setModelStrategy
public void setModelStrategy(IGetModelStrategy strat)
- Specified by:
setModelStrategyin interfaceAgentModel
-
EnforceCopingStrategy
public void EnforceCopingStrategy(AgentModel am, java.lang.String coping)
-
LoadAgentState
public void LoadAgentState(java.lang.String fileName) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
PerceiveEvent
public void PerceiveEvent(Event e)
Perceives a given event from the virtual world- Parameters:
e- - the Event to perceive
-
PerceiveLookAt
public void PerceiveLookAt(java.lang.String subject, java.lang.String target)
-
PerceivePropertyChanged
public void PerceivePropertyChanged(java.lang.String ToM, Name propertyName, java.lang.String value)
-
PerceivePropertyChanged
public void PerceivePropertyChanged(java.lang.String ToM, java.lang.String subject, java.lang.String property, java.lang.String value)
-
PerceivePropertyRemoved
public void PerceivePropertyRemoved(java.lang.String subject, java.lang.String property)
-
PerceiveEntityRemoved
public void PerceiveEntityRemoved(java.lang.String entity)
-
Reset
public void Reset()
Resets the agent's reasoning layers (deliberative + cognitive)
-
role
public java.lang.String role()
Gets the agent's role- Returns:
- the role of the agent (Victim, Bully, etc)
-
Run
public void Run()
Runs the agent, endless loop until there is a shutdown
-
simulateEmotionalState
public EmotionalState simulateEmotionalState(Event simulatedEvent, IComponent callingComponent)
- Specified by:
simulateEmotionalStatein interfaceAgentModel
-
RequestAgentSave
public void RequestAgentSave()
-
RequestMemorySave
public void RequestMemorySave()
-
sex
public java.lang.String sex()
Gets the gender of the agent- Returns:
- the agent's sex
-
StartAgent
public void StartAgent()
Starting the agent added by Meiyii 19/11/09
-
getSerializedState
public java.lang.String getSerializedState()
returns a String that contains the serialized internal state of the agent in a String format
-
getModelToTest
public AgentModel getModelToTest(Symbol ToM)
- Specified by:
getModelToTestin interfaceAgentModel
-
execute
public AgentModel execute(Symbol ToM)
- Specified by:
executein interfaceIGetModelStrategy
-
setSerializedState
public void setSerializedState(java.lang.String state)
sets the internal state of the agent to the state which is contained in the passed string
-
updateEmotions
public void updateEmotions(AppraisalFrame af)
- Specified by:
updateEmotionsin interfaceAgentModel
-
-