-d dsteps: Sets the number of defuzzification steps.
-s tsize: Sets the size of the membership function tables.
-c: The converter outputs C source code.
-b: The converter outputs a CFS file.
-t: The converter outputs a text file.
SOURCE: FIS file path.
DESTINATION: Output file path.
More details:
dsteps and tsize should be wired to option parameter of FuzzySystem.to_cfs. These options are supported but not exposed in the CLI at the moment.
-c should generate .h and .c files. An example of generated C source code is attached (motor18.h.txt,
motor18.c.txt).
-b should generate a binary .cfs file.
-t should generate a .txt file with the bytes of the CFS structure comma-separated and encoded as hex strings. An example of a text file is provided (motor15.txt).
-c , -t and -b should be mutually exclusive. If none of these options is defined, the output file type is inferred from the file extension. If the file extension is unknown, then a text file is generated.
If DESTINATION is omitted then the input file name is used with the corresponding extension.
To implement the output format selection three classes could be created under the lib/exporter directory: (maybe in three separate files: c_exporter.rb, cfs_exporter.rb and text_exporter.rb). A C++ implementation of c_exporter is attached as an example. See CExporter.cpp.txt,
CExporter.h.txt.
Support the following command line interface:
More details:
dsteps
andtsize
should be wired tooption
parameter ofFuzzySystem.to_cfs
. These options are supported but not exposed in the CLI at the moment.-c
should generate.h
and.c
files. An example of generated C source code is attached (motor18.h.txt, motor18.c.txt).-b
should generate a binary.cfs
file.-t
should generate a.txt
file with the bytes of the CFS structure comma-separated and encoded as hex strings. An example of a text file is provided (motor15.txt).-c
,-t
and-b
should be mutually exclusive. If none of these options is defined, the output file type is inferred from the file extension. If the file extension is unknown, then a text file is generated.DESTINATION
is omitted then the input file name is used with the corresponding extension.To implement the output format selection three classes could be created under the
lib/exporter
directory: (maybe in three separate files:c_exporter.rb
,cfs_exporter.rb
andtext_exporter.rb
). A C++ implementation ofc_exporter
is attached as an example. See CExporter.cpp.txt, CExporter.h.txt.