Class FAtiMAConnector

java.lang.Object
ion.Meta.Element
All Implemented Interfaces:
Migrating, MigrationAware

public class FAtiMAConnector extends AgentMindConnector implements Migrating, MigrationAware
  • Field Summary

    Fields inherited from class cmion.architecture.CmionComponent

    architecture
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 Type
    Method
    Description
    protected void
    informs the mind that the architecture is ready for the mind executing actions
    void
    send a message to FAtiMA telling the mind to resume from a paused state
    boolean
    returns whether the connected Fatima is expected to distinguish between persistent and non persistent properties (true) or not (false)
    void
    execute(MindAction mindAction)
    executes a new action sent by the mind
    This 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.
    boolean
    returns whether we have a remote mind connected through a socket
    boolean
    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
    void
    notifyAgentConnected(String agentName, HashMap<String,Object> properties)
    this is called once FAtiMA has established a connection
    void
    this message is called by the connected fatima listener, when it receives a state from fatima
    void
    this message is called by the connected fatima listener, when it receives a state from fatima
    void
     
    void
     
    void
     
    void
     
    void
    parse the xml message containing the semantic memory of the connected agent, use it to update the world model
    protected void
    FAtiMA is currently not receiving any cancellation feedback messages, so we don't need to do anything in here
    protected void
    report the failure of an action to FAtiMA
    protected void
    report the success of an action to FAtiMA
    protected void
    informs the mind that a new entity (agent or object) has been added to the world model
    protected void
    informs the mind that an entity (agent or object) has been removed from the world model
    protected void
    processPropertyChanged(String entityName, String propertyName, String propertyValue, boolean persistent)
    informs the mind that a property of an agent or object in the world model has changed
    protected void
    processPropertyRemoved(String entityName, String propertyName)
    informs the mind that a property of an agent or object in the world model has been removed
    protected void
    in this message a mind can parse raw messages containing specialised communication / perceptions / requests
    protected void
    sends a remoteAction (an action that another agent/user has performed) to the mind
    void
    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.
    void
     
    void
    send a message to FAtiMA telling the mind to pause

    Methods inherited from class cmion.level3.AgentMindConnector

    cancel, newAction, onDestroy, registerHandlers

    Methods inherited from class cmion.architecture.CmionComponent

    getArchitecture, raise

    Methods inherited from class ion.Meta.Element

    destroy, getEventFilters, getEventHandlers, getRequestFilters, getRequestHandlers, getSimulation, getUID, schedule, wasDestroyed

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FAtiMAConnector

      public FAtiMAConnector(IArchitecture architecture)
      create a new FAtiMA connector that connects to an old version of FAtiMA that cannot migrate (kept for backwards compatibility)
    • FAtiMAConnector

      public 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 Details

    • awakeMind

      public void awakeMind()
      send a message to FAtiMA telling the mind to resume from a paused state
      Specified by:
      awakeMind in class AgentMindConnector
    • 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:
      isMindSleeping in class AgentMindConnector
    • processActionFailure

      protected void processActionFailure(MindAction a)
      report the failure of an action to FAtiMA
      Specified by:
      processActionFailure in class AgentMindConnector
    • processActionSuccess

      protected void processActionSuccess(MindAction a)
      report the success of an action to FAtiMA
      Specified by:
      processActionSuccess in class AgentMindConnector
    • processActionCancellation

      protected void processActionCancellation(MindAction a)
      FAtiMA is currently not receiving any cancellation feedback messages, so we don't need to do anything in here
      Specified by:
      processActionCancellation in class AgentMindConnector
    • processRemoteAction

      protected void processRemoteAction(MindAction remoteAction)
      Description copied from class: AgentMindConnector
      sends a remoteAction (an action that another agent/user has performed) to the mind
      Specified by:
      processRemoteAction in class AgentMindConnector
    • sendMindToSleep

      public void sendMindToSleep()
      send a message to FAtiMA telling the mind to pause
      Specified by:
      sendMindToSleep in class AgentMindConnector
    • processEntityAdded

      protected void processEntityAdded(String entityName)
      Description copied from class: AgentMindConnector
      informs the mind that a new entity (agent or object) has been added to the world model
      Specified by:
      processEntityAdded in class AgentMindConnector
    • processEntityRemoved

      protected void processEntityRemoved(String entityName)
      Description copied from class: AgentMindConnector
      informs the mind that an entity (agent or object) has been removed from the world model
      Specified by:
      processEntityRemoved in class AgentMindConnector
    • processPropertyChanged

      protected void processPropertyChanged(String entityName, String propertyName, String propertyValue, boolean persistent)
      Description copied from class: AgentMindConnector
      informs the mind that a property of an agent or object in the world model has changed
      Specified by:
      processPropertyChanged in class AgentMindConnector
    • processPropertyRemoved

      protected void processPropertyRemoved(String entityName, String propertyName)
      Description copied from class: AgentMindConnector
      informs the mind that a property of an agent or object in the world model has been removed
      Specified by:
      processPropertyRemoved in class AgentMindConnector
    • notifyAgentConnected

      public void notifyAgentConnected(String agentName, HashMap<String,Object> properties)
      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:
      isConnected in class CmionComponent
    • architectureReady

      protected void architectureReady()
      Description copied from class: AgentMindConnector
      informs the mind that the architecture is ready for the mind executing actions
      Specified by:
      architectureReady in class AgentMindConnector
    • getMessageTag

      public String getMessageTag()
      Description copied from interface: Migrating
      This 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:
      getMessageTag in interface Migrating
      Returns:
      the object signature.
    • onMigrationFailure

      public void onMigrationFailure()
      Specified by:
      onMigrationFailure in interface MigrationAware
    • onMigrationIn

      public void onMigrationIn()
      Specified by:
      onMigrationIn in interface MigrationAware
    • onMigrationOut

      public void onMigrationOut()
      Specified by:
      onMigrationOut in interface MigrationAware
    • onMigrationSuccess

      public void onMigrationSuccess()
      Specified by:
      onMigrationSuccess in interface MigrationAware
    • restoreState

      public void restoreState(Element message)
      Description copied from interface: Migrating
      This method parses the XML element provided and restores the state of the object.
      Specified by:
      restoreState in interface Migrating
      Parameters:
      message - An XML element that contains the state to be parsed
    • saveStateToDisk

      public void saveStateToDisk()
    • saveState

      public Element saveState(Document doc)
      Description copied from interface: Migrating
      This method encodes the current state of the object and other relevant information in an XML element in order to be migrated.
      Specified by:
      saveState in interface Migrating
    • notifyGetState

      public void notifyGetState(String state)
      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

      public void execute(MindAction mindAction)
      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

      protected void processRawMessage(String message)
      Description copied from class: AgentMindConnector
      in this message a mind can parse raw messages containing specialised communication / perceptions / requests
      Specified by:
      processRawMessage in class AgentMindConnector
    • parseSemanticMemory

      public void parseSemanticMemory(String msg)
      parse the xml message containing the semantic memory of the connected agent, use it to update the world model