| Modifier and type | Property and description |
|---|---|
| java.lang.Iterable<T> | definedNameList
Replies all the defined names stored in the working memory. |
| java.util.stream.Stream<T> | definedNames
Replies all the defined names stored in the working memory. |
| long | memorySize
Replies the number of knowledges that are stored in the working memory. |
| java.lang.Object | workingMemoryLock
Replies a resource that enables to have synchronized access to the working memory. |
| Modifier and type | Action and description |
|---|---|
| abstract void | clearMemory
Remove all knowledge from the working memory. |
| abstract java.util.stream.Stream<T> | getDefinedForName(String)
Replies all the scopes that are known in the working memory and associated to the given knowledge name. |
| abstract java.util.List<E> | getDefinedListForName(String)
Replies all the scopes that are known in the working memory and associated to the given knowledge name. |
| abstract java.lang.Iterable<T> | getDefinedNameList
Replies all the defined names stored in the working memory. |
| abstract java.util.stream.Stream<T> | getDefinedNames
Replies all the defined names stored in the working memory. |
| abstract java.lang.Object | getKnowledge(ScopedDataName)
Replies the knowledge value that is identified by the given id. |
| abstract T | getKnowledge(ScopedDataName,Class<T>)
Replies the data value that is identified by the given id. |
| abstract long | getMemorySize
Replies the number of knowledges that are stored in the working memory. |
| abstract java.lang.Object | getWorkingMemoryLock
Replies a resource that enables to have synchronized access to the working memory. |
| abstract boolean | isDefined(ScopedDataName)
Replies if the given knowledge corresponds to a knowledge that is stored in the working memory. |
| abstract boolean | isMemoryEmpty
Replies if the working memory is empty or not. |
| abstract boolean | isNullAllowedInMemory
Replies if the null value is allowed to be associated to a stored knowledge in the working memory. |
| abstract java.lang.Object | removeKnowledge(ScopedDataName)
Remove the knowledge from the working memory. |
| abstract void | removeNullValuedKnowledges
Remove from the working memory any knowledge that is associated to a null value. |
| abstract java.lang.Object | setKnowledge(ScopedDataName,Object)
Save the knowledge value in the working memory. |
| abstract void | setKnowledgeIfAbsent(ScopedDataName,Object)
Save the knowledge value in the working memory if this memory does not already contain a value for this knowledge. |
| abstract java.lang.Object | setKnowledgeIfPresent(ScopedDataName,Object)
Save the knowledge value in the working memory if this memory already contains a value for this knowledge. |
| abstract void | setNullAllowedInMemory(boolean)
Change the flag indicating if the null value is allowed to be associated to a stored knowledge in the working memory. |
val definedNameList : java.lang.Iterable<T>
This property is an alias for the action: getDefinedNameList
val definedNames : java.util.stream.Stream<T>
This property is an alias for the action: getDefinedNames
val memorySize : long
This property is an alias for the action: getMemorySize
val workingMemoryLock : java.lang.Object
synchronized block of code:
synchronized(workingMemory.workingMemoryLock) {
...
}
This property is an alias for the action: getWorkingMemoryLock
def clearMemory
def getDefinedForName(String) : java.util.stream.Stream<T>
def getDefinedListForName(String) : java.util.List<E>
def getDefinedNameList : java.lang.Iterable<T>
def getDefinedNames : java.util.stream.Stream<T>
def getKnowledge(ScopedDataName) : java.lang.Objectthrows KnowledgeMissingException
def getKnowledge(ScopedDataName,Class<T>) : Twith T
throws KnowledgeMissingException
def getMemorySize : long
def getWorkingMemoryLock : java.lang.Object
synchronized block of code:
synchronized(workingMemory.workingMemoryLock) {
...
}
def isDefined(ScopedDataName) : boolean
null, the knowledge is defined with a null value.
def isMemoryEmpty : boolean
def isNullAllowedInMemory : boolean
null value is allowed to be associated to a stored knowledge in the working memory.
If null value is not allowed in the memory, then each time a null value is put in the memory for a knowledge, this knowledge is removed from the memory. In the case the null value is allowed in the memory, then it is associated to the knowledge.
CAUTION: the support of the null value also depends on the concrete implementation of the working memory. Please refer to the documentation of the working memory's implementation for further details.
def removeKnowledge(ScopedDataName) : java.lang.Object
def removeNullValuedKnowledges
null value.
def setKnowledge(ScopedDataName,Object) : java.lang.Object
def setKnowledgeIfAbsent(ScopedDataName,Object)
def setKnowledgeIfPresent(ScopedDataName,Object) : java.lang.Object
def setNullAllowedInMemory(boolean)
null value is allowed to be associated to a stored knowledge in the working memory.
If null value is not allowed in the memory, then each time a null value is put in the memory for a knowledge, this knowledge is removed from the memory. In the case the null value is allowed in the memory, then it is associated to the knowledge.
When this function is invoked with false as argument, the content of the working memory is not changed. Therefore, the knowledges that are already stored in the agent memory and associated with a null value are kept in the memory storage. See removeNullValuedKnowledges() for removing null valued knowledges from the working memory.
CAUTION: the support of the null value also depends on the concrete implementation of the working memory. Please refer to the documentation of the working memory's implementation for further details.