gov.sandia.cognition.framework.learning
Class StatefulEvaluatorBasedCognitiveModule<InputType,OutputType>

java.lang.Object
  extended by gov.sandia.cognition.framework.concurrent.AbstractConcurrentCognitiveModule
      extended by gov.sandia.cognition.framework.learning.EvaluatorBasedCognitiveModule<InputType,OutputType>
          extended by gov.sandia.cognition.framework.learning.StatefulEvaluatorBasedCognitiveModule<InputType,OutputType>
Type Parameters:
InputType - Input type of the embedded Evaluator
OutputType - Output type of the embedded Evaluator
All Implemented Interfaces:
CognitiveModule, ConcurrentCognitiveModule, Serializable

public class StatefulEvaluatorBasedCognitiveModule<InputType,OutputType>
extends EvaluatorBasedCognitiveModule<InputType,OutputType>

The StatefulEvaluatorBasedCognitiveModule implements a CognitiveModule that wraps a StatefulEvaluator object.

Since:
2.0
Author:
Justin Basilico, Kevin R. Dixon, Zachary Benz
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.sandia.cognition.framework.learning.EvaluatorBasedCognitiveModule
DEFAULT_NAME, input, output
 
Constructor Summary
StatefulEvaluatorBasedCognitiveModule(CognitiveModel model, EvaluatorBasedCognitiveModuleSettings<InputType,OutputType> settings, String name)
          Creates a new instance of StatefulEvaluatorBasedCognitiveModule.
 
Method Summary
 StatefulEvaluator<InputType,OutputType,CloneableSerializable> getStatefulEvaluator()
          Gets the StatefulEvaluator used by the 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.
 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 class gov.sandia.cognition.framework.learning.EvaluatorBasedCognitiveModule
evaluate, getEvaluator, getInputConverter, getName, getOutputConverter, getSettings, setName, setSettings
 
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
 

Constructor Detail

StatefulEvaluatorBasedCognitiveModule

public StatefulEvaluatorBasedCognitiveModule(CognitiveModel model,
                                             EvaluatorBasedCognitiveModuleSettings<InputType,OutputType> settings,
                                             String name)
Creates a new instance of StatefulEvaluatorBasedCognitiveModule.

Parameters:
model - The model to create the module for.
settings - The settings of the module.
name - High-level descriptive name of the module
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
Overrides:
initializeState in class EvaluatorBasedCognitiveModule<InputType,OutputType>
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
Overrides:
readState in class EvaluatorBasedCognitiveModule<InputType,OutputType>
Parameters:
modelState - The CognitiveModelState to evaluate with
previousModuleState - The previous CognitiveModuleState returned by this module
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
Overrides:
writeState in class EvaluatorBasedCognitiveModule<InputType,OutputType>
Parameters:
modelState - The CognitiveModelState to update
Returns:
The updated CognitiveModuleState for this module
Since:
2.0

getStatefulEvaluator

public StatefulEvaluator<InputType,OutputType,CloneableSerializable> getStatefulEvaluator()
Gets the StatefulEvaluator used by the module.

Returns:
The StatefulEvaluator used by the module.