Class MoodCondition

java.lang.Object
FAtiMA.Core.conditions.Condition
FAtiMA.Core.conditions.MoodCondition
All Implemented Interfaces:
IGroundable, Serializable, Cloneable

public class MoodCondition extends Condition
See Also:
  • Field Details

    • operatorGreater

      protected static final short operatorGreater
      See Also:
    • operatorGreaterEqual

      protected static final short operatorGreaterEqual
      See Also:
    • operatorLesser

      protected static final short operatorLesser
      See Also:
    • operatorLesserEqual

      protected static final short operatorLesserEqual
      See Also:
    • operatorEqual

      protected static final short operatorEqual
      See Also:
    • operatorNotEqual

      protected static final short operatorNotEqual
      See Also:
    • invalidOperator

      protected static final short invalidOperator
      See Also:
    • _value

      protected float _value
    • _operator

      protected short _operator
  • Constructor Details

    • MoodCondition

      public MoodCondition(short operator, float value)
    • MoodCondition

      protected MoodCondition(MoodCondition mC)
  • 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.
      Specified by:
      clone in class Condition
      Returns:
      The EmotionCondition's copy.
    • ParseMoodCondition

      public static MoodCondition ParseMoodCondition(Attributes attributes) throws InvalidMoodOperatorException, NoMoodOperatorDefinedException
      Parses a EmotionCondition given a XML attribute list
      Parameters:
      attributes - - A list of XMl attributes
      Returns:
      - the EmotionCondition Parsed
      Throws:
      InvalidMoodOperatorException
      NoMoodOperatorDefinedException
    • GetValue

      public Name GetValue()
      Gets the condition's value - the object compared against the condition's name
      Specified by:
      GetValue in class Condition
      Returns:
      the condition's value
    • CheckCondition

      public boolean CheckCondition(AgentModel am)
      Checks if the Predicate is verified in the agent's KnowledgeBase
      Specified by:
      CheckCondition in class Condition
      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:
    • GetValueBindings

      public ArrayList<Substitution> GetValueBindings(AgentModel am)
      Description copied from class: Condition
      Find a set of Substitutions for the second part of the condition, which will make it become true. With this method it is possible to test conditions that have unbound variables in the second part such as: "Owner(Ball) = [x]" this condition will be true if there is anyone in the world that owns a Ball. If John owns the ball, the method returns [x]/John
      Specified by:
      GetValueBindings in class Condition
      Returns:
      returns all set of Substitutions that make the condition valid.
    • isGrounded

      public boolean isGrounded()
      Description copied from class: Condition
      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:
      isGrounded in interface IGroundable
      Overrides:
      isGrounded in class Condition
      Returns:
      true if the Predicate is grounded, false otherwise