public String fuzzify ( double x ) { StringBuilder sb = new StringBuilder ( ) ; for ( Term term : getTerms ( ) ) { double fx = term . membership ( x ) ; if ( sb . length ( ) == 0 ) { sb . append ( Op . str ( fx ) ) ; } else if ( Double . isNaN ( fx ) || Op . isGE ( fx , 0.0 ) ) { sb . append ( " + " ) . append ( Op . str ( fx ) ) ; } else { sb . append ( " - " ) . append ( Op . str ( fx ) ) ; } sb . append ( "/" ) . append ( term . getName ( ) ) ; } return sb . toString ( ) ; }
Evaluates the membership function of value x for each term i resulting in a fuzzy value in the form