Package libai.fuzzy.defuzzifiers
Class CenterOfArea
- java.lang.Object
-
- libai.fuzzy.defuzzifiers.Defuzzifier
-
- libai.fuzzy.defuzzifiers.CenterOfGravity
-
- libai.fuzzy.defuzzifiers.CenterOfArea
-
public class CenterOfArea extends CenterOfGravity
Defuzzifier method that calculates the value of x where the areas become equal in the aggregated function. Formally, CoA = Area(f, x0, CoA) = Area(f, CoA, xn) This implementation uses Riemann's sums and Binary search to locate the value of CoA, to a precision of 1.e-8
-
-
Field Summary
-
Fields inherited from class libai.fuzzy.defuzzifiers.Defuzzifier
COA, COG, MOM
-
-
Constructor Summary
Constructors Constructor Description CenterOfArea()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getValue(java.util.List<java.awt.geom.Point2D.Double> function)
Implements the center of gravity by calculating the Riemann's sums of the area using the trapezoidal rule.java.lang.String
toString()
-
Methods inherited from class libai.fuzzy.defuzzifiers.CenterOfGravity
riemmanSum, riemmanSum
-
Methods inherited from class libai.fuzzy.defuzzifiers.Defuzzifier
fromString
-
-
-
-
Method Detail
-
getValue
public double getValue(java.util.List<java.awt.geom.Point2D.Double> function)
Description copied from class:CenterOfGravity
Implements the center of gravity by calculating the Riemann's sums of the area using the trapezoidal rule. It assumes the x points are equally spaced across the whole domain of the function.- Overrides:
getValue
in classCenterOfGravity
- Parameters:
function
- the list of points [x, f(x)] representing the function to analyze.- Returns:
- the center of gravity of the function.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classCenterOfGravity
-
-