nrc.fuzzy
Class RightLinearFunction

java.lang.Object
  |
  +--nrc.fuzzy.RightLinearFunction
All Implemented Interfaces:
FuzzySetFunction, java.io.Serializable

public class RightLinearFunction
extends java.lang.Object
implements FuzzySetFunction, java.io.Serializable

An implementation of the FuzzySetFunction interface to provide a class with the ability to generate a FuzzySet that is a straight line (linear) from membership value 1 on the left to 0 on the right. This class is typically used when constructing instances of the classes RFuzzySet and LRFuzzySet.

See Also:
RFuzzySet, LRFuzzySet, TrapezoidFuzzySet, Serialized Form

Constructor Summary
RightLinearFunction()
          Create an instance of the RightLinearFunction class.
RightLinearFunction(int numPoints)
          Create an instance of the RightLinearFunction class with the default number of points in the FuzzySets generated by the generateFuzzySet(double leftX, double rightX) method set to numPoints.
 
Method Summary
 nrc.fuzzy.FuzzySet generateFuzzySet(double leftX, double rightX)
          Generates a FuzzySet that is a straight line (linear) from with membership value 1 on the left to 0 on the right.
 nrc.fuzzy.FuzzySet generateFuzzySet(double leftX, double rightX, int numPoints)
          Generates a FuzzySet that is a straight line (linear) from with membership value 1 on the left to 0 on the right.
static void setNumberOfPoints(int numPoints)
          Change the static variable defaultNumPoints to a new value (will be set to 2 if an attempt is made to set it to < 2).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RightLinearFunction

public RightLinearFunction()
Create an instance of the RightLinearFunction class.


RightLinearFunction

public RightLinearFunction(int numPoints)
Create an instance of the RightLinearFunction class with the default number of points in the FuzzySets generated by the generateFuzzySet(double leftX, double rightX) method set to numPoints.

Parameters:
numPoints - the default number of points in the FuzzyValues created by the generateFuzzySet(double leftX, double rightX) method
Method Detail

generateFuzzySet

public nrc.fuzzy.FuzzySet generateFuzzySet(double leftX,
                                           double rightX)
Generates a FuzzySet that is a straight line (linear) from with membership value 1 on the left to 0 on the right. The number of points in the FuzzySet will be determined by the static variable defaultNumPoints (normally set to 2).

Specified by:
generateFuzzySet in interface FuzzySetFunction
Parameters:
leftX - the left most X value of the FuzzySet (where membership value is 0)
rightX - the right most X value of the FuzzySet (where membership value is 1)
Returns:
a FuzzySet with X values between leftX and rightX

generateFuzzySet

public nrc.fuzzy.FuzzySet generateFuzzySet(double leftX,
                                           double rightX,
                                           int numPoints)
Generates a FuzzySet that is a straight line (linear) from with membership value 1 on the left to 0 on the right.

Specified by:
generateFuzzySet in interface FuzzySetFunction
Parameters:
leftX - the left most X value of the FuzzySet (where membership value is 0)
rightX - the right most X value of the FuzzySet (where membership value is 1)
numPoints - the number of points to generate for the set (if < 2 then it will be set to 2)
Returns:
a FuzzySet with X values between leftX and rightX

setNumberOfPoints

public static void setNumberOfPoints(int numPoints)
Change the static variable defaultNumPoints to a new value (will be set to 2 if an attempt is made to set it to < 2).

Parameters:
numPoints - the new value for the static variable defaultNumPoints