de.jstacs.algorithms.optimization
Class LimitedMedianStartDistance

java.lang.Object
  extended by de.jstacs.algorithms.optimization.LimitedMedianStartDistance
All Implemented Interfaces:
StartDistanceForecaster

public class LimitedMedianStartDistance
extends Object
implements StartDistanceForecaster

This class implements a StartDistanceForecaster that uses the median of a limited memory over the last values. The method getNewStartDistance() returns 0.667*median.

Author:
Jens Keilwagen

Constructor Summary
LimitedMedianStartDistance(int slots, double value)
          This constructor creates an instance with slots memory slots that will initially be filled with value.
 
Method Summary
 double getNewStartDistance()
          This method returns the new positive start distance.
 void reset()
          Resets the object to the initial state.
 void setLastDistance(double last)
          Sets the last used distance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LimitedMedianStartDistance

public LimitedMedianStartDistance(int slots,
                                  double value)
This constructor creates an instance with slots memory slots that will initially be filled with value.

Parameters:
slots - the number of slots in the memory
value - the initial value for the slots
Method Detail

getNewStartDistance

public double getNewStartDistance()
Description copied from interface: StartDistanceForecaster
This method returns the new positive start distance. It enables the implementor to compute any interpolation using the last values.

Specified by:
getNewStartDistance in interface StartDistanceForecaster
Returns:
the new positive start distance
See Also:
StartDistanceForecaster.setLastDistance(double)

setLastDistance

public void setLastDistance(double last)
Description copied from interface: StartDistanceForecaster
Sets the last used distance.

Specified by:
setLastDistance in interface StartDistanceForecaster
Parameters:
last - the last used distance

reset

public void reset()
Description copied from interface: StartDistanceForecaster
Resets the object to the initial state.

Specified by:
reset in interface StartDistanceForecaster