Class EmotionCondition

    • Field Detail

      • _emotionType

        protected java.lang.String _emotionType
      • _intensity

        protected Symbol _intensity
      • _direction

        protected Symbol _direction
    • Constructor Detail

      • EmotionCondition

        public EmotionCondition​(boolean active,
                                java.lang.String emotion)
      • EmotionCondition

        public EmotionCondition​(boolean active,
                                Symbol ToM,
                                java.lang.String emotion)
    • Method Detail

      • clone

        public java.lang.Object clone()
        Clones this EmotionCondition, returning an equal copy. If this clone is changed afterwards, the original object remains the same.
        Overrides:
        clone in class PredicateCondition
        Returns:
        The EmotionCondition's copy.
      • SetIntensity

        public void SetIntensity​(Symbol intensity)
      • SetIntensity

        public void SetIntensity​(float intensity)
      • SetDirection

        public void SetDirection​(Symbol direction)
      • GetValue

        public Name GetValue()
        Gets the condition's value - the object compared against the condition's name
        Overrides:
        GetValue in class PredicateCondition
        Returns:
        the condition's value
      • GetValidBindings

        public java.util.ArrayList<SubstitutionSet> GetValidBindings​(AgentModel am)
        This method finds all the possible sets of Substitutions that applied to the condition will make it valid (true) according to the agent's EmotionalState
        Overrides:
        GetValidBindings in class Condition
        Returns:
        A list with all SubstitutionsSets that make the condition valid
        See Also:
        EmotionalState
      • 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:
        ReplaceUnboundVariables in interface IGroundable
        Overrides:
        ReplaceUnboundVariables in class Condition
        Parameters:
        variableID - - the identifier to be applied
      • MakeGround

        public void MakeGround​(java.util.ArrayList<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:
        MakeGround in interface IGroundable
        Overrides:
        MakeGround in class Condition
        Parameters:
        bindings - - A list of substitutions of the type "[Variable]/value"
        See Also:
        Substitution
      • MakeGround

        public void MakeGround​(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:
        MakeGround in interface IGroundable
        Overrides:
        MakeGround in class Condition
        Parameters:
        subst - - a substitution of the type "[Variable]/value"
        See Also:
        Substitution
      • isGrounded

        public boolean isGrounded()
        Indicates if the condition is grounded (no unbound variables in it's WFN) Example: Stronger(Luke,John) is grounded while Stronger(John,[X]) is not.
        Specified by:
        isGrounded in interface IGroundable
        Overrides:
        isGrounded in class Condition
        Returns:
        true if the condition is grounded, false otherwise