Class PastEventCondition

All Implemented Interfaces:
IGroundable, Serializable, Cloneable
Direct Known Subclasses:
RecentEventCondition

public class PastEventCondition extends PredicateCondition
Author:
User
See Also:
  • Field Details

    • _subject

      protected Symbol _subject
    • _action

      protected Symbol _action
    • _target

      protected Symbol _target
    • _parameters

      protected ArrayList<Symbol> _parameters
    • _type

      protected short _type
    • _status

      protected short _status
  • Constructor Details

    • PastEventCondition

      protected PastEventCondition()
    • PastEventCondition

      public PastEventCondition(boolean occurred, short type, short status, Symbol subject, Symbol action, Symbol target, ArrayList<Symbol> parameters)
    • PastEventCondition

      public PastEventCondition(boolean occurred, Event e)
    • PastEventCondition

      public PastEventCondition(boolean occurred, short type, short status, Name event)
    • PastEventCondition

      public PastEventCondition(PastEventCondition pEC)
  • Method Details

    • ParseEvent

      public static PastEventCondition ParseEvent(Attributes attributes)
      Parses a RecentEventCondition given a XML attribute list
      Parameters:
      attributes - - A list of XMl attributes
      Returns:
      - the EventCondition Parsed
    • clone

      public Object clone()
      Description copied from class: PredicateCondition
      Clones this Predicate, returning an equal copy. If this clone is changed afterwards, the original object remains the same.
      Overrides:
      clone in class PredicateCondition
      Returns:
      The Predicates's copy.
    • 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
    • ReplaceUnboundVariables

      public void ReplaceUnboundVariables(int variableID)
      Description copied from class: Condition
      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)
      Description copied from class: Condition
      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)
      Description copied from class: Condition
      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:
    • GetPossibleBindings

      protected ArrayList<ActionDetail> GetPossibleBindings(AgentModel am)
    • 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 AutobiographicalMemory
      Overrides:
      GetValidBindings in class Condition
      Returns:
      A list with all SubstitutionsSets that make the condition valid
      See Also:
    • CheckCondition

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

      protected ArrayList<SearchKey> GetSearchKeys()