Class SpeechAct

java.lang.Object
FAtiMA.Core.sensorEffector.RemoteAction
FAtiMA.Core.sensorEffector.SpeechAct
All Implemented Interfaces:
Serializable

public class SpeechAct extends RemoteAction
Represents a SpeechAct
Author:
Joao Dias
See Also:
  • Field Details

  • Constructor Details

    • SpeechAct

      public SpeechAct()
      Creates a new empty SpeechAct
    • SpeechAct

      public SpeechAct(ValuedAction speechAction, AgentModel am)
      Creates a new SpeechAct from a ValuedAction
  • Method Details

    • ParseFromXml

      public static RemoteAction ParseFromXml(String xml)
      Parses a SpeechAct from a XML formatted String
      Parameters:
      xml - - the XML string to be parsed
      Returns:
      the parsed SpeechAct
    • isSpeechAct

      public static boolean isSpeechAct(String action)
      Checks if the received action corresponds to a SpeechAct or not (it may be a Question, a Reply, a Suppport, etc)
      Parameters:
      action - - the action to check
      Returns:
      true if the action actually corresponds to a SpeechAct, false otherwise
    • AddContextVariable

      public void AddContextVariable(String name, String value)
      Adds a context variable (name-value pair) to the SpeechAct
      Parameters:
      name - - the name of the context variable
      value - - the value of the context variable
    • getContextVariables

      public ArrayList<Parameter> getContextVariables()
    • getReceiver

      public String getReceiver()
      Gets the SpeechAct's receiver
      Returns:
      the receiver
    • getSender

      public String getSender()
      Gets the SpeechAct's sender
      Returns:
      the sender of the SpeechAct
    • getMeaning

      public String getMeaning()
      Gets the SpeechAct's meaning (ex: insult, greeting, etc)
      Returns:
      the meaning of the SpeechAct
    • getUtterance

      public String getUtterance()
      Gets the specific utterance of the SpeechAct (ex: "Hi John")
      Returns:
      the SpeechAct's utterance
    • setReceiver

      public void setReceiver(String string)
      Sets the SpeechAct's receiver
      Parameters:
      string - - the receiver to store in the SpeechAct
    • setSender

      public void setSender(String string)
      Sets the SpeechAct's sender
      Parameters:
      string - - the sender to store in the SpeechAct
    • setMeaning

      public void setMeaning(String string)
      Sets the SpeechAct's meaning (ex: insult, greeting)
      Parameters:
      string - - the type to store in the SpeechAct
    • setUtterance

      public void setUtterance(String string)
      Sets the SpeechAct specific utterance (ex: "what a wimp", "hi Paul")
      Parameters:
      string - - the utterance to store in the SpeechAct
    • getAMSummary

      public String getAMSummary()
    • setAMSummary

      public void setAMSummary(String summary)
    • toEvent

      public Event toEvent(short actionEventType)
      Converts the SpeechAct to an Event
      Overrides:
      toEvent in class RemoteAction
      Returns:
      the converted Event
    • toXML

      public String toXML()
      Converts the SpeechAct to XML (the inverse of the Parse method)
      Overrides:
      toXML in class RemoteAction
      Returns:
      a XML string that contains the SpeechAct information
    • toLanguageEngine

      public String toLanguageEngine()
      Converts the SpeechAct to XML that is ready to be sent to the LanguageEngine for the generation of a specific utterance
      Returns:
      a XML string that contains the SpeechAct information
    • toPlainStringMessage

      public String toPlainStringMessage()
      Overrides:
      toPlainStringMessage in class RemoteAction
      Returns:
      string