Class EmotionCondition

All Implemented Interfaces:
IGroundable, Serializable, Cloneable

public class EmotionCondition extends PredicateCondition
See Also:
  • Field Details

    • _emotionType

      protected String _emotionType
    • _intensity

      protected Symbol _intensity
    • _direction

      protected Symbol _direction
  • Constructor Details

    • EmotionCondition

      public EmotionCondition(boolean active, String emotion)
    • EmotionCondition

      public EmotionCondition(boolean active, Symbol ToM, String emotion)
    • EmotionCondition

      protected EmotionCondition(EmotionCondition eC)
  • Method Details

    • clone

      public 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.
    • ParseEmotionCondition

      public static EmotionCondition ParseEmotionCondition(Attributes attributes) throws InvalidEmotionTypeException
      Parses a EmotionCondition given a XML attribute list
      Parameters:
      attributes - - A list of XMl attributes
      Returns:
      - the EmotionCondition Parsed
      Throws:
      InvalidEmotionTypeException
    • 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
    • CheckCondition

      public boolean CheckCondition(AgentModel am)
      Checks if the Predicate is verified in the agent's KnowledgeBase
      Overrides:
      CheckCondition in class PredicateCondition
      Returns:
      true if the Predicate is verified, false otherwise
      See Also:
    • GetValidBindings

      public 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:
    • 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(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:
    • 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:
    • 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