public class ExponentialDecayFunction
extends java.lang.Object
a e-x / b
,
where x
is the (integer) independent variable.
Modifier and Type | Field and Description |
---|---|
private double |
a
Factor
a . |
private double |
oneOverB
Factor
1 / b . |
Constructor and Description |
---|
ExponentialDecayFunction(double initValue,
double valueAtNumCall,
long numCall)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
double |
value(long numCall)
Computes
a e-numCall / b . |
private final double a
a
.private final double oneOverB
1 / b
.public ExponentialDecayFunction(double initValue, double valueAtNumCall, long numCall)
a = initValue
b = -numCall / ln(valueAtNumCall / initValue)
initValue
- Initial value, i.e. value(0)
.valueAtNumCall
- Value of the function at numCall
.numCall
- Argument for which the function returns
valueAtNumCall
.NotStrictlyPositiveException
- if initValue <= 0
.NotStrictlyPositiveException
- if valueAtNumCall <= 0
.NumberIsTooLargeException
- if valueAtNumCall >= initValue
.NotStrictlyPositiveException
- if numCall <= 0
.Copyright (c) 2003-2014 Apache Software Foundation