gov.sandia.cognition.framework.lite
Class AbstractSemanticMemoryLite

java.lang.Object
  extended by gov.sandia.cognition.framework.lite.AbstractSemanticMemoryLite
All Implemented Interfaces:
CognitiveModule, SemanticMemory, Serializable
Direct Known Subclasses:
MutableSemanticMemoryLite, SharedSemanticMemoryLite

public abstract class AbstractSemanticMemoryLite
extends Object
implements SemanticMemory, Serializable

The AbstractSemanticMemoryLite implements the common functionality among SemanticMemoryLite modules.

Since:
1.0
Author:
Justin Basilico, Kevin R. Dixon
See Also:
Serialized Form

Constructor Summary
AbstractSemanticMemoryLite(SemanticIdentifierMap semanticIdentifierMap, PatternRecognizerLite recognizer)
          Creates a new instance of AbstractSemanticMemoryLite.
 
Method Summary
protected  void buildOutputMapping()
          Builds the mapping of output identifiers to their labels.
abstract  int findInputIndexForIdentifier(SemanticIdentifier semanticIdentifier)
          Finds the input vector index for a given identifier.
 SemanticNetwork getNetwork()
          Gets the semantic network underlying the semantic memory.
protected  ArrayList<SemanticIdentifier> getOutputIdentifiers()
          Gets the ordered list of output identifiers.
 PatternRecognizerLite getRecognizer()
          Gets the pattern recognizer lite for the semantic memory lite.
 SemanticIdentifierMap getSemanticIdentifierMap()
          Gets the semantic identifier map being used.
 CognitiveModuleState initializeState(CognitiveModelState modelState)
          This method initializes the state object for the CognitiveModule by calling the initialState function on the underlying pattern recognizer.
 CognitiveModuleState update(CognitiveModelState modelState, CognitiveModuleState previousModuleState)
          Updates the state of the cognitive model by modifying the given CognitiveModelState object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.framework.CognitiveModule
getName, getSettings
 

Constructor Detail

AbstractSemanticMemoryLite

public AbstractSemanticMemoryLite(SemanticIdentifierMap semanticIdentifierMap,
                                  PatternRecognizerLite recognizer)
Creates a new instance of AbstractSemanticMemoryLite.

Parameters:
semanticIdentifierMap - The SemanticIdentifierMap to use for mapping SemanticLabels to SemanticIdentifiers.
recognizer - The PatternRecognizerLite used by this.
Method Detail

buildOutputMapping

protected void buildOutputMapping()
Builds the mapping of output identifiers to their labels.


initializeState

public CognitiveModuleState initializeState(CognitiveModelState modelState)
This method initializes the state object for the CognitiveModule by calling the initialState function on the underlying pattern recognizer.

Specified by:
initializeState in interface CognitiveModule
Parameters:
modelState - The CognitiveModelState to initalize
Returns:
The initial state of the CognitiveModule

update

public CognitiveModuleState update(CognitiveModelState modelState,
                                   CognitiveModuleState previousModuleState)
Updates the state of the cognitive model by modifying the given CognitiveModelState object.

Specified by:
update in interface CognitiveModule
Parameters:
modelState - The CognitiveModelState to update.
previousModuleState - The previous CognitiveModuleState returned by this module.
Returns:
The updated CognitiveModuleState for this module.

findInputIndexForIdentifier

public abstract int findInputIndexForIdentifier(SemanticIdentifier semanticIdentifier)
Finds the input vector index for a given identifier. If the identifier is not in the index, -1 is returned.

Parameters:
semanticIdentifier - The identifier to find the input index of.
Returns:
The input vector index for the given identifier, if it is part of the input vector. -1 otherwise.

getNetwork

public SemanticNetwork getNetwork()
Gets the semantic network underlying the semantic memory.

Specified by:
getNetwork in interface SemanticMemory
Returns:
The SemanticNetwork under the memory.

getSemanticIdentifierMap

public SemanticIdentifierMap getSemanticIdentifierMap()
Gets the semantic identifier map being used.

Returns:
The semantic identifier map being used.

getRecognizer

public PatternRecognizerLite getRecognizer()
Gets the pattern recognizer lite for the semantic memory lite.

Returns:
The pattern recognizer for the semantic memory lite.

getOutputIdentifiers

protected ArrayList<SemanticIdentifier> getOutputIdentifiers()
Gets the ordered list of output identifiers.

Returns:
The ordered list of output identifiers.