Package libai.fuzzy.sets
Class TrapezoidShape
- java.lang.Object
-
- libai.fuzzy.sets.TrapezoidShape
-
- All Implemented Interfaces:
FuzzySet
,XMLSerializer
public class TrapezoidShape extends java.lang.Object implements FuzzySet
Fuzzy set representing a trapezoid function. The trapezoid function can take 3 variations:
- right trapezoid to the left. a = b != c != d.
- centered trapezoid a != b != c != d.
- right trapezoid to the right a != b != c = d.
-
-
Constructor Summary
Constructors Constructor Description TrapezoidShape(double a, double b, double c, double d)
Constructor.TrapezoidShape(org.w3c.dom.Node xmlNode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
eval(double x)
Evaluate the membership of the set with the especified value.void
load(org.w3c.dom.Node xmlNode)
Initializes the instance with the xml node information.java.lang.String
toXMLString(java.lang.String indent)
Returns the XML representation of this Fuzzy set according with the FML schema definition.
-
-
-
Constructor Detail
-
TrapezoidShape
public TrapezoidShape(org.w3c.dom.Node xmlNode)
-
TrapezoidShape
public TrapezoidShape(double a, double b, double c, double d)
Constructor.- Parameters:
a
- Left vertex of the trapezoid.b
- Middle-left vertex of the trapezoid.c
- Middle-right vertex of the trapezoid.d
- Right vertex of the trapezoid.
-
-
Method Detail
-
eval
public double eval(double x)
Description copied from interface:FuzzySet
Evaluate the membership of the set with the especified value.
-
toXMLString
public java.lang.String toXMLString(java.lang.String indent)
Description copied from interface:XMLSerializer
Returns the XML representation of this Fuzzy set according with the FML schema definition.- Specified by:
toXMLString
in interfaceXMLSerializer
- Returns:
- XML representation of this Fuzzy Set.
-
load
public void load(org.w3c.dom.Node xmlNode)
Description copied from interface:XMLSerializer
Initializes the instance with the xml node information.- Specified by:
load
in interfaceXMLSerializer
- Parameters:
xmlNode
- XML node with the information to load the current object with.
-
-