net.groboclown.util.math.fuzzylogic.v1
Class Fit
java.lang.Object
|
+--net.groboclown.util.math.fuzzylogic.v1.Fit
- public final class Fit
- extends Object
Represents the basic Fuzzy value. Like the Java number types, this
is an immutable type.
Field Summary |
private double |
value
|
Constructor Summary |
Fit(double value)
|
Method Summary |
Fit |
add(Fit f)
Performs an addition between two Fit values - equivalent to:
min( 1, this + f )
|
Fit |
div(Fit f)
Performs a division between two fit values. |
double |
getValue()
|
Fit |
min(Fit f)
Retrieves the minimum fit value, either the current Fit or the
given fit. |
Fit |
multiply(Fit f)
Multiplies the current fit value with the given fit value, and returns
the result. |
String |
toString()
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
value
private double value
Fit
public Fit(double value)
getValue
public double getValue()
multiply
public Fit multiply(Fit f)
- Multiplies the current fit value with the given fit value, and returns
the result.
min
public Fit min(Fit f)
- Retrieves the minimum fit value, either the current Fit or the
given fit. Will not allocate a new Fit value.
add
public Fit add(Fit f)
- Performs an addition between two Fit values - equivalent to:
min( 1, this + f )
div
public Fit div(Fit f)
- Performs a division between two fit values. Equivalent to:
supc ε [0, 1] [ f * c ≤ this ]
So that:
- if f is 0, then the return value is 1.
- if this / f is > 1, then we return 1.
- Otherwise, we return the division.
toString
public String toString()
- Overrides:
toString
in class Object
Written under the LGPL