Class KnowledgeBase
java.lang.Object
FAtiMA.Core.memory.semanticMemory.KnowledgeBase
- All Implemented Interfaces:
Serializable
Implements a KnowledgeBase that stores properties and predicates about the
world. Provides a very fast method of searching for the information stored
inside it. At the moment this KnowledgeBase also provides a limited kind of
forward inference that can be applyed to generate new properties and predicates.
This logical inference is performed by specific inference operators that must be
explicitly added to the KB. This KB works as an efficient information repository.
You cannot create a KB, since there is one and only one KB for the agent.
If you want to access it use KnowledgeBase.GetInstance() method.
- Author:
- Joao Dias
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an InferenceOperator to the KnowledgeBasevoidClear()Empties the KnowledgeBaseintCount()Gets the number of elements (predicates or properties) stored in the KnowledgeBaseGets the inference operatorsGetObjectDetails(String objectName) GetObjectProperty(String objectName, String property) GetPossibleBindings(Name name) voidputFact(KnowledgeSlot ks) voidRemoves a predicate from the KnowledgeBasevoidAdds a new property or sets its value (if already exists) in the KnowledgeBasetoString()Converts the Information stored in the KB to one StringtoXML()
-
Constructor Details
-
KnowledgeBase
public KnowledgeBase()Creates a new Empty KnowledgeBase
-
-
Method Details
-
AddInferenceOperator
Adds an InferenceOperator to the KnowledgeBase- Parameters:
op- - the inference operator to Add
-
Ask
-
Clear
public void Clear()Empties the KnowledgeBase -
Count
public int Count()Gets the number of elements (predicates or properties) stored in the KnowledgeBase- Returns:
- the number of elements stored in the KB
-
GetFactList
-
putFact
-
GetInferenceOperators
Gets the inference operators- Returns:
- the inference operators
-
Retract
Removes a predicate from the KnowledgeBase- Parameters:
predicate- - the predicate to be removed
-
Tell
Adds a new property or sets its value (if already exists) in the KnowledgeBase- Parameters:
property- - the property to be added/changedvalue- - the value to be stored in the property
-
GetPossibleBindings
-
GetObjectDetails
-
GetObjectProperty
-
getMainSlot
-
toString
Converts the Information stored in the KB to one String -
toXML
-