public class BasicMemory extends java.lang.Object implements Memory
| Constructor and Description |
|---|
BasicMemory() |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Reset the short term and active memories.
|
Vertex |
addActiveMemory(Vertex vertex)
Add the sensory data to the active memory.
|
void |
addListener(MemoryEventListener listener)
Add the memory listener.
|
void |
awake()
Load any properties and init.
|
int |
cacheSize() |
void |
clearProperties(java.lang.String propertySet) |
void |
createMemory(java.lang.String database)
Create a memory database.
|
void |
createMemory(java.lang.String database,
boolean isSchema)
Create a memory database.
|
void |
createMemoryFromTemplate(java.lang.String database,
boolean templateIsSchema,
java.lang.String template,
boolean isSchema)
Create a memory database.
|
void |
createMemoryFromTemplate(java.lang.String database,
java.lang.String template)
Create a memory database.
|
void |
deleteMemory()
Delete all content from the database.
|
void |
destroyMemory(java.lang.String database)
Destroy the database.
|
void |
destroyMemory(java.lang.String database,
boolean isSchema)
Destroy the database.
|
void |
fastRestore(java.lang.String database,
boolean isSchema)
This implementation does not support persistence.
|
Vertex |
find(Vertex source,
Vertex id)
Self API
Lookup an object by id.
|
Vertex |
findInstances(Vertex source,
Vertex type)
Self API
Search all instances of the class type.
|
Vertex |
findInstances(Vertex source,
Vertex type,
Vertex date)
Self API
Search all instances of the class type, created after the date.
|
Vertex |
findReferences(Vertex source,
Vertex target)
Self API
Search what references the object.
|
Vertex |
findReferencesBy(Vertex source,
Vertex target,
Vertex type)
Self API
Search what references the object by the relationship.
|
void |
freeMemory() |
java.util.List<Vertex> |
getActiveMemory()
Active memory represents the last sensory state.
|
Bot |
getBot()
Return Bot.
|
java.util.List<MemoryEventListener> |
getListeners() |
Network |
getLongTermMemory()
Represents the persisted memory (or cache there of).
|
java.lang.String |
getMemoryName()
Return the current connected database name.
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties() |
java.lang.String |
getProperty(java.lang.String property)
Return the property setting.
|
Network |
getShortTermMemory()
Represents a non-committed transactional memory.
|
void |
importMemory(java.lang.String location)
Allow import of another memory location.
|
void |
initialize(java.util.Map<java.lang.String,java.lang.Object> properties)
Initialize any configurable settings from the properties.
|
void |
initMemory() |
void |
loadProperties(java.lang.String propertySet) |
Network |
newMemory()
Return an isolated transactional memory.
|
void |
pool()
Reset state when instance is pooled.
|
void |
removeListener(MemoryEventListener listener) |
java.lang.String |
removeProperty(java.lang.String property)
Remove the property setting.
|
void |
restore()
This implementation does not support persistence.
|
void |
restore(java.lang.String database,
boolean isSchema)
This implementation does not support persistence.
|
void |
save()
Merge the short term memory into the long term and clears the short term.
|
void |
setActiveMemory(java.util.List<Vertex> activeMemory) |
void |
setBot(Bot bot)
Set Bot.
|
void |
setLongTermMemory(Network longTermMemory) |
void |
setProperties(java.util.Map<java.lang.String,java.lang.String> properties) |
java.lang.String |
setProperty(java.lang.String property,
java.lang.String value)
Save the property setting.
|
void |
setShortTermMemory(Network shortTermMemory) |
void |
shutdown()
Shutdown the memory.
|
void |
switchMemory(java.lang.String location)
Allow switching to another memory location.
|
void |
switchMemory(java.lang.String location,
boolean isSchema)
Allow switching to another memory location.
|
java.lang.String |
toString() |
public void initMemory()
public java.lang.String getMemoryName()
getMemoryName in interface Memorypublic java.lang.String getProperty(java.lang.String property)
getProperty in interface Memorypublic java.lang.String setProperty(java.lang.String property,
java.lang.String value)
setProperty in interface Memorypublic java.lang.String removeProperty(java.lang.String property)
removeProperty in interface Memorypublic java.util.Map<java.lang.String,java.lang.String> getProperties()
public void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
public void initialize(java.util.Map<java.lang.String,java.lang.Object> properties)
initialize in interface Memorypublic void loadProperties(java.lang.String propertySet)
loadProperties in interface Memorypublic void clearProperties(java.lang.String propertySet)
clearProperties in interface Memorypublic java.util.List<Vertex> getActiveMemory()
getActiveMemory in interface Memorypublic Vertex addActiveMemory(Vertex vertex)
addActiveMemory in interface Memorypublic Network getShortTermMemory()
getShortTermMemory in interface Memorypublic Network newMemory()
public Network getLongTermMemory()
getLongTermMemory in interface Memorypublic void setActiveMemory(java.util.List<Vertex> activeMemory)
public void setShortTermMemory(Network shortTermMemory)
public void setLongTermMemory(Network longTermMemory)
public void save()
public void restore()
public void fastRestore(java.lang.String database,
boolean isSchema)
fastRestore in interface Memorypublic void restore(java.lang.String database,
boolean isSchema)
public void createMemory(java.lang.String database)
createMemory in interface Memorypublic void createMemory(java.lang.String database,
boolean isSchema)
createMemory in interface Memorypublic void createMemoryFromTemplate(java.lang.String database,
java.lang.String template)
createMemoryFromTemplate in interface Memorypublic void createMemoryFromTemplate(java.lang.String database,
boolean templateIsSchema,
java.lang.String template,
boolean isSchema)
createMemoryFromTemplate in interface Memorypublic void destroyMemory(java.lang.String database)
destroyMemory in interface Memorypublic void destroyMemory(java.lang.String database,
boolean isSchema)
destroyMemory in interface Memorypublic void deleteMemory()
deleteMemory in interface Memorypublic void importMemory(java.lang.String location)
importMemory in interface Memorypublic void switchMemory(java.lang.String location)
switchMemory in interface Memorypublic void switchMemory(java.lang.String location,
boolean isSchema)
switchMemory in interface Memorypublic void abort()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List<MemoryEventListener> getListeners()
public void addListener(MemoryEventListener listener)
addListener in interface Memorypublic void removeListener(MemoryEventListener listener)
removeListener in interface Memorypublic void freeMemory()
freeMemory in interface Memorypublic Vertex findReferencesBy(Vertex source, Vertex target, Vertex type)
public Vertex findReferences(Vertex source, Vertex target)
public Vertex findInstances(Vertex source, Vertex type)
public Vertex findInstances(Vertex source, Vertex type, Vertex date)