Package FAtiMA.ReactiveComponent
Class Reaction
java.lang.Object
FAtiMA.ReactiveComponent.Reaction
- All Implemented Interfaces:
FAtiMA.Core.IIntegrityTester,FAtiMA.Core.wellFormedNames.IGroundable,IReactionNode,Serializable,Cloneable
public class Reaction
extends Object
implements 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:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReaction()Creates a new empty Emotional ReactionReaction(FAtiMA.Core.sensorEffector.Event event) Creates a new empty Emotional ReactionReaction(Float desirability, Float desirabilityForOther, Float praiseworthiness, FAtiMA.Core.wellFormedNames.Symbol other) Creates a new Emotional Reaction -
Method Summary
Modifier and TypeMethodDescriptionvoidCheckIntegrity(FAtiMA.Core.IntegrityValidator val) Checks the integrity of the Reaction by testing if the reaction references an event with an speechAct not defined.clone()Gets the appraisal variable: Desirability of the eventGets the appraisal variable: DesirabilityForOther of the eventFAtiMA.Core.sensorEffector.EventgetEvent()Gets the event referenced by the emotional reactiongetLike()FAtiMA.Core.wellFormedNames.SymbolgetOther()Gets the name of the character that the appraisal variable desirabilityForOther refersGets the appraisal variable: Praiseworthiness of the eventgetReaction(FAtiMA.Core.sensorEffector.Event e) booleanIndicates 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(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.voidSets the appraisal variable: DesirabilityvoidSets the appraisal variable: DesirabilityForOthervoidsetEvent(FAtiMA.Core.sensorEffector.Event event) Sets the event that the emotional reaction referencesvoidvoidSets the appraisal variable: PraiseworhtinesstoString()Converts the emotional Reaction to a String
-
Field Details
-
_desirability
-
_desirabilityForOther
-
_praiseworthiness
-
_like
-
_other
protected FAtiMA.Core.wellFormedNames.Symbol _other -
_event
protected FAtiMA.Core.sensorEffector.Event _event
-
-
Constructor Details
-
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(Float desirability, Float desirabilityForOther, 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 Details
-
CheckIntegrity
public void CheckIntegrity(FAtiMA.Core.IntegrityValidator val) throws FAtiMA.Core.exceptions.UnknownSpeechActException Checks 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
Gets the appraisal variable: Desirability of the event- Returns:
- - the event's desirability
-
getDesirabilityForOther
Gets the appraisal variable: DesirabilityForOther of the event- Returns:
- - the event's desirability for other agent
-
getLike
-
getEvent
public FAtiMA.Core.sensorEffector.Event getEvent()Gets the event referenced by the emotional reaction- Returns:
- the reaction's event
-
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
Sets the appraisal variable: Desirability- Parameters:
f- - the new value of Desirability for the reaction
-
setDesirabilityForOther
Sets the appraisal variable: DesirabilityForOther- Parameters:
f- - the new value of DesirabilityForOther for the reaction
-
setLike
-
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
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
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
- Specified by:
clonein interfaceIReactionNode- Overrides:
clonein classObject
-
toString
Converts the emotional Reaction to a String -
getReaction
- Specified by:
getReactionin interfaceIReactionNode
-