Package cmion.level3.fatima
Class FAtiMAConnector
java.lang.Object
ion.Meta.Element
cmion.architecture.CmionComponent
cmion.level3.AgentMindConnector
cmion.level3.fatima.FAtiMAConnector
- All Implemented Interfaces:
Migrating,MigrationAware
-
Field Summary
Fields inherited from class cmion.architecture.CmionComponent
architecture -
Constructor Summary
ConstructorsConstructorDescriptionFAtiMAConnector(IArchitecture architecture) create a new FAtiMA connector that connects to an old version of FAtiMA that cannot migrate (kept for backwards compatibility)FAtiMAConnector(IArchitecture architecture, String options) create a new FAtiMA connector, with an additional options parameter this can at the moment contain any of the following substrings in any order - "migrating" : indicates that the fatima connecting here supports migration (see boolean canMigrate) - "sleeping" : immediately send this mind to sleep once it is connected, this is useful, if this platform is awaiting incoming migration and currently inactive - "modular" : indicates the fatima connecting is expected to be the recent (2010+) modular version or an older one (see boolean modular) - "persistent": indicates that the fatima connecting is expected to be the recent (15/11/2011+) version that can disinguish between persistent and non persistent knowledge (see boolean distinguishPersistent) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidinforms the mind that the architecture is ready for the mind executing actionsvoidsend a message to FAtiMA telling the mind to resume from a paused statebooleanreturns whether the connected Fatima is expected to distinguish between persistent and non persistent properties (true) or not (false)voidexecute(MindAction mindAction) executes a new action sent by the mindThis method returns a string that is used to identify the state that is encoded by the implementing class and to select the messages that will be delivered to it.booleanreturns whether we have a remote mind connected through a socketbooleanreturns whether FAtiMA is sleeping/paused or not, this function should be called in conjunction with isConnected, because its return value makes no sense if no mind is connectedvoidnotifyAgentConnected(String agentName, HashMap<String, Object> properties) this is called once FAtiMA has established a connectionvoidnotifyGetState(String state) this message is called by the connected fatima listener, when it receives a state from fatimavoidthis message is called by the connected fatima listener, when it receives a state from fatimavoidvoidvoidvoidvoidparse the xml message containing the semantic memory of the connected agent, use it to update the world modelprotected voidFAtiMA is currently not receiving any cancellation feedback messages, so we don't need to do anything in hereprotected voidreport the failure of an action to FAtiMAprotected voidreport the success of an action to FAtiMAprotected voidprocessEntityAdded(String entityName) informs the mind that a new entity (agent or object) has been added to the world modelprotected voidprocessEntityRemoved(String entityName) informs the mind that an entity (agent or object) has been removed from the world modelprotected voidprocessPropertyChanged(String entityName, String propertyName, String propertyValue, boolean persistent) informs the mind that a property of an agent or object in the world model has changedprotected voidprocessPropertyRemoved(String entityName, String propertyName) informs the mind that a property of an agent or object in the world model has been removedprotected voidprocessRawMessage(String message) in this message a mind can parse raw messages containing specialised communication / perceptions / requestsprotected voidprocessRemoteAction(MindAction remoteAction) sends a remoteAction (an action that another agent/user has performed) to the mindvoidrestoreState(Element message) This method parses the XML element provided and restores the state of the object.This method encodes the current state of the object and other relevant information in an XML element in order to be migrated.voidvoidsend a message to FAtiMA telling the mind to pauseMethods inherited from class cmion.level3.AgentMindConnector
cancel, newAction, onDestroy, registerHandlersMethods inherited from class cmion.architecture.CmionComponent
getArchitecture, raiseMethods inherited from class ion.Meta.Element
destroy, getEventFilters, getEventHandlers, getRequestFilters, getRequestHandlers, getSimulation, getUID, schedule, wasDestroyed
-
Constructor Details
-
FAtiMAConnector
create a new FAtiMA connector that connects to an old version of FAtiMA that cannot migrate (kept for backwards compatibility) -
FAtiMAConnector
create a new FAtiMA connector, with an additional options parameter this can at the moment contain any of the following substrings in any order - "migrating" : indicates that the fatima connecting here supports migration (see boolean canMigrate) - "sleeping" : immediately send this mind to sleep once it is connected, this is useful, if this platform is awaiting incoming migration and currently inactive - "modular" : indicates the fatima connecting is expected to be the recent (2010+) modular version or an older one (see boolean modular) - "persistent": indicates that the fatima connecting is expected to be the recent (15/11/2011+) version that can disinguish between persistent and non persistent knowledge (see boolean distinguishPersistent)
-
-
Method Details
-
awakeMind
public void awakeMind()send a message to FAtiMA telling the mind to resume from a paused state- Specified by:
awakeMindin classAgentMindConnector
-
isMindSleeping
public boolean isMindSleeping()returns whether FAtiMA is sleeping/paused or not, this function should be called in conjunction with isConnected, because its return value makes no sense if no mind is connected- Specified by:
isMindSleepingin classAgentMindConnector
-
processActionFailure
report the failure of an action to FAtiMA- Specified by:
processActionFailurein classAgentMindConnector
-
processActionSuccess
report the success of an action to FAtiMA- Specified by:
processActionSuccessin classAgentMindConnector
-
processActionCancellation
FAtiMA is currently not receiving any cancellation feedback messages, so we don't need to do anything in here- Specified by:
processActionCancellationin classAgentMindConnector
-
processRemoteAction
Description copied from class:AgentMindConnectorsends a remoteAction (an action that another agent/user has performed) to the mind- Specified by:
processRemoteActionin classAgentMindConnector
-
sendMindToSleep
public void sendMindToSleep()send a message to FAtiMA telling the mind to pause- Specified by:
sendMindToSleepin classAgentMindConnector
-
processEntityAdded
Description copied from class:AgentMindConnectorinforms the mind that a new entity (agent or object) has been added to the world model- Specified by:
processEntityAddedin classAgentMindConnector
-
processEntityRemoved
Description copied from class:AgentMindConnectorinforms the mind that an entity (agent or object) has been removed from the world model- Specified by:
processEntityRemovedin classAgentMindConnector
-
processPropertyChanged
protected void processPropertyChanged(String entityName, String propertyName, String propertyValue, boolean persistent) Description copied from class:AgentMindConnectorinforms the mind that a property of an agent or object in the world model has changed- Specified by:
processPropertyChangedin classAgentMindConnector
-
processPropertyRemoved
Description copied from class:AgentMindConnectorinforms the mind that a property of an agent or object in the world model has been removed- Specified by:
processPropertyRemovedin classAgentMindConnector
-
notifyAgentConnected
this is called once FAtiMA has established a connection -
isConnected
public boolean isConnected()returns whether we have a remote mind connected through a socket- Overrides:
isConnectedin classCmionComponent
-
architectureReady
protected void architectureReady()Description copied from class:AgentMindConnectorinforms the mind that the architecture is ready for the mind executing actions- Specified by:
architectureReadyin classAgentMindConnector
-
getMessageTag
Description copied from interface:MigratingThis method returns a string that is used to identify the state that is encoded by the implementing class and to select the messages that will be delivered to it.- Specified by:
getMessageTagin interfaceMigrating- Returns:
- the object signature.
-
onMigrationFailure
public void onMigrationFailure()- Specified by:
onMigrationFailurein interfaceMigrationAware
-
onMigrationIn
public void onMigrationIn()- Specified by:
onMigrationInin interfaceMigrationAware
-
onMigrationOut
public void onMigrationOut()- Specified by:
onMigrationOutin interfaceMigrationAware
-
onMigrationSuccess
public void onMigrationSuccess()- Specified by:
onMigrationSuccessin interfaceMigrationAware
-
restoreState
Description copied from interface:MigratingThis method parses the XML element provided and restores the state of the object.- Specified by:
restoreStatein interfaceMigrating- Parameters:
message- An XML element that contains the state to be parsed
-
saveStateToDisk
public void saveStateToDisk() -
saveState
Description copied from interface:MigratingThis method encodes the current state of the object and other relevant information in an XML element in order to be migrated. -
notifyGetState
this message is called by the connected fatima listener, when it receives a state from fatima -
notifySetState
public void notifySetState()this message is called by the connected fatima listener, when it receives a state from fatima -
execute
executes a new action sent by the mind -
distinguishesPersistent
public boolean distinguishesPersistent()returns whether the connected Fatima is expected to distinguish between persistent and non persistent properties (true) or not (false) -
processRawMessage
Description copied from class:AgentMindConnectorin this message a mind can parse raw messages containing specialised communication / perceptions / requests- Specified by:
processRawMessagein classAgentMindConnector
-
parseSemanticMemory
parse the xml message containing the semantic memory of the connected agent, use it to update the world model
-