org.pandora.api.knowledge
Interface Memory

All Known Implementing Classes:
BasicMemory, DatabaseMemory, SerializedMemory, XMLMemory

public interface Memory

Defines a set of networks that make up a knowledge base. Defines long term, short term and active networks. Handle persistence of networks and merging of network spaces from short term to long term.


Method Summary
 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 createMemory(java.lang.String database)
          Create a memory database.
 void deleteMemory()
          Delete all content from the database.
 void destroyMemory(java.lang.String database)
          Destroy the database.
 java.util.Queue<Vertex> getActiveMemory()
          Active memory represents the last sensory state.
 Network getLongTermMemory()
          Represents the persisted memory (or cache there of).
 java.lang.String getMemoryName()
          Return the current connected database name.
 Pandora getPandora()
           
 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.
 Network newMemory()
          Return an isolated transactional memory.
 void restore()
          Restores the memory from a persisted state.
 void restore(java.lang.String database)
          Restores the memory from a persisted state.
 void save()
          Merge the short term memory into the long term and clears the short term.
 void setPandora(Pandora pandora)
           
 void shutdown()
          Shutdown the memory.
 void switchMemory(java.lang.String location)
          Allow switching to another memory location.
 

Method Detail

getActiveMemory

java.util.Queue<Vertex> getActiveMemory()
Active memory represents the last sensory state.


addActiveMemory

Vertex addActiveMemory(Vertex vertex)
Add the sensory data to the active memory. Register the vertex in the short-term memory and return the registered version.


getShortTermMemory

Network getShortTermMemory()
Represents a non-committed transactional memory. Helps to define a learn scope and local context.


newMemory

Network newMemory()
Return an isolated transactional memory. Can be used by senses or sub-conscious thought for concurrent processing.


getLongTermMemory

Network getLongTermMemory()
Represents the persisted memory (or cache there of).


save

void save()
          throws MemoryStorageException
Merge the short term memory into the long term and clears the short term. This is similar to a transactional commit. The changes should also be persisted, as the long term should always just be a cache of the storage.

Throws:
MemoryStorageException

restore

void restore()
             throws MemoryStorageException
Restores the memory from a persisted state.

Throws:
MemoryStorageException

restore

void restore(java.lang.String database)
             throws MemoryStorageException
Restores the memory from a persisted state.

Throws:
MemoryStorageException

getMemoryName

java.lang.String getMemoryName()
Return the current connected database name.


createMemory

void createMemory(java.lang.String database)
Create a memory database.


destroyMemory

void destroyMemory(java.lang.String database)
Destroy the database.


deleteMemory

void deleteMemory()
Delete all content from the database.


importMemory

void importMemory(java.lang.String location)
Allow import of another memory location.


shutdown

void shutdown()
Shutdown the memory.


switchMemory

void switchMemory(java.lang.String location)
Allow switching to another memory location.


abort

void abort()
Reset the short term and active memories. Revert to the long term state.


getPandora

Pandora getPandora()

setPandora

void setPandora(Pandora pandora)

initialize

void initialize(java.util.Map<java.lang.String,java.lang.Object> properties)
Initialize any configurable settings from the properties.


addListener

void addListener(MemoryEventListener listener)
Add the memory listener. It will be notified of any new active memory.