gov.sandia.cognition.framework
Interface CognitiveModule

All Superinterfaces:
Serializable
All Known Subinterfaces:
ConcurrentCognitiveModule, SemanticMemory
All Known Implementing Classes:
AbstractConcurrentCognitiveModule, AbstractSemanticMemoryLite, ArrayBasedPerceptionModule, EvaluatorBasedCognitiveModule, MutableSemanticMemoryLite, SharedSemanticMemoryLite, StatefulEvaluatorBasedCognitiveModule, VectorBasedPerceptionModule

public interface CognitiveModule
extends Serializable

The CognitiveModule interface defines the functionality of a general module that can be used in a CognitiveModel. Since a CognitiveModule belongs to a specific CognitiveModel, CognitiveModules are added to a CognitiveModel by passing in a CognitiveModuleFactory from which a CognitiveModel can create a CognitiveModule. While a CognitiveModule can store information about the CognitiveModel to which it belongs, it should not contain any state-dependent information, such as activations. That data should be stored in an object that implements the CognitiveModuleState interface. These module state objects are created by the initalizeState method and are passed into the update method so that the module is aware of its previous state and can return its new state.

Since:
1.0
Author:
Justin Basilico, Kevin R. Dixon
See Also:
CognitiveModuleFactory, CognitiveModuleState

Method Summary
 String getName()
          Gets the human-readable name of module.
 CognitiveModuleSettings getSettings()
          Gets the settings for the module, which can be used to create another instantation of a module.
 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.
 CognitiveModuleState update(CognitiveModelState modelState, CognitiveModuleState previousModuleState)
          This method is the main method for a CognitiveModule.
 

Method Detail

initializeState

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.

Parameters:
modelState - The CognitiveModelState to initalize
Returns:
The initial state of the CognitiveModule

update

CognitiveModuleState update(CognitiveModelState modelState,
                            CognitiveModuleState previousModuleState)
This method is the main method for a CognitiveModule. It updates the state of the model by modifying the given CognitiveModelState object. Since a module is not to store any local state information, it is given its previous CognitiveModuleState object in order to provide the information about its state. It then returns its updated CognitiveModuleState as the result of the update method.

Parameters:
modelState - The CognitiveModelState to update
previousModuleState - The previous CognitiveModuleState returned by this module
Returns:
The updated CognitiveModuleState for this module

getName

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

Returns:
The human-readable name of the module.

getSettings

CognitiveModuleSettings getSettings()
Gets the settings for the module, which can be used to create another instantation of a module.

Returns:
The settings for the module