public class LimitedMedianStartDistance extends Object implements StartDistanceForecaster
StartDistanceForecaster
that uses the
median of a limited memory over the last values. The method
getNewStartDistance()
returns
0.667*median
.Constructor and Description |
---|
LimitedMedianStartDistance(int slots,
double value)
This constructor creates an instance with
slots memory slots
that will initially be filled with value . |
Modifier and Type | Method and Description |
---|---|
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.
|
public LimitedMedianStartDistance(int slots, double value)
slots
memory slots
that will initially be filled with value
.slots
- the number of slots in the memoryvalue
- the initial value for the slotspublic double getNewStartDistance()
StartDistanceForecaster
getNewStartDistance
in interface StartDistanceForecaster
StartDistanceForecaster.setLastDistance(double)
public void setLastDistance(double last)
StartDistanceForecaster
setLastDistance
in interface StartDistanceForecaster
last
- the last used distancepublic void reset()
StartDistanceForecaster
reset
in interface StartDistanceForecaster