InputType
- Input type of the embedded EvaluatorOutputType
- Output type of the embedded Evaluatorpublic class StatefulEvaluatorBasedCognitiveModule<InputType,OutputType> extends EvaluatorBasedCognitiveModule<InputType,OutputType>
DEFAULT_NAME, input, output
Constructor and Description |
---|
StatefulEvaluatorBasedCognitiveModule(CognitiveModel model,
EvaluatorBasedCognitiveModuleSettings<InputType,OutputType> settings,
java.lang.String name)
Creates a new instance of StatefulEvaluatorBasedCognitiveModule.
|
Modifier and Type | Method and Description |
---|---|
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
|
evaluate, getEvaluator, getInputConverter, getName, getOutputConverter, getSettings, setName, setSettings
update
public StatefulEvaluatorBasedCognitiveModule(CognitiveModel model, EvaluatorBasedCognitiveModuleSettings<InputType,OutputType> settings, java.lang.String name)
model
- The model to create the module for.settings
- The settings of the module.name
- High-level descriptive name of the modulepublic CognitiveModuleState initializeState(CognitiveModelState modelState)
initializeState
in interface CognitiveModule
initializeState
in class EvaluatorBasedCognitiveModule<InputType,OutputType>
modelState
- The CognitiveModelState to initalizepublic void readState(CognitiveModelState modelState, CognitiveModuleState previousModuleState)
readState
in interface ConcurrentCognitiveModule
readState
in class EvaluatorBasedCognitiveModule<InputType,OutputType>
modelState
- The CognitiveModelState to evaluate withpreviousModuleState
- The previous CognitiveModuleState returned
by this modulepublic CognitiveModuleState writeState(CognitiveModelState modelState)
writeState
in interface ConcurrentCognitiveModule
writeState
in class EvaluatorBasedCognitiveModule<InputType,OutputType>
modelState
- The CognitiveModelState to updatepublic StatefulEvaluator<InputType,OutputType,CloneableSerializable> getStatefulEvaluator()