Class WorkingMemory

java.lang.Object
FAtiMA.Core.memory.semanticMemory.WorkingMemory
All Implemented Interfaces:
Serializable

public class WorkingMemory extends Object implements Serializable
Implements a knowledge structure that stores properties and predicates about the world for current processes (new data or data retrieved from the knowledge base. Provides a very fast method of searching for the information stored inside it. This structure also provides a limited kind of Logical Inference that can be applied to generate new properties and predicates. This logical inference is performed by specific inference operators that must be explicitly added to the WM. When the WM buffer is full, data will be transfer to the KnowledgeBase (LTM) based on first in first out mechanism.
Author:
Meiyii Lim
See Also:
  • Field Details

  • Constructor Details

    • WorkingMemory

      public WorkingMemory()
      Creates a new Empty WorkingMemory
  • Method Details

    • Ask

      public Object Ask(Name name)
    • Clear

      public void Clear()
      Empties the WorkingMemory
    • ClearChangeList

      public void ClearChangeList()
    • Count

      public int Count()
    • GetChangeList

      public ArrayList<KnowledgeSlot> GetChangeList()
    • GetFactList

      public ArrayList<KnowledgeSlot> GetFactList()
    • GetNewFacts

      public ArrayList<KnowledgeSlot> GetNewFacts()
    • putFact

      public void putFact(KnowledgeSlot ks)
    • HasNewKnowledge

      public boolean HasNewKnowledge()
      Gets a value that indicates whether new Knowledge has been added to the WorkingMemory since the last inference process
      Returns:
      true if there is new Knowledge in the WM, false otherwise
    • RearrangeWorkingMemory

      public void RearrangeWorkingMemory(Name predicate, Object value)
      Rearrange the working memory entries so that the most current accessed entry comes last
    • ResetNewKnowledge

      public void ResetNewKnowledge()
    • Retract

      public void Retract(Name predicate)
      Removes a predicate from the WorkingMemory
      Parameters:
      predicate - - the predicate to be removed
    • Tell

      public void Tell(KnowledgeBase kb, Name property, Object value)
      Adds a new property or sets its value (if already exists) in the WorkingMemory
      Parameters:
      property - - the property to be added/changed
      value - - the value to be stored in the property
    • GetPossibleBindings

      public ArrayList<SubstitutionSet> GetPossibleBindings(Name name)
    • GetObjectDetails

      public KnowledgeSlot GetObjectDetails(String objectName)
    • GetObjectProperty

      public KnowledgeSlot GetObjectProperty(String objectName, String property)
    • toString

      public String toString()
      Converts the Information stored in the WM to one String
      Overrides:
      toString in class Object
      Returns:
      the converted String
    • toXML

      public String toXML()