|
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 // Last modified on Sun Aug 05 08:31:44 2018 by hak package hlt.math.fuzzy;
| This is a grab-bag class for static methods implementing useful tools when dealing with fuzzy algebra. |
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 Sat Aug 25 09:29:34 CEST 2018 from file FuzzyTools.java
by the hlt.language.tools.Hilite Java tool written by Hassan Aït-Kaci