Class WorkingMemory
- java.lang.Object
-
- FAtiMA.Core.memory.semanticMemory.WorkingMemory
-
- All Implemented Interfaces:
java.io.Serializable
public class WorkingMemory extends java.lang.Object implements java.io.SerializableImplements 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static shortMAXENTRY
-
Constructor Summary
Constructors Constructor Description WorkingMemory()Creates a new Empty WorkingMemory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectAsk(Name name)voidClear()Empties the WorkingMemoryvoidClearChangeList()intCount()java.util.ArrayList<KnowledgeSlot>GetChangeList()java.util.ArrayList<KnowledgeSlot>GetFactList()java.util.ArrayList<KnowledgeSlot>GetNewFacts()KnowledgeSlotGetObjectDetails(java.lang.String objectName)KnowledgeSlotGetObjectProperty(java.lang.String objectName, java.lang.String property)java.util.ArrayList<SubstitutionSet>GetPossibleBindings(Name name)booleanHasNewKnowledge()Gets a value that indicates whether new Knowledge has been added to the WorkingMemory since the last inference processvoidputFact(KnowledgeSlot ks)voidRearrangeWorkingMemory(Name predicate, java.lang.Object value)Rearrange the working memory entries so that the most current accessed entry comes lastvoidResetNewKnowledge()voidRetract(Name predicate)Removes a predicate from the WorkingMemoryvoidTell(KnowledgeBase kb, Name property, java.lang.Object value)Adds a new property or sets its value (if already exists) in the WorkingMemoryjava.lang.StringtoString()Converts the Information stored in the WM to one Stringjava.lang.StringtoXML()
-
-
-
Field Detail
-
MAXENTRY
public static final short MAXENTRY
- See Also:
- Constant Field Values
-
-
Method Detail
-
Ask
public java.lang.Object Ask(Name name)
-
Clear
public void Clear()
Empties the WorkingMemory
-
ClearChangeList
public void ClearChangeList()
-
Count
public int Count()
-
GetChangeList
public java.util.ArrayList<KnowledgeSlot> GetChangeList()
-
GetFactList
public java.util.ArrayList<KnowledgeSlot> GetFactList()
-
GetNewFacts
public java.util.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, java.lang.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, java.lang.Object value)
Adds a new property or sets its value (if already exists) in the WorkingMemory- Parameters:
property- - the property to be added/changedvalue- - the value to be stored in the property
-
GetPossibleBindings
public java.util.ArrayList<SubstitutionSet> GetPossibleBindings(Name name)
-
GetObjectDetails
public KnowledgeSlot GetObjectDetails(java.lang.String objectName)
-
GetObjectProperty
public KnowledgeSlot GetObjectProperty(java.lang.String objectName, java.lang.String property)
-
toString
public java.lang.String toString()
Converts the Information stored in the WM to one String- Overrides:
toStringin classjava.lang.Object- Returns:
- the converted String
-
toXML
public java.lang.String toXML()
-
-