gov.sandia.cognition.evaluator
Interface StatefulEvaluator<InputType,OutputType,StateType extends CloneableSerializable>

Type Parameters:
InputType - The type of the input the evaluator can use.
OutputType - The type of the output the evaluator will produce.
StateType - State object contained in this object.
All Superinterfaces:
Evaluator<InputType,OutputType>
All Known Subinterfaces:
DiscreteTimeFilter<StateType>
All Known Implementing Classes:
AbstractStatefulEvaluator, AutoRegressiveMovingAverageFilter, DelayFunction, KolmogorovSmirnovEvaluator, LinearDynamicalSystem, LinearRegressionCoefficientExtractor, MovingAverageFilter, PIDController

@CodeReview(reviewer="Kevin R. Dixon",
            date="2008-02-08",
            changesNeeded=false,
            comments="Fixed a couple of comment typos, otherwise looks fine.")
public interface StatefulEvaluator<InputType,OutputType,StateType extends CloneableSerializable>
extends Evaluator<InputType,OutputType>

The StatefulEvaluator interface defines the functionality of an Evaluator that maintains an internal state. It defines the methods for manipulating the state object.

Since:
2.0
Author:
Kevin R. Dixon

Method Summary
 StateType createDefaultState()
          Creates a new default state object.
 OutputType evaluate(InputType input)
          Evaluates the object using the given input and current state objects, returning the output.
 OutputType evaluate(InputType input, StateType state)
          Evaluates the object using the given input and the given state object, returning the output.
 StateType getState()
          Gets the current state of the evaluator.
 void resetState()
          Resets the state of the evaluator to a default state.
 void setState(StateType state)
          Sets the current state of the evaluator.
 

Method Detail

createDefaultState

StateType createDefaultState()
Creates a new default state object.

Returns:
A new default state object.

evaluate

OutputType evaluate(InputType input)
Evaluates the object using the given input and current state objects, returning the output. The current state may be modified by side effect.

Specified by:
evaluate in interface Evaluator<InputType,OutputType>
Parameters:
input - The input to evaluate.
Returns:
output that results from the evaluation, state is modified by side effect

evaluate

OutputType evaluate(InputType input,
                    StateType state)
Evaluates the object using the given input and the given state object, returning the output. The given state object may be modified by side effect. The current state of the Evaluator is also set to be the given state. Typically, the evaluator will set the current state to the given state and then call the single-parameter version of evaluate on the input.

Parameters:
input - The input to evaluate.
state - The state to use, which can be modified by side effect. The current state of the Evaluator will be based on this given state.
Returns:
The output of the evaluation. The state is also modified by side effect.

getState

StateType getState()
Gets the current state of the evaluator. This is a reference to the current state, which may later be modified by side-effect. If a true copy of the state is needed, this returned value should be copied.

Returns:
The current state.

setState

void setState(StateType state)
Sets the current state of the evaluator. Only states that are created by createDefaultState() or getState() should be used for proper behavior.

Parameters:
state - The new state for the evaluator.

resetState

void resetState()
Resets the state of the evaluator to a default state.