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 Memory
public java.lang.String getProperty(java.lang.String property)
getProperty
in interface Memory
public java.lang.String setProperty(java.lang.String property, java.lang.String value)
setProperty
in interface Memory
public java.lang.String removeProperty(java.lang.String property)
removeProperty
in interface Memory
public 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 Memory
public void loadProperties(java.lang.String propertySet)
loadProperties
in interface Memory
public void clearProperties(java.lang.String propertySet)
clearProperties
in interface Memory
public java.util.List<Vertex> getActiveMemory()
getActiveMemory
in interface Memory
public Vertex addActiveMemory(Vertex vertex)
addActiveMemory
in interface Memory
public Network getShortTermMemory()
getShortTermMemory
in interface Memory
public Network newMemory()
public Network getLongTermMemory()
getLongTermMemory
in interface Memory
public 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 Memory
public void restore(java.lang.String database, boolean isSchema)
public void createMemory(java.lang.String database)
createMemory
in interface Memory
public void createMemory(java.lang.String database, boolean isSchema)
createMemory
in interface Memory
public void createMemoryFromTemplate(java.lang.String database, java.lang.String template)
createMemoryFromTemplate
in interface Memory
public void createMemoryFromTemplate(java.lang.String database, boolean templateIsSchema, java.lang.String template, boolean isSchema)
createMemoryFromTemplate
in interface Memory
public void destroyMemory(java.lang.String database)
destroyMemory
in interface Memory
public void destroyMemory(java.lang.String database, boolean isSchema)
destroyMemory
in interface Memory
public void deleteMemory()
deleteMemory
in interface Memory
public void importMemory(java.lang.String location)
importMemory
in interface Memory
public void switchMemory(java.lang.String location)
switchMemory
in interface Memory
public void switchMemory(java.lang.String location, boolean isSchema)
switchMemory
in interface Memory
public void abort()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<MemoryEventListener> getListeners()
public void addListener(MemoryEventListener listener)
addListener
in interface Memory
public void removeListener(MemoryEventListener listener)
removeListener
in interface Memory
public void freeMemory()
freeMemory
in interface Memory
public 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)