nrc.fuzzy
Class LRFuzzySet

java.lang.Object
  |
  +--nrc.fuzzy.FuzzySet
        |
        +--nrc.fuzzy.LRFuzzySet
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
GaussianFuzzySet, PIFuzzySet, TrapezoidFuzzySet

public class LRFuzzySet
extends FuzzySet
implements java.io.Serializable

The LRFuzzySet class allows the construction of a wide range of FuzzySets with relatively the same shape.

Consider the diagram below. The point labelled 1 is the farthest left point on the FuzzySet and it also has a membership function of 0.0. Point 2 is the farthest left point with a membership value of 1.0, point 3 is the farthest right point with a membership function of 1.0, and point 4 is the farthest right point with a membership function of 0.0.

These four points are a fundamental characteristic of the LRFuzzySet. The LRFuzzySet will always be normal and convex, as the membership function of the beginning and end points is always 0.0, and the FuzzySet will always reach unity (whether contact with unity is extended or not; in other words, points 2 and 3 can have either different x values, or the same, depending on the shape of the LRFuzzySet desired), but never more than once. The x values of these four points are required from the user to construct a LRFuzzySet.

In addition to these four points, the LRFuzzySet requires a function to define the left half of the FuzzySet and a function to define the right half of the FuzzySet. For example, in the small diagram above, it appears that a linear function defines the shape of the FuzzySet between points 1 and 2, and again between points 3 and 4. Another example would be to have an S function on the left side of the LRFuzzySet and a Z function on the right side of the LRFuzzySet.

From this basic template, many different shapes of FuzzySets can be created. For example, the PI FuzzySet, a rectangle, a trapezoid, a triangle, and others.

See Also:
FuzzySet, RectangleFuzzySet, TriangleFuzzySet, TrapezoidFuzzySet, PIFuzzySet, Serialized Form

Nested Class Summary
 
Nested classes inherited from class nrc.fuzzy.FuzzySet
FuzzySet.UITools
 
Field Summary
 
Fields inherited from class nrc.fuzzy.FuzzySet
BFALSE, BTRUE, COLLINEAR_OR_PARALLEL, INCREMENT, INTERSECTION, MAX_INITIAL_POINTS, MAXMIN, NO_INTERSECTION, numPoints, set, simplified, SUM, tool, toStringPrecision, UNION
 
Constructor Summary
LRFuzzySet(double zeroLeftX, double oneLeftX, double oneRightX, double zeroRightX, nrc.fuzzy.FuzzySetFunction leftFunction, nrc.fuzzy.FuzzySetFunction rightFunction)
          Constructs a FuzzySet with the LRFuzzySet shape.
 
Method Summary
protected  void checkParameters(double zeroLeftX, double oneLeftX, double oneRightX, double zeroRightX)
          Checks that the parameters for the LR set creation are in correct x order.
 
Methods inherited from class nrc.fuzzy.FuzzySet
appendSetPoint, appendSetPoint, centerOfAreaDefuzzify, checkXValueOrder, checkYValueRange, concat, concat, confineToXBounds, copyFuzzySet, equals, findMaxYOverlapValue, fuzzyComplement, fuzzyEqual, fuzzyIntersection, fuzzyIntersection, fuzzyIntersectionUnion, fuzzyNormalize, fuzzyScale, fuzzySum, fuzzySum, fuzzyUnion, fuzzyUnion, getAlphaCut, getArea, getArea, getMaxY, getMembership, getMinY, getPoint, getSupport, getUITools, getX, getXforMembership, getY, goingDown, goingUp, horizontalIntersection, horizontalIntersectionUnion, horizontalUnion, incrementArrayLength, incrementArrayLength, insertSetPoint, insertSetPoint, isConvex, isEmpty, isNormal, isSimplified, maximumDefuzzify, maximumOfIntersection, maximumOfIntersection, momentDefuzzify, noIntersectionTest, nonIntersectionTest, plotFuzzySet, plotFuzzySets, removeSetPoint, removeSetPoint, sameDirection, sameSign, setToStringPrecision, shiftArrayLeft, shiftArrayRight, simplifySet, size, testArrayLength, toString, trimToSize, weightedAverageDefuzzify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LRFuzzySet

public LRFuzzySet(double zeroLeftX,
                  double oneLeftX,
                  double oneRightX,
                  double zeroRightX,
                  nrc.fuzzy.FuzzySetFunction leftFunction,
                  nrc.fuzzy.FuzzySetFunction rightFunction)
           throws XValuesOutOfOrderException
Constructs a FuzzySet with the LRFuzzySet shape.

The values of the different x parameters MUST be as follows:

zeroLeftX <= oneLeftX <= oneRightX <= zeroRightX.

If values are entered such that the previous expression is not satisfied, an XValuesOutOfOrderException will be thrown.

Parameters:
zeroLeftX - the x value of the point with zero membership on the left side of the LRFuzzySet
oneLeftX - the x value of the point with membership value 1.0 on the left side of the LRFuzzySet
oneRightX - the x value of the point with membership value 1.0 on the right side of the LRFuzzySet
zeroRightX - the x value of the point with zero membership on the right side of the LRFuzzySet
leftFunction - a FuzzySetFunction that defines the shape of the left portion of the curve
rightFunction - a FuzzySetFunction that defines the shape of the right portion of the curve
Throws:
XValuesOutOfOrderException
Method Detail

checkParameters

protected void checkParameters(double zeroLeftX,
                               double oneLeftX,
                               double oneRightX,
                               double zeroRightX)
                        throws XValuesOutOfOrderException
Checks that the parameters for the LR set creation are in correct x order.

Parameters:
zeroLeftX - the x value of the point with zero membership on the left side of the LRFuzzySet
oneLeftX - the x value of the point with membership value 1.0 on the left side of the LRFuzzySet
oneRightX - the x value of the point with membership value 1.0 on the right side of the LRFuzzySet
zeroRightX - the x value of the point with zero membership on the right side of the LRFuzzySet
Throws:
XValuesOutOfOrderException