public class KnowledgeBase extends MusicalAgentComponent
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
KnowledgeBase.EventFact
The Class EventFact.
|
(package private) class |
KnowledgeBase.Fact
The Class Fact.
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.HashMap<java.lang.String,KnowledgeBase.Fact> |
facts
The facts.
|
private java.util.HashMap<java.lang.String,Memory> |
memories
The memories.
|
parameters| Constructor and Description |
|---|
KnowledgeBase() |
| Modifier and Type | Method and Description |
|---|---|
Memory |
createMemory(java.lang.String name,
Parameters parameters)
Creates the memory.
|
Memory |
getMemory(java.lang.String name)
Gets the memory.
|
java.lang.String |
readFact(java.lang.String fact)
Reads a fact from the Knowledge Base.
|
void |
registerFact(java.lang.String fact,
java.lang.String value,
boolean isPublic)
Registers a fact in the Knowledge Base.
|
boolean |
start()
Framework-implemented initialization method.
|
boolean |
stop()
Framework-implemented finalization method.
|
void |
updateFact(java.lang.String fact,
java.lang.String value)
Updates the value of a fact in the Knowledge Base only if it exists.
|
addParameter, addParameters, configure, finit, getAddress, getAgent, getComponentName, getComponentType, getParameter, getParameter, getParameters, getState, getType, init, parameterUpdate, processCommand, receiveCommand, sendCommand, setAgent, setComponentName, setParameters, setState, setTypeprivate java.util.HashMap<java.lang.String,KnowledgeBase.Fact> facts
private java.util.HashMap<java.lang.String,Memory> memories
public final boolean start()
LifeCyclepublic final boolean stop()
LifeCyclepublic void registerFact(java.lang.String fact,
java.lang.String value,
boolean isPublic)
fact - the factvalue - the valueisPublic - the is publicpublic void updateFact(java.lang.String fact,
java.lang.String value)
fact - the fact name.value - teh new value of this fact.public java.lang.String readFact(java.lang.String fact)
fact - the fact name.public Memory createMemory(java.lang.String name, Parameters parameters)
name - the nameparameters - the parameterspublic Memory getMemory(java.lang.String name)
name - the name