Package FAtiMA.ReactiveComponent
Class Reaction
- java.lang.Object
-
- FAtiMA.ReactiveComponent.Reaction
-
- All Implemented Interfaces:
FAtiMA.Core.IIntegrityTester,FAtiMA.Core.wellFormedNames.IGroundable,IReactionNode,java.io.Serializable,java.lang.Cloneable
public class Reaction extends java.lang.Object implements java.io.Serializable, FAtiMA.Core.wellFormedNames.IGroundable, IReactionNode
Represents an Emotional Reaction based in Construal Frames that specify values for some of OCC's appraisal variables: Desirability, DesirabilityForOther, Like and Praiseworthiness.- Author:
- Joao Dias
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Float_desirabilityprotected java.lang.Float_desirabilityForOtherprotected FAtiMA.Core.sensorEffector.Event_eventprotected java.lang.Float_likeprotected FAtiMA.Core.wellFormedNames.Symbol_otherprotected java.lang.Float_praiseworthiness
-
Constructor Summary
Constructors Constructor Description Reaction()Creates a new empty Emotional ReactionReaction(FAtiMA.Core.sensorEffector.Event event)Creates a new empty Emotional ReactionReaction(java.lang.Float desirability, java.lang.Float desirabilityForOther, java.lang.Float praiseworthiness, FAtiMA.Core.wellFormedNames.Symbol other)Creates a new Emotional Reaction
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidCheckIntegrity(FAtiMA.Core.IntegrityValidator val)Checks the integrity of the Reaction by testing if the reaction references an event with an speechAct not defined.java.lang.Objectclone()java.lang.FloatgetDesirability()Gets the appraisal variable: Desirability of the eventjava.lang.FloatgetDesirabilityForOther()Gets the appraisal variable: DesirabilityForOther of the eventFAtiMA.Core.sensorEffector.EventgetEvent()Gets the event referenced by the emotional reactionjava.lang.FloatgetLike()FAtiMA.Core.wellFormedNames.SymbolgetOther()Gets the name of the character that the appraisal variable desirabilityForOther refersjava.lang.FloatgetPraiseworthiness()Gets the appraisal variable: Praiseworthiness of the eventReactiongetReaction(FAtiMA.Core.sensorEffector.Event e)booleanisGrounded()Indicates if the Predicate is grounded (no unbound variables in it's WFN) Example: Stronger(Luke,John) is grounded while Stronger(John,[X]) is not.voidMakeGround(FAtiMA.Core.wellFormedNames.Substitution subst)Applies a set of substitutions to the object, grounding it.voidMakeGround(java.util.ArrayList<FAtiMA.Core.wellFormedNames.Substitution> bindings)Applies a set of substitutions to the object, grounding it.booleanMatchEvent(FAtiMA.Core.sensorEffector.Event eventPerception)tests if a given event matches the emotional ReactionvoidReplaceUnboundVariables(int variableID)Replaces all unbound variables in the object by applying a numeric identifier to each one.voidsetDesirability(java.lang.Float f)Sets the appraisal variable: DesirabilityvoidsetDesirabilityForOther(java.lang.Float f)Sets the appraisal variable: DesirabilityForOthervoidsetEvent(FAtiMA.Core.sensorEffector.Event event)Sets the event that the emotional reaction referencesvoidsetLike(java.lang.Float f)voidsetPraiseworthiness(java.lang.Float f)Sets the appraisal variable: Praiseworhtinessjava.lang.StringtoString()Converts the emotional Reaction to a String
-
-
-
Field Detail
-
_desirability
protected java.lang.Float _desirability
-
_desirabilityForOther
protected java.lang.Float _desirabilityForOther
-
_praiseworthiness
protected java.lang.Float _praiseworthiness
-
_like
protected java.lang.Float _like
-
_other
protected FAtiMA.Core.wellFormedNames.Symbol _other
-
_event
protected FAtiMA.Core.sensorEffector.Event _event
-
-
Constructor Detail
-
Reaction
public Reaction()
Creates a new empty Emotional Reaction
-
Reaction
public Reaction(FAtiMA.Core.sensorEffector.Event event)
Creates a new empty Emotional Reaction- Parameters:
event- - the event that this reaction references
-
Reaction
public Reaction(java.lang.Float desirability, java.lang.Float desirabilityForOther, java.lang.Float praiseworthiness, FAtiMA.Core.wellFormedNames.Symbol other)Creates a new Emotional Reaction- Parameters:
desirability- - the desirability of the eventdesirabilityForOther- - the desirability of the event for other agentspraiseworthiness- - the paiseworthiness of the eventother- - which character does the desirabilityForOther variable reference
-
-
Method Detail
-
CheckIntegrity
public void CheckIntegrity(FAtiMA.Core.IntegrityValidator val) throws FAtiMA.Core.exceptions.UnknownSpeechActExceptionChecks the integrity of the Reaction by testing if the reaction references an event with an speechAct not defined. In this case it throws the exception.- Specified by:
CheckIntegrityin interfaceFAtiMA.Core.IIntegrityTester- Throws:
FAtiMA.Core.exceptions.UnknownSpeechActException
-
getDesirability
public java.lang.Float getDesirability()
Gets the appraisal variable: Desirability of the event- Returns:
- - the event's desirability
-
getDesirabilityForOther
public java.lang.Float getDesirabilityForOther()
Gets the appraisal variable: DesirabilityForOther of the event- Returns:
- - the event's desirability for other agent
-
getLike
public java.lang.Float getLike()
-
getEvent
public FAtiMA.Core.sensorEffector.Event getEvent()
Gets the event referenced by the emotional reaction- Returns:
- the reaction's event
-
getPraiseworthiness
public java.lang.Float getPraiseworthiness()
Gets the appraisal variable: Praiseworthiness of the event- Returns:
- - the event's praiseworthiness for the agent
-
getOther
public FAtiMA.Core.wellFormedNames.Symbol getOther()
Gets the name of the character that the appraisal variable desirabilityForOther refers- Returns:
- - the name of the desirabilityForOther's character
-
MatchEvent
public boolean MatchEvent(FAtiMA.Core.sensorEffector.Event eventPerception)
tests if a given event matches the emotional Reaction- Parameters:
eventPerception- - the event to test with the Reaction- Returns:
- true if the event corresponds to the emotional Reaction, false otherwise
-
setDesirability
public void setDesirability(java.lang.Float f)
Sets the appraisal variable: Desirability- Parameters:
f- - the new value of Desirability for the reaction
-
setDesirabilityForOther
public void setDesirabilityForOther(java.lang.Float f)
Sets the appraisal variable: DesirabilityForOther- Parameters:
f- - the new value of DesirabilityForOther for the reaction
-
setLike
public void setLike(java.lang.Float f)
-
setEvent
public void setEvent(FAtiMA.Core.sensorEffector.Event event)
Sets the event that the emotional reaction references- Parameters:
event- - the new event referenced by the reaction
-
setPraiseworthiness
public void setPraiseworthiness(java.lang.Float f)
Sets the appraisal variable: Praiseworhtiness- Parameters:
f- - the new value of Praiseworthiness for the reaction
-
ReplaceUnboundVariables
public void ReplaceUnboundVariables(int variableID)
Replaces all unbound variables in the object by applying a numeric identifier to each one. For example, the variable [x] becomes [x4] if the received ID is 4. Attention, this method modifies the original object.- Specified by:
ReplaceUnboundVariablesin interfaceFAtiMA.Core.wellFormedNames.IGroundable- Parameters:
variableID- - the identifier to be applied
-
MakeGround
public void MakeGround(java.util.ArrayList<FAtiMA.Core.wellFormedNames.Substitution> bindings)
Applies a set of substitutions to the object, grounding it. Example: Applying the substitution "[X]/John" in the name "Weak([X])" returns "Weak(John)". Attention, this method modifies the original object.- Specified by:
MakeGroundin interfaceFAtiMA.Core.wellFormedNames.IGroundable- Parameters:
bindings- - A list of substitutions of the type "[Variable]/value"- See Also:
Substitution
-
MakeGround
public void MakeGround(FAtiMA.Core.wellFormedNames.Substitution subst)
Applies a set of substitutions to the object, grounding it. Example: Applying the substitution "[X]/John" in the name "Weak([X])" returns "Weak(John)". Attention, this method modifies the original object.- Specified by:
MakeGroundin interfaceFAtiMA.Core.wellFormedNames.IGroundable- Parameters:
subst- - a substitution of the type "[Variable]/value"- See Also:
Substitution
-
isGrounded
public boolean isGrounded()
Indicates if the Predicate is grounded (no unbound variables in it's WFN) Example: Stronger(Luke,John) is grounded while Stronger(John,[X]) is not.- Specified by:
isGroundedin interfaceFAtiMA.Core.wellFormedNames.IGroundable- Returns:
- true if the Predicate is grounded, false otherwise
-
clone
public java.lang.Object clone()
- Specified by:
clonein interfaceIReactionNode- Overrides:
clonein classjava.lang.Object
-
toString
public java.lang.String toString()
Converts the emotional Reaction to a String- Overrides:
toStringin classjava.lang.Object- Returns:
- the converted String
-
getReaction
public Reaction getReaction(FAtiMA.Core.sensorEffector.Event e)
- Specified by:
getReactionin interfaceIReactionNode
-
-