Class RemoteAgent

All Implemented Interfaces:
Runnable
Direct Known Subclasses:
IONRemoteAgent, WorldSimulatorRemoteAgent

public abstract class RemoteAgent extends SocketListener
Connection to the virtual world as a RemoteAgent. Implements the architecture Sensors and Effectors
Author:
Joao Dias, Samuel Mascarenhas
  • Field Details

  • Constructor Details

  • Method Details

    • waitForServerAck

      protected void waitForServerAck() throws IOException
      Throws:
      IOException
    • getInitializationMessage

      public abstract String getInitializationMessage(Map<String,String> arguments)
    • AddAction

      public final void AddAction(ValuedAction action)
      Add an action to an execution list. The action will be executed as soon as possible.
      Parameters:
      action - - the ValuedAction to execute
    • Clear

      public final void Clear()
      Clears all the actions that an agent has in the execution list
    • ExecuteNextAction

      public final void ExecuteNextAction(AgentModel am)
      Sends for execution the next available action
    • FinishedExecuting

      public final boolean FinishedExecuting()
      indicates if the agent has finished the execution of the last action, and thus it can perform another action
      Returns:
      true if the agent has finished execution and can perform another action, false otherwise
    • isRunning

      public final boolean isRunning()
      indicates if the RemoteAgent is running normally or if it was stopped by an explicit stop command send by the virtual world
      Returns:
      true if the agent is running normally, false if the agent must pause its normal functioning
    • cancelAction

      public void cancelAction()
    • setProcessActionStrategy

      public void setProcessActionStrategy(IProcessActionStrategy strat)
    • sendCancelActionMsg

      protected abstract void sendCancelActionMsg(RemoteAction ra)
    • processMessage

      public void processMessage(String msg)
      Specified by:
      processMessage in class SocketListener
    • Send

      protected final boolean Send(String msg)
    • SendAction

      protected abstract boolean SendAction(RemoteAction ra)
    • ReportInternalPropertyChange

      public abstract void ReportInternalPropertyChange(String agentName, Name property, Object value)
    • ReportInternalState

      public void ReportInternalState(EmotionalState es)
    • ExpressEmotion

      public void ExpressEmotion(String emotion)
      Expresses a given emotion in the virtual world
      Parameters:
      emotion - - the emotion to be expressed
    • SendEmotionalState

      public void SendEmotionalState(String emotionalStateDescription)
    • StartAction

      protected final void StartAction(AgentModel am, ValuedAction vAction)
    • isShutDown

      public final boolean isShutDown()
      indicates if the remote agent is running properly or if has been shut down either by an explicit shut down command or by a closed socket connection
      Returns:
      false if the remote agent is running properly and connected to the virtual world, true otherwise
    • ShutDown

      public final void ShutDown()
      Orders the remote agent to shutdown and disconnect from the virtual world
    • SaveState

      public void SaveState(String fileName)
    • LoadState

      public void LoadState(String fileName)
    • PropertyChangedPerception

      protected abstract void PropertyChangedPerception(String perc)
    • PropertyRemovedPerception

      protected abstract void PropertyRemovedPerception(String perc)
    • UserSpeechPerception

      protected abstract void UserSpeechPerception(String perc)
    • ActionStartedPerception

      protected abstract void ActionStartedPerception(String perc)
    • ActionFinishedPerception

      protected abstract void ActionFinishedPerception(String perc)
    • ActionFailedPerception

      protected abstract void ActionFailedPerception(String perc)
    • ShutDownPerception

      protected void ShutDownPerception(String perc)
    • IdentifyUserPerception

      protected void IdentifyUserPerception(String perc)
    • CmdPerception

      protected void CmdPerception(String perc)
    • AgentsPerception

      protected void AgentsPerception(String perc)
    • LookAtPerception

      protected void LookAtPerception(String perc)
    • EntityAddedPerception

      protected void EntityAddedPerception(String perc)
    • EntityRemovedPerception

      protected void EntityRemovedPerception(String perc)
    • AdvanceTimePerception

      protected void AdvanceTimePerception(String perc)
    • StopTimePerception

      protected void StopTimePerception(String perc)
    • ResumeTimePerception

      protected void ResumeTimePerception(String perc)