gov.sandia.cognition.framework.lite
Class ArrayBasedPerceptionModule

java.lang.Object
  extended by gov.sandia.cognition.framework.concurrent.AbstractConcurrentCognitiveModule
      extended by gov.sandia.cognition.framework.lite.ArrayBasedPerceptionModule
All Implemented Interfaces:
CognitiveModule, ConcurrentCognitiveModule, Serializable

public class ArrayBasedPerceptionModule
extends AbstractConcurrentCognitiveModule
implements Serializable

The ArrayBasedPerceptionModule class implements a simple CognitiveModule that sets the state of Cogxels based on a given input of SemanticIdentifiers and their associated activation values. It makes use of a given CogxelFactory to create the initial Cogxels from the SemanticIdentifiers.

Since:
1.0
Author:
Justin Basilico, Zachary Benz
See Also:
Serialized Form

Field Summary
static String MODULE_NAME
          The name of the module.
 
Constructor Summary
ArrayBasedPerceptionModule(SemanticIdentifierMap semanticIdentifierMap, CogxelFactory cogxelFactory)
          Creates a new instance of ArrayBasedPerceptionModule.
 
Method Summary
 void evaluate()
          Perform evaluation of sampled and held input state information that was captured by a call to readState, and hold the resultant output changes to model and module state pending a call to writeState NOTE: input and output state is held temporarily for the sole purpose of supporting concurrency of module evaluation; state is NEVER retained locally across module update cycles
protected  CogxelFactory getCogxelFactory()
          Getter for cogxelFactory
 String getName()
          Gets the human-readable name of module.
protected  SemanticIdentifierMap getSemanticIdentifierMap()
          Getter for semanticIdentifierMap
 CognitiveModuleSettings getSettings()
          Returns null because this module has no settings.
 CognitiveModuleState initializeState(CognitiveModelState modelState)
          This method initializes the state object for a CognitiveModel by adding any necessary information to the model state and returining the default state for the module.
 void readState(CognitiveModelState modelState, CognitiveModuleState previousModuleState)
          Read in and temporarily hold input state information required for performing module evaluation.
protected  void setCogxelFactory(CogxelFactory cogxelFactory)
          Sets the cogxel factory to use.
protected  void setSemanticIdentifierMap(SemanticIdentifierMap semanticIdentifierMap)
          Sets the semantic identifier map.
 CognitiveModuleState writeState(CognitiveModelState modelState)
          Write out the model and module state changes resulting from a call to evaluate NOTE: output state was held temporarily for the sole purpose of supporting concurrency of module evaluation; state is NEVER retained locally across module update cycles
 
Methods inherited from class gov.sandia.cognition.framework.concurrent.AbstractConcurrentCognitiveModule
update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODULE_NAME

public static final String MODULE_NAME
The name of the module.

See Also:
Constant Field Values
Constructor Detail

ArrayBasedPerceptionModule

public ArrayBasedPerceptionModule(SemanticIdentifierMap semanticIdentifierMap,
                                  CogxelFactory cogxelFactory)
Creates a new instance of ArrayBasedPerceptionModule.

Parameters:
semanticIdentifierMap - The semantic identifier map to use.
cogxelFactory - The CogxelFactory for creating Cogxels.
Method Detail

initializeState

public CognitiveModuleState initializeState(CognitiveModelState modelState)
This method initializes the state object for a CognitiveModel by adding any necessary information to the model state and returining the default state for the module.

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

readState

public void readState(CognitiveModelState modelState,
                      CognitiveModuleState previousModuleState)
Read in and temporarily hold input state information required for performing module evaluation. NOTE: input state is held temporarily for the sole purpose of supporting concurrency of module evaluation; state is NEVER retained locally across module update cycles

Specified by:
readState in interface ConcurrentCognitiveModule
Parameters:
modelState - The CognitiveModelState to evaluate with
previousModuleState - The previous CognitiveModuleState returned by this module
Since:
2.0

evaluate

public void evaluate()
Perform evaluation of sampled and held input state information that was captured by a call to readState, and hold the resultant output changes to model and module state pending a call to writeState NOTE: input and output state is held temporarily for the sole purpose of supporting concurrency of module evaluation; state is NEVER retained locally across module update cycles

Specified by:
evaluate in interface ConcurrentCognitiveModule
Since:
2.0

writeState

public CognitiveModuleState writeState(CognitiveModelState modelState)
Write out the model and module state changes resulting from a call to evaluate NOTE: output state was held temporarily for the sole purpose of supporting concurrency of module evaluation; state is NEVER retained locally across module update cycles

Specified by:
writeState in interface ConcurrentCognitiveModule
Parameters:
modelState - The CognitiveModelState to update
Returns:
The updated CognitiveModuleState for this module
Since:
2.0

getName

public String getName()
Gets the human-readable name of module.

Specified by:
getName in interface CognitiveModule
Returns:
The human-readable name of the module.

getSettings

public CognitiveModuleSettings getSettings()
Returns null because this module has no settings.

Specified by:
getSettings in interface CognitiveModule
Returns:
Null because this module has no settings.

setSemanticIdentifierMap

protected void setSemanticIdentifierMap(SemanticIdentifierMap semanticIdentifierMap)
Sets the semantic identifier map.

Parameters:
semanticIdentifierMap - The new semantic identifier map.

setCogxelFactory

protected void setCogxelFactory(CogxelFactory cogxelFactory)
Sets the cogxel factory to use.

Parameters:
cogxelFactory - The new cogxel factory to use.

getSemanticIdentifierMap

protected SemanticIdentifierMap getSemanticIdentifierMap()
Getter for semanticIdentifierMap

Returns:
The semantic identifier map. Currently unused, but provided because there may be a need to support SemanticLabels instead of identifiers later on.

getCogxelFactory

protected CogxelFactory getCogxelFactory()
Getter for cogxelFactory

Returns:
The factory for creating Cogxels for perception.