gov.sandia.cognition.framework.concurrent
Interface ConcurrentCognitiveModule

All Superinterfaces:
CognitiveModule, Serializable
All Known Implementing Classes:
AbstractConcurrentCognitiveModule, ArrayBasedPerceptionModule, EvaluatorBasedCognitiveModule, StatefulEvaluatorBasedCognitiveModule

public interface ConcurrentCognitiveModule
extends CognitiveModule

The ConcurrentCognitiveModule interface extends the functionality of CognitiveModule to support concurrent module evaluation within a CognitiveModel. A ConcurrentCognitiveModule breaks the update step of a CognitiveModule into three pieces: readState, evaluate, and writeState. In so doing, multiple modules can be evaluated concurrently by a model as follows: Each module sequentially reads in and holds its input state using readState; All modules are concurrently evaluated using the internally held input state by calling evaluate; Lastly, each module sequentially writes out its resultant output state using writeState. 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:
2.0
Author:
Zachary Benz

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
 void readState(CognitiveModelState modelState, CognitiveModuleState previousModuleState)
          Read in and temporarily hold input state information required for performing module evaluation.
 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 interface gov.sandia.cognition.framework.CognitiveModule
getName, getSettings, initializeState, update
 

Method Detail

readState

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

Parameters:
modelState - The CognitiveModelState to evaluate with
previousModuleState - The previous CognitiveModuleState returned by this module

evaluate

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


writeState

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

Parameters:
modelState - The CognitiveModelState to update
Returns:
The updated CognitiveModuleState for this module