Package FAtiMA.Core.sensorEffector
Class SpeechAct
- java.lang.Object
-
- FAtiMA.Core.sensorEffector.RemoteAction
-
- FAtiMA.Core.sensorEffector.SpeechAct
-
- All Implemented Interfaces:
java.io.Serializable
public class SpeechAct extends RemoteAction
Represents a SpeechAct- Author:
- Joao Dias
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringConfrontationstatic java.lang.StringCopingSpeechstatic java.lang.StringQuestionstatic java.lang.StringReinforcestatic java.lang.StringReplystatic java.lang.StringSpeechstatic java.lang.StringUserSpeech-
Fields inherited from class FAtiMA.Core.sensorEffector.RemoteAction
_actionType, _cameraAngle, _cameraShot, _cameraTarget, _emotion, _intensity, _parameters, _subject, _target
-
-
Constructor Summary
Constructors Constructor Description SpeechAct()Creates a new empty SpeechActSpeechAct(ValuedAction speechAction, AgentModel am)Creates a new SpeechAct from a ValuedAction
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidAddContextVariable(java.lang.String name, java.lang.String value)Adds a context variable (name-value pair) to the SpeechActjava.lang.StringgetAMSummary()java.util.ArrayList<Parameter>getContextVariables()java.lang.StringgetMeaning()Gets the SpeechAct's meaning (ex: insult, greeting, etc)java.lang.StringgetReceiver()Gets the SpeechAct's receiverjava.lang.StringgetSender()Gets the SpeechAct's senderjava.lang.StringgetUtterance()Gets the specific utterance of the SpeechAct (ex: "Hi John")static booleanisSpeechAct(java.lang.String action)Checks if the received action corresponds to a SpeechAct or not (it may be a Question, a Reply, a Suppport, etc)static RemoteActionParseFromXml(java.lang.String xml)Parses a SpeechAct from a XML formatted StringvoidsetAMSummary(java.lang.String summary)voidsetMeaning(java.lang.String string)Sets the SpeechAct's meaning (ex: insult, greeting)voidsetReceiver(java.lang.String string)Sets the SpeechAct's receivervoidsetSender(java.lang.String string)Sets the SpeechAct's sendervoidsetUtterance(java.lang.String string)Sets the SpeechAct specific utterance (ex: "what a wimp", "hi Paul")EventtoEvent(short actionEventType)Converts the SpeechAct to an Eventjava.lang.StringtoLanguageEngine()Converts the SpeechAct to XML that is ready to be sent to the LanguageEngine for the generation of a specific utterancejava.lang.StringtoPlainStringMessage()java.lang.StringtoXML()Converts the SpeechAct to XML (the inverse of the Parse method)-
Methods inherited from class FAtiMA.Core.sensorEffector.RemoteAction
AddParameter, cameraToXMl, getActionType, GetParameters, getSubject, getTarget, setActionType, setCameraAngle, setCameraShot, setCameraTarget, setIntensity, setSubject, setTarget
-
-
-
-
Field Detail
-
Question
public static final java.lang.String Question
- See Also:
- Constant Field Values
-
Reply
public static final java.lang.String Reply
- See Also:
- Constant Field Values
-
Reinforce
public static final java.lang.String Reinforce
- See Also:
- Constant Field Values
-
Speech
public static final java.lang.String Speech
- See Also:
- Constant Field Values
-
Confrontation
public static final java.lang.String Confrontation
- See Also:
- Constant Field Values
-
UserSpeech
public static final java.lang.String UserSpeech
- See Also:
- Constant Field Values
-
CopingSpeech
public static final java.lang.String CopingSpeech
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SpeechAct
public SpeechAct()
Creates a new empty SpeechAct
-
SpeechAct
public SpeechAct(ValuedAction speechAction, AgentModel am)
Creates a new SpeechAct from a ValuedAction
-
-
Method Detail
-
ParseFromXml
public static RemoteAction ParseFromXml(java.lang.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(java.lang.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(java.lang.String name, java.lang.String value)Adds a context variable (name-value pair) to the SpeechAct- Parameters:
name- - the name of the context variablevalue- - the value of the context variable
-
getContextVariables
public java.util.ArrayList<Parameter> getContextVariables()
-
getReceiver
public java.lang.String getReceiver()
Gets the SpeechAct's receiver- Returns:
- the receiver
-
getSender
public java.lang.String getSender()
Gets the SpeechAct's sender- Returns:
- the sender of the SpeechAct
-
getMeaning
public java.lang.String getMeaning()
Gets the SpeechAct's meaning (ex: insult, greeting, etc)- Returns:
- the meaning of the SpeechAct
-
getUtterance
public java.lang.String getUtterance()
Gets the specific utterance of the SpeechAct (ex: "Hi John")- Returns:
- the SpeechAct's utterance
-
setReceiver
public void setReceiver(java.lang.String string)
Sets the SpeechAct's receiver- Parameters:
string- - the receiver to store in the SpeechAct
-
setSender
public void setSender(java.lang.String string)
Sets the SpeechAct's sender- Parameters:
string- - the sender to store in the SpeechAct
-
setMeaning
public void setMeaning(java.lang.String string)
Sets the SpeechAct's meaning (ex: insult, greeting)- Parameters:
string- - the type to store in the SpeechAct
-
setUtterance
public void setUtterance(java.lang.String string)
Sets the SpeechAct specific utterance (ex: "what a wimp", "hi Paul")- Parameters:
string- - the utterance to store in the SpeechAct
-
getAMSummary
public java.lang.String getAMSummary()
-
setAMSummary
public void setAMSummary(java.lang.String summary)
-
toEvent
public Event toEvent(short actionEventType)
Converts the SpeechAct to an Event- Overrides:
toEventin classRemoteAction- Returns:
- the converted Event
-
toXML
public java.lang.String toXML()
Converts the SpeechAct to XML (the inverse of the Parse method)- Overrides:
toXMLin classRemoteAction- Returns:
- a XML string that contains the SpeechAct information
-
toLanguageEngine
public java.lang.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 java.lang.String toPlainStringMessage()
- Overrides:
toPlainStringMessagein classRemoteAction- Returns:
- string
-
-