FuzzyTools.java

// FILE. . . . . d:/hak/hlt/src/hlt/math/fuzzy/FuzzyTools.java
// EDIT BY . . . Hassan Ait-Kaci
// ON MACHINE. . Hp-Zbook
// STARTED ON. . Wed May 16 05:28:50 2018

package hlt.math.fuzzy;

package hlt.math.fuzzy package documentation listing



This is a grab-bag class for static methods implementing useful tools when dealing with fuzzy algebra.

See also:  FuzzyMatrix
Copyright:  © by the author
Author:  Hassan Aït-Kaci
Version:  Last modified on Sun Dec 08 14:28:37 2019 by hak


public class FuzzyTools
{
  

Determines the number of digits on the right of the dot to account for when comparing and printing fuzzy degrees. It is set with the setPrecision method. Must be at least 1. Defaults to 2.

  static private int precision = 2;
  
  static public void setPrecision (int precision) throws BadFuzzyValuePrecisionException
  {
    if (precision > 0)
      precision = precision;
    else
      throw new BadFuzzyValuePrecisionException("Bad fuzzy value precision: "+precision);
  }

  /* ******************************************************************** */

  

Verifies that the given double is a legitimate fuzzy truth degree (i.e., in [0.0]). If it is not, it throws a NonFuzzyValueException otherwise it returns its value.

  static final double checkFuzzyValue (double value) throws NonFuzzyValueException
  {
    if (value < 0.0 || value > 1.0)
      throw new NonFuzzyValueException("Fuzzy degree out of range: "+value);
			  
    return value;
  }

}


This file was generated on Wed Dec 18 03:38:08 PST 2019 from file FuzzyTools.java
by the hlt.language.tools.Hilite Java tool written by Hassan Aït-Kaci