This page holds information useful for those who want to build the software or dive inside the code.
This page holds information useful for those who want to build the software or dive inside the code.
For library usage, you better check out the Users guide.
- Software content
- Building the software
- Release history
- Source tree organization
- Coding style and misc.
- Doc generation
- Unit testing
At present, this software package is made of:
- static & dynamic libraries that can be linked to your code (in the "lib" folder)
- core library: lib_slifis.a
- graphical api library: lib_slifis_gapi.a
- standalone applications:
- command-line applications: (that build without the graphical lib)
- graphical applications:
- graphical demos:
- command-line demos:
Building the software
This section has been moved to Building the software.
NEXT RELEASE (roadmap)
- separate data handling code in a sub part of library
- 20130521: 0.7.1
- removed date in archive file (useless...)
- added mime file type association for Linux/Gnome.
- fixed makefile/build problems (dependency on obj files of 'other' folder for shared libs)
- added code to close window in cairo release of gapi.
- fixed bug in Cairo release of try-fis (composed membership functions for output wouldn't show).
- DATAFILE_INFO::AssignDataDescription() now throws exception in case of failure.
- fixed some issues in data handling, extended associated doc, added some tests.
- replaced GetMaxOut() and similar function with DATASET::GetInMMValue(), DATASET::GetOutMMValue() and new enum slifis::EN_MinMaxValue
- corrected standard deviation expression on data stats.
- fixed build on x86_64 platform (added -fPIC flag) (needs to be checked)
- Windows: switched to GCC/MingW 4.6.2 and boost 1.53
- 20130323: 0.7.0
- Windows build is now fixed, see Building on Windows.
- Fixed some build inconsistencies.
- Added sample Windows script files.
- Fixed bug in gapi/Opencv about open/close window (added std::map WindowIsOpen).
- Fixed bug in XML I/O (did not correctly handle FIS type).
- Fixed bug in SLIFIS::operator ==, now checks FIS type.
- Added inference parameters data (slifis::INF_PARAMS) in XML I/O => switched XML file format to 1.2.
- Added file type association on Windows (make target 'install')
- Added the graphical library name in released archive ("cairo" or "opencv" string)
- Included tinyxml binaries in lib_slifis, so user apps don't need to link against it.
- Fixed bug in makefile, that prevented from taking the 'release' version
- 20130308: 0.6.3
- renamed all const member functions, removed the _C suffix (wasn't necessary).
- extended doc on TS Fis and TS fitting.
- binary I/O now includes Fis parameters (TODO: fix that for XML).
- For enum printing, replaced all
GetXXX_String() functions by
- makefile: added
showpath target and cleaned color handling
- minor doc fixes.
- 20130205: 0.6.2
- Fixed bug in removing useless points, did not work if more than 1 point to remove.
- Added 2 enums, slifis::EN_TNORM and slifis::EN_SNORM for t-norms and s-norms.
- Added selector for aggregation of outputs from rules in Mamdani FIS type.
- Added struct for holding parameters of inference process (INF_PARAMS)
- Added constructors for symmetric fuzzy sets in MEMBFUNC
- Fixed bug in doc generation (on this page)
- Added printing of nb of hits (triggered bins) on histograms
- API change: SLIFIS::GetOutputValue() now returns value and throws error if unable
- fixed bug in defuzz methods: COG was in fact COA
- Added scaling unary function (MEMBFUNC::Scale() )
- Added selection of implication method
- minor TODO fixes.
- 20130130: 0.6.1
- extended doc.
- Clarified unary membership function operators (alphacut).
- API change: replaced merging operations names AND->MIN and OR->MAX to avoid confusions on implications methods.
- Added "Bounded Sum", "Probalistic Sum", "Lucasiewics" t-norm to the binary operations.
- Reorganized demo2.cpp and demo3.cpp: demo2 now for checking binary operations, demo3 for unary operations and defuzzyfying
- 20130125: 0.6.0
- cleaned up exported preprocessor symbols, now all exported symbols are prefixed with SLIFIS_ (except header guards, prefixed with HG_SLIFIS_). Only exceptions (3): ENDL, a shorthand for std::endl, and tracing macros __IN__ and __OUT__, that expand to a semi-colon.
- Adding rules from data now support a string value ("class") as output value, see bool SLIFIS::AddRuleFromValues()
- API change: for TS const coeff, "GetConstTSCoeff" replaced by "GetTSConstCoeff" (similar for SetXXX() functions).
- Major change in the way string data is handled in DATA_SET: string values are now stored in a relational way, the DATA_POINT string elements only hold an index on dedicated vector in DATA_SET. See Dataset handling.
- added NDEBUG option to makefile
- DATA_POINT does not hold a (static) description any more, it is moved to DATA_SET. This implies some minor API changes,
- Added SLIFIS::BuildRuleBaseFromData() and struct RBB_PARAMS
- added TS coeff fitting using Eigen external library (see SLIFIS::BuildTSRulesFromValues() and Building the software)
- DATA_POINT now holds an unique id value, to enable tracking of data points.
- new structure RBB_PARAMS, holds parameters and results for building rule base from data.
- 20130109: 0.5.1
- minor API change, enums for file types has been changed
- Added two defuzzification methods (see slifis::EN_DEFUZZMETHOD)
- Changed semantic of RULE_IDX::operator ==(): now completely compares rules, for only comparing premises of rules, new friend function PremisesAreEqual()
- gapi library API now uses only std::string as text data type.
- extended GAPI users guide.
- cleared CHANGELOG file, now useless.
- fixed some tracing macros stuff, now SLIFIS_ERROR macro include the __OUT__ macro
- XML I/O now correctly checks file version.
- 20130106 : release 0.5.0: (officialy switched to beta on SF...)
- changed error handling: no need to test return value for success or error in public interface, now most of the public API throws an exception in case of error, see Robustness and error handling.
- cleaned include chains
- separated enums for rules and merging (EN_OPTYPE) functions into 2 enums : slifis::EN_RULE_OP and slifis::EN_MERGE_OP
- cleaned error handling, removed lots of assertions and exit calls.
- change class name: RANGE into INPUT_RANGE, and
- XML now saves correctly Takagi-Sugeno FIS types
- fixed bug in ARFF files parsing, now can handle nominal attributes, handles spaces.
- removed app slifis-info by function PrintBuildInfo(), called through flag in try-fis.cpp
- added screenshots
- 20121227 : release 0.4.2
- integration of XML I/O support through Tinyxml, small API change (I/O functions)
- cleanup some macro stuff
- added new option (TRACELEVEL) to build, to enable tracing function calls only up to a given level
- added feature: can now generates data & command files to draw 3D plot of FIS (plotting done with gnuplot)
- added new app (slifis-info) to retrieve information about build
- added optional automatic format recognition for FIS file I/O
- bug cleaning
- 201211XX : release 0.4.1 (unreleased...)
- 20121023 : release 0.4
- switched to cairo/gtk for default graphical/windowing backend (gapi related)
- bugfixes and documentation improvments
- Added pseudo-gaussian membership functions
- 20120903 : release 0.3.0 (first beta)
- API should remain stable
- documentation improvments
- many bugfixes
- 20120522 : release 0.2.3
- 20120514 : release 0.2.2
- added FCL export
- added more regression tests
- command-line applications validated
- some bugs removed
- 20120116 : release 0.2.1
- 20111202 : release 0.2
- 20101214 : v 0.1 : first import to Sourceforge
Source tree organization
- doc : Contains documentation not included in modules (see Users guide),
- src/core : Contains the source files for the core lib,
- src/demo : Contains demo material (see src/demo/cl and src/demo/gui),
- src/app : Contains data related applications (see src/app/cl and src/app/gui),
- gapi : Contains code and project file for graphical interface (plotting membership functions and sets of membership functions) (see Slifis Graphical API for plotting),
- lib : Contains compiled static libraries
- bin : Contains all the binaries generated by compiling, except libraries (demos, simple applications).
- obj : Contains compiled object files (empty in release)
- other : Contains side libraries
- html : Contains doxygen generated html files (what you're probably reading right now...)
- misc : contains miscelaneous stuff...
- image : contains auto-generated and not auto-generated images.
Coding style and misc.
A strong focus has been put on readability an documentation through doxygen-style comments, as opposed to a more compact coding style.
The following conventions are used here, for personal and probably bad reasons.
- Except for basic datatypes, all class names are UPPERCASE
- All function names are CamelCase.
- All private functions have a "P_" prefix.
- All stl::vector variables are prefixed with "v_".
- All static variables and functions are prefixed with "s_".
- All pointers are prefixed with "p_" .
- Finally, all member variables are prefixed with "_".
- All constants and macros are UPPERCASE.
- All file names are lowercase.
- Indentation is "Allman" style, with real tabs (much easyer to edit) (see https://en.wikipedia.org/wiki/Indent_style#Allman_style).
- Heavy use of STL containers and algorithms.
With C++, and due to legacy reasons, there are two ways to handle strings:
- the "older" C-way:
- the C++-way:
Many codebases around use reference passing (
const std::string&) to avoid passing by value. However, this removes the ability to pass a hard-coded const string. This can be workarounded by creating two functions: one with a
const char* and the other with a
const std::string&. Here, choice has been made to stay with a passing-by-value strategy for all the public functions of the API.
Besides the Users guide, all the code is strongly documented. Many figures are included, most of them are generated at build time with generate-doc-plots.cpp. Documentation is produced with doxygen.
Some comments on doxygen processing:
- static and generated images are copied into html/img by makefile. This has been prefered to the usage of the doxygen feature that allows to automatically copy the images (see http://www.stack.nl/~dimitri/doxygen/commands.html#cmdimage) into html folder for two reasons:
- the copied images are in this case flooded under the tons of files that doxygen produces, making it hard to check manually for an unfound file.
- the copy mechanism provided by doxygen works only when using the "\image" doxygen command. When inserting directly html code ("<img src="...">"), then no copy is done, making this unreliable.
The bad thing about this approach is that lots of warnings get issued in the doxygen log file...
- In order for doxygen to get the version information that is stored in the makefile, the file doc_main.h is saved into a temporary folder and processed with sed to add the version info into a file named doc_main_1.h (see makefile, target 'doc-common').
A small unit test framework is used (kut), included here in the 'other' folder. It only provides a set of macros used to implement some unit testing. Each class has a member function that takes care of testing it's functionality. These functions are called in the program testfile.cpp. It is build and run with 'make test'.
This target also runs a set of commands using the binaries generated, to make sure they terminate normally (with