jm.music.tools.fuzzy

## Class FuzzyNumber

- java.lang.Object
- - jm.music.tools.fuzzy.FuzzyNumber

-     public class FuzzyNumber
      extends java.lang.Object

  This class describes a fuzzy number with a triangular memebership function. Fuzzy numbers can be added to a fuzzy set. The number has three main properties, peak, minimum, and maximum, which describe the apex, left corner and right corner of the triangle. The triangle is normalised in the vertical direction, so membership values will be between 0.0 and 1.0. The degree of membership is computed by the getMembership method.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FuzzyNumber(double peak, double min, double max)` Create a new fuzzy number.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getMax()` Return the current value for the right corner of the triangular membership function.
    `double` | `getMembership(double value)` Calculate the degree of membership of a value within this fuzzy number.
    `double` | `getMin()` Return the current value for the left corner of the triangular membership function.
    `double` | `getPeak()` Return the current value for the centre of the triangular membership function.
    `void` | `setMax(double newValue)` Specify a value for the right corner of the triangular membership function.
    `void` | `setMin(double newValue)` Specify a value for the left corner of the triangular membership function.
    `void` | `setPeak(double newValue)` Specify a value for the centre of the triangular membership function.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FuzzyNumber

          public FuzzyNumber(double peak,
                     double min,
                     double max)

      Create a new fuzzy number.
      Parameters:
        `peak` - - The center value for the triangular membership function.
        `min` - - The leftmost or minimum value for the triangular membership function.
        `max` - - The rightmost or maximum value for the triangular membership function.

  - ### Method Detail

    - #### getMembership

          public double getMembership(double value)

      Calculate the degree of membership of a value within this fuzzy number.
      Parameters:
        `value` - - The number to be tested for its membership.
      Returns:
        The degree of membership within this fuzzy number.

    - #### setPeak

          public void setPeak(double newValue)

      Specify a value for the centre of the triangular membership function.
      Parameters:
        `newValue` - - The number to set the peak to.

    - #### getPeak

          public double getPeak()

      Return the current value for the centre of the triangular membership function.
      Returns:
        peak - The number currently set as the triangle's peak.

    - #### setMin

          public void setMin(double newValue)

      Specify a value for the left corner of the triangular membership function.
      Parameters:
        `newValue` - - The number to set the minimum to.

    - #### getMin

          public double getMin()

      Return the current value for the left corner of the triangular membership function.
      Returns:
        min - The number currently set as the triangle's left corner.

    - #### setMax

          public void setMax(double newValue)

      Specify a value for the right corner of the triangular membership function.
      Parameters:
        `newValue` - - The number to set the peak to.

    - #### getMax

          public double getMax()

      Return the current value for the right corner of the triangular membership function.
      Returns:
        max - The number currently set as the triangle's right corner.