jabble
Class Indicator

java.lang.Object
  extended by jabble.Indicator
Direct Known Subclasses:
AverageIndicator, IntegralIndicator, MaxIndicator, MinIndicator

public abstract class Indicator
extends java.lang.Object

Takes a function that calculates a value at each Point (for example: a field, the derivative of a field, the product of two fields, ...) and aggregates it to produce a single one (for example, takes the average, the maximum, ...). The two parts (the function and the aggregation) are defined separately: the function by a FunctionField object, and the aggrgation by a subclass of the Indicator.


Field Summary
protected  Grid grid
          The grid on which the indicator is being calculated.
 
Constructor Summary
protected Indicator(FunctionField function)
          Creates an indicator that uses the given function.
 
Method Summary
protected abstract  void aggregate(double value)
          Aggregates the value that are being calculated for this Indicator.
 double calculate(Slice slice)
          Calculate the given indicator on the given slice.
abstract  void init()
          Initializes the indicator for the next calculation.
abstract  double retrieveAggreateValue()
          Returns the value of the indicator for the current iteration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

grid

protected Grid grid
The grid on which the indicator is being calculated.

Constructor Detail

Indicator

protected Indicator(FunctionField function)
Creates an indicator that uses the given function.

Parameters:
function - the function whose values will be aggregated for the indicator
Method Detail

calculate

public double calculate(Slice slice)
Calculate the given indicator on the given slice.

Parameters:
slice - the slice on which to calculate the Indicator
Returns:
the value of the indicator

init

public abstract void init()
Initializes the indicator for the next calculation. This function should reset the aggregate value.


aggregate

protected abstract void aggregate(double value)
Aggregates the value that are being calculated for this Indicator.

Parameters:
value - a new value to be added to the aggregate function calculation

retrieveAggreateValue

public abstract double retrieveAggreateValue()
Returns the value of the indicator for the current iteration.

Returns:
the value of the indicator