1 The FuzzyLite Libraries for Fuzzy Logic Control Juan Rada-Vilela, PhD. FuzzyLite Limited. Wellington, New Zealand. Abstract—Fuzzy Logic Controllers (FLCs) are mathematical models designed to control systems by means of fuzzy logic. Their simplicity, flexibility, interpretability, and handling of uncertainty have seen them applied to address different problems in a variety of domains. The seminal ideas of FLCs date back to 1965, and today there are more than 20 software libraries that provide such a functionality with different degrees of success. In spite of the widespread usage of FLCs, many of these libraries have not yet been thoroughly compared, hence raising questions about their correctness, performance, and accuracy when having to choose a library among them. In this article, we compare some of the most relevant libraries to design and operate FLCs, namely the FuzzyLite libraries, Matlab, Octave, and jFuzzyLogic. These libraries are evaluated on a set of 20 benchmarks that include Mamdani and Takagi-Sugeno FLCs as well as different membership functions. Our focus is on the performance and accuracy of the libraries, but we also consider the number of features and the amount of source code documentation to rate their overall quality. The results show that the FuzzyLite libraries offer the most accurate results, the highest number of features, the second best performance, and the second most documented source code, thus ranking them first for overall quality. The next libraries in the rankings are Octave, Matlab, and jFuzzyLogic (respectively). Our analysis of results finds explanations for the differences in performance and accuracy between the libraries, which provides useful information not only to further improve their quality, but also for users to make better and more informed decisions when having to choose one. Index Terms—Fuzzy control, Software libraries, Open-source software, Software metrics I. I NTRODUCTION Fuzzy Logic Controllers (FLCs) are mathematical models designed to control systems by means of fuzzy logic [1]. Specifically, a FLC consists of input variables, output vari- ables, and a set of inference rules that control the relationship between the variables. By using fuzzy logic, uncertainty is inherently represented and accounted for in the design and operation of the controller. For example, the temperature of an office can be controlled by a FLC using two rules stated as “if office is hot then fan is fast” and “if office is cold then fan is slow”, where “office” is the input variable representing temperature as “hot” and “cold”, and “fan” is the output variable representing the speed of a fan as “fast” and “slow”. Thus, the underlying mathematics of FLCs are abstracted by using natural language that incorporates the imprecision and vagueness of human decision making [2]. This simplicity, flexibility, interpretability, and handling of uncertainty has been exploited in machine learning [3], decision making [4], drone control [5], self-driving cars [6], collective robotics [7], sensor networks [8], computer games [9], among others [10]; and more generally in domains like medicine [11], bioinfor- matics [12], chemistry [13], agriculture [14], and others [15]. The field of fuzzy logic started in 1965 with the seminal work of Lofti Zadeh [1], and today there are more than 20 software libraries to model FLCs [16], [17]. In no particular order, we consider the following to be some of the most rele- vant libraries today: Matlab and its Fuzzy Logic Toolbox [18], Octave and its Fuzzy Logic Toolkit [19], jFuzzyLogic [16], [17], and the FuzzyLite libraries [20]. We consider these to be relevant libraries mainly because of their relatively high number of features, but also because (a) their source code is available and well designed and documented, (b) they have been maintained for at least five years, and (c) they have an important user base judging by their ranks in search engines and available download metrics. We want to highlight the contributions of these libraries to the scientific community by adopting open-source licenses [21] and, in the case of Matlab, for making the source code commercially available. The FuzzyLite libraries refer to the fuzzylite and jfuzzylite libraries for the C++ and Java programming languages, respec- tively. The goal of the FuzzyLite libraries is to easily design and efficiently operate FLCs following an object-oriented pro- gramming model without relying on external libraries. Started in 2010 and 2012, the FuzzyLite libraries are the most recent addition to fuzzy logic control software among the libraries here considered. Thus, we are interested in comparing them against some of the most relevant libraries for fuzzy logic control, particularly in terms of performance and accuracy. In addition, considering that a FLC can be configured with a variety of membership functions, we want to rank the performance of the libraries on different configurations in order to provide guidelines that will aid the design of more efficient FLCs. While previous works [16], [17] have compiled information about more than 20 libraries, these works did not focus on performance or accuracy, and did not include the FuzzyLite libraries. Hence, up to date, it is not certain which libraries offer the best performance or the best accuracy, let alone which membership functions are the most efficient. The overall goal of this article is to introduce the FuzzyLite libraries and compare them against some of the most relevant open-source libraries for fuzzy logic control. Specifically, we will focus on the following objectives: • Introduce the FuzzyLite libraries and their components. • Compare the performance and accuracy between the different libraries. • Identify the best performing configurations of FLCs. • Rank the libraries according to their overall quality. The remainder of this article is structured as follows. Section II presents related work and the software libraries. Section III presents an introduction to fuzzy logic control. Section IV presents the FuzzyLite libraries and their compo- nents. Section V presents the design of experiments to compare the libraries. Section VI presents the results and discussions. Lastly, Section VII presents the conclusions and future work. Copyright c 2018 FuzzyLite Limited. All rights reserved.