xfj

Section: User Commands (1)
Updated: 10 Sep 2001
Index
 

NAME

xfj - xfl to Java compiler  

SYNOPSIS

xfj [ -M[a|e|t|x] ] [ -O opsfile ] [ -o outprefix ] [ -e engname ] [ -d ] [ -p packagename ] [ -w ] xflfile  

DESCRIPTION

xfj takes an xfl file and produces a set of Java source files which implement the fuzzy types and the inference engine defined in xfl as Java classes: one for each type and one for the inference engine. This classes can be used to obtain a Java implementation of the fuzzy inference engine or, combined with any other Java classes, used to produce programs containing fuzzy logic capabilities.

All arithmetic calculations in the Java classes produced by xfj are carried out in double precision, using Java native "double" variables.

Classes corresponding to xfl types have the same name of the type they implement and offer the following interface:

Three different constructors that initializes the status of the object:

to the center of the universe of discourse, in the case of the parameterless constructor.

to a given crisp value, if the constructor with a single "double" parameter is used.

to a given set of linguistic values, when the constructor that accepts an array of "double" values is used.

One static method for each membership function defined in the type, which calculates the membership degree of a given crisp value. The name of these methods is "toMFName", where "MFName" is the name of the corresponding membership function in the xfl type.

One method for each membership function defined in the type, which returns the current membership degree. The name of these methods is "getMFName", where "MFName" is the name of the correspnding membership function in the xfl type.

An overloaded version of the "equals" method to test for the equality of two objects belonging to the class that implements the xfl type.

A method called "fuzzy", which performs the fuzzification of a given crisp value, updating the object status.

The class corresponding to the inference engine offers the following interface:

A parameterless constructor.

One method for each of the outputs defined for the system, to perform defuzzification. The name of these methods is "outputNameCrisp", where "outputName" is the name of the corresponding output in the xfl system definition. These methods require a fuzzy variable (with the same type the output belongs to) as parameter.

A method with three different signatures. This method is called "iEngine" and carries out the inference process. The three different signatures correspond to the different ways to provide inputs and outputs:

In its first form, "iEngine" accepts inputs and returns outputs in fuzzy representation, i.e., using variables that belong to classes implementing xfl types.

In its second form, "iEngine" accepts crisp ("double") inputs and returns fuzzy outputs.

In its third form, "iEngine" accepts crisp inputs and returns crisp (defuzzified) outputs. In this case, an array of values is used. The mapping between elements in the array and the input/output elements is given by their order in the xfl definition.

Besides these methods, the engine class has a "main" static method that executes an inference using the values of the input variables passed as arguments in the invocation of the class.

 

OPTIONS

-M
Selects the mode of operation: a performs only the syntax and (static) semantics analysis of the xfl source, without producing any output. e generates only the Java source file for the engine class. t generates only the Java source files for the type classes. x (which is the default if no -M option is specified) generates all Java source files.
-O opsfile
Use opsfile as the fuzzy operations file. By default, either the user's operations file ("$HOME/.xfjops") or a system-wide file ("$XFUZZY_LIB/xfjops", where $XFUZZY_LIB is the directory holding the Xfuzzy libraries distribution) is used. The operations file allows the use of specific definitions of T-norms (for the #and operator in xfl), T-conorms (for the #or, #also and #composition operators in xfl), negation functions (for the #not operator in xfl), implication functions (for the #implication operator in xfl) and defuzzification methods (for the #defuzzification operator in xfl). If no operations file can be accessed, xfj provides a set of internally defined fuzzy operations: the T-norm _sd_min (implementing the standard minimum operator), the T-conorm _sd_max (implementing the standard maximum operator), the negation _sd_not (implementing the 1-complement operator), the implication _sd_min (standard minimum again), and the defuzzification method _sd_CoA (the standard center-of-area method). Furthermore, these are the values used by xfj when any of the xfl operation selection operators is not present in the source file.
-o outprefix
Use outprefix as the prefix for the output files. Any valid path component can be used. The default value is "./".
-e engname
Use engname as the name of the class implementing the fuzzy inference engine. Any valid Java class identifier can be used. The default value is "XfIe".
-d
by default, xfj adds javadoc comments to the Java files it generates. This option suppresses this behavior.
-p packagename
include a package declaration in the output files. If type classes and the engine class are generated separately, it is important to note that the engine class code relies upon the assumption that it belongs to the same package that type classes.
-w
Suppresses the printing of warning messages on stderr.
 

FILES

$HOME/.xfjops
User's operations file (overriden by the -O option)
$XFUZZY_LIB/xfjops
System-wide operations file (overriden by the user's operations file and the -O option)
 

SEE ALSO

xfuzzy(1) javadoc(1)

A guide to xfl, Xfuzzy user guide


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
FILES
SEE ALSO