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

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

public class EvaluatorBasedCognitiveModule<InputType,OutputType>
extends AbstractConcurrentCognitiveModule

The EvaluatorBasedCognitiveModule implements a CognitiveModule that wraps an Evaluator object.

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

Field Summary
static String DEFAULT_NAME
          Default name given to modules of this type
protected  InputType input
          A place to temporarily store the input read in by a call to readState; this temporary store is blown away as soon as it used by evaluate, because we NEVER retain state interally across module update cycles
protected  OutputType output
          A place to temporarily store the output generated by a call to evaluate; this temporary store is blown away as soon as it used by evaluate, because we NEVER retain state interally across module update cycles
 
Constructor Summary
EvaluatorBasedCognitiveModule(CognitiveModel model, EvaluatorBasedCognitiveModuleSettings<InputType,OutputType> settings, String name)
          Creates a new instance of EvaluatorBasedCognitiveModule.
 
Method Summary
 void evaluate()
          
 gov.sandia.cognition.evaluator.Evaluator<? super InputType,? extends OutputType> getEvaluator()
          Gets the underlying evaluator that is being wrapped in this module.
 CogxelConverter<InputType> getInputConverter()
          Gets the input converter that is used to map from Cogxels to the InputType.
 String getName()
          
 CogxelConverter<OutputType> getOutputConverter()
          Gets the output converter that is used to map from the OutputType to Cogxels.
 EvaluatorBasedCognitiveModuleSettings<InputType,OutputType> getSettings()
          
 CognitiveModuleState initializeState(CognitiveModelState modelState)
          
 void readState(CognitiveModelState modelState, CognitiveModuleState previousModuleState)
          
 void setName(String name)
          Sets the name of the module
protected  void setSettings(EvaluatorBasedCognitiveModuleSettings<InputType,OutputType> settings)
          Sets the settings of the module.
 CognitiveModuleState writeState(CognitiveModelState modelState)
          
 
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

input

protected InputType input
A place to temporarily store the input read in by a call to readState; this temporary store is blown away as soon as it used by evaluate, because we NEVER retain state interally across module update cycles


output

protected OutputType output
A place to temporarily store the output generated by a call to evaluate; this temporary store is blown away as soon as it used by evaluate, because we NEVER retain state interally across module update cycles


DEFAULT_NAME

public static final String DEFAULT_NAME
Default name given to modules of this type

See Also:
Constant Field Values
Constructor Detail

EvaluatorBasedCognitiveModule

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

Parameters:
model - The model to create the module for.
settings - The settings of the module.
name - High-level name of this module
Method Detail

initializeState

public CognitiveModuleState initializeState(CognitiveModelState modelState)

Parameters:
modelState -
Returns:

readState

public void readState(CognitiveModelState modelState,
                      CognitiveModuleState previousModuleState)

Parameters:
modelState -
previousModuleState -
Since:
2.0

evaluate

public void evaluate()

Since:
2.0

writeState

public CognitiveModuleState writeState(CognitiveModelState modelState)

Parameters:
modelState -
Returns:
Since:
2.0

getName

public String getName()

Returns:

setName

public void setName(String name)
Sets the name of the module

Parameters:
name - Name to assign to the module

getSettings

public EvaluatorBasedCognitiveModuleSettings<InputType,OutputType> getSettings()

Returns:

setSettings

protected void setSettings(EvaluatorBasedCognitiveModuleSettings<InputType,OutputType> settings)
Sets the settings of the module.

Parameters:
settings - The module's settings.

getEvaluator

public gov.sandia.cognition.evaluator.Evaluator<? super InputType,? extends OutputType> getEvaluator()
Gets the underlying evaluator that is being wrapped in this module.

Returns:
The underlying evaluator that is being wrapped in this module.

getInputConverter

public CogxelConverter<InputType> getInputConverter()
Gets the input converter that is used to map from Cogxels to the InputType.

Returns:
The input converter.

getOutputConverter

public CogxelConverter<OutputType> getOutputConverter()
Gets the output converter that is used to map from the OutputType to Cogxels.

Returns:
The output converter.


Copyright © 2006-2011 Sandia National Laboratories. All Rights Reserved.