1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Merge branch 'jcrada-develop' into develop

This commit is contained in:
Arseniy Shestakov 2017-08-15 18:28:08 +03:00
commit 82d107b934
205 changed files with 39 additions and 24121 deletions

4
.gitmodules vendored
View File

@ -1,3 +1,7 @@
[submodule "test/googletest"]
path = test/googletest
url = https://github.com/google/googletest
[submodule "AI/FuzzyLite"]
path = AI/FuzzyLite
url = https://github.com/fuzzylite/fuzzylite.git
branch = release

View File

@ -4,19 +4,15 @@ cmake_minimum_required(VERSION 2.8)
option(FORCE_BUNDLED_FL "Force to use FuzzyLite included into VCMI's source tree" OFF)
if (NOT FORCE_BUNDLED_FL)
find_package(Fuzzylite)
find_package(FuzzyLite)
else()
set(FL_FOUND FALSE)
endif()
if (NOT MSVC)
add_definitions(-DFL_CPP11)
set(FL_CPP11 ON CACHE BOOL "")
endif()
if (NOT FL_FOUND)
set(FL_BUILD_BINARY OFF CACHE BOOL "")
set(FL_BUILD_SHARED OFF CACHE BOOL "")
set(FL_BUILD_TESTS OFF CACHE BOOL "")
add_subdirectory(FuzzyLite/fuzzylite)
endif()
add_subdirectory(BattleAI)

1
AI/FuzzyLite Submodule

@ -0,0 +1 @@
Subproject commit 8bac66fc528f9a98984103b21c8ed17681069941

View File

@ -1,50 +0,0 @@
language: cpp
before_install:
#new GCC
- sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
#new Clang
- sudo add-apt-repository --yes ppa:h-rayflood/llvm
#new CMake
- sudo add-apt-repository --yes ppa:andykimpe/cmake
- sudo apt-get update -qq
- sudo apt-get install -qq cmake
- sudo apt-get install -qq $SUPPORT
- sudo apt-get install -qq $PACKAGE
#setup compiler
- export CC=${REAL_CC} CXX=${REAL_CXX}
before_script:
- mkdir build
- cd build
- cmake ../fuzzylite
script:
- make
env:
- ignore=this
matrix:
exclude:
- env: ignore=this
include:
- compiler: clang
env: REAL_CC=clang-3.2 REAL_CXX=clang++-3.2 PACKAGE=clang-3.2 SUPPORT=g++-4.8
- compiler: clang
env: REAL_CC=clang-3.3 REAL_CXX=clang++-3.3 PACKAGE=clang-3.3 SUPPORT=g++-4.8
- compiler: clang
env: REAL_CC=clang-3.4 REAL_CXX=clang++-3.4 PACKAGE=clang-3.4 SUPPORT=g++-4.8
- compiler: gcc
env: REAL_CC=gcc-4.7 REAL_CXX=g++-4.7 PACKAGE=g++-4.7 SUPPORT=
- compiler: gcc
env: REAL_CC=gcc-4.8 REAL_CXX=g++-4.8 PACKAGE=g++-4.8 SUPPORT=
notifications:
email:
recipients:
- uzzylite.fail@mixaill.tk
on_success: change
on_failure: always

View File

@ -1,3 +0,0 @@
Juan Rada-Vilela, Ph.D.
jcrada@fuzzylite.com
http://www.fuzzylite.com/jcrada

View File

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@ -1,165 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@ -1,214 +0,0 @@
Version 5.0
* Modified Function::Unary and Binary to take scalar instead of double
* Fixed building using -DFL_USE_FLOAT=ON
* Added deductive type of Engine with Engine::type()
* Fixed minor memory leak at RuleBlock (conjunction, disjunction, activation)
* Fixed minor memory leak at Accumulated (accumulation, thresholded terms)
* Fixed minor memory leak at OutputVariable (defuzzifier)
* Fixed minor memory leak at Function::Node
* Fixed minor memory leak at FactoryManager
* Improved handling of Exceptions
* Modified FclExporter and FisExporter to provide backward compatibility with FCL and FIS formats
* Updated the FIS and FCL examples for backward compatibility
* Included the original example files
* Updated FLD examples produced from the engines of the original examples
* Fixed some original examples of takagi-sugeno to use AlgebraicProduct activation
* FldExporter no longer restarts the engine
* Fixed rethrowing of exceptions to provide proper information about errors!
* Catching std::exceptions where possible to avoid unexpected exceptions
* FldExporter exports from a custom input dataset
* Console includes option to read custom input dataset from file
* Console provides more information about its usage
* Renamed methods FldExporter::toWriter() to FldExporter::write()
* Removed variable and methods for property FldExporter::maximum
* Accuracy improvements importing fis files with large number of decimals
* Updated FLD examples to reflect accuracy
* Changed operation for multiple hedges to operate from last to first
* Fixed OutputVariable to store last valid output value regardless of locks
* Renamed Op::isNan to Op::isNaN
* New OutputVariable::(get|set)OutputValue to store value from defuzzification
* Changed OutputVariable::defuzzify to store its output value
* Changed return type of scalar OutputVariable::defuzzify to void OutputVariable::defuzzify
* Renamed OutputVariable::(get|set)LastValidOutput to OutputVariable::(get|set)LastValidOutputValue
* Removed OutputVariable::defuzzifyNoLocks
* Removed const from Term* Accumulated::(get|set)Accumulation
* Added InputVariable::fuzzyInputValue and OutputVariable::fuzzyOutputValue
* Removed defaults in Engine::configure
* Added Engine::configure without conjuntion and disjuntion
* Added parameter string to Engine::type
* Changed Engine::isReady
* Correct handling of integral defuzzification with min|max=NaN|Inf
* Added method Rule::isLoaded to determine whether a rule is to be activated
* Added method Rule::unload to allow existence of invalid rules
* Added methods Engine::set((Input|Output)Variables), Engine::setRuleBlocks
* Added method RuleBlock::setRules
* Changed visibility of Rule::setText to public
* Added method Rule::load(const Engine*)
* Renamed term Thresholded to Activated
* Renamed Thresholded::(set|get)Threshold to Activated::(set|get)Degree
* Removed variable Rule::FL_ASSIGNS="=" and method Rule::assignsKeyword()
* Modified original takagi-sugeno examples to reflect proper activation and accumulation
* Moved Engine::_hedges (and methods) to Rule::_hedges
* Renamed Antecedent::(get|set)Root to Antecedent::(get|set)Expression
* Added (Antecedent|Consequent)::(get|set)Text
* Added (Antecedent|Consequent)::load|unload
* Renamed typedef Factory::Creator to Factory::Constructor
* Added an M-file to compare output values of fuzzylite engines with Matlab
* Removed const from Norms in RuleBlock::(get|set)(Activation|Conjunction|Disjunction)
* Deleted method Op::repeat
* Added built-in functions gt,lt,ge,le,eq and operator !
* Renamed Term::copy to Term::clone in every Term
* Added copy constructors and assignment operators to (Input|Output)Variable
* Added copy constructors and assignment operators to Accumulated
* Merged Function::Operator and Function::BuiltInFunction into Function::Element
* Created FunctionFactory for Function::Elements
* IMPORTANT: Changed starting precedence of Function::Element::Operators to 10 (refer to FunctionFactory)
* Setters of FactoryManager no longer delete previous factories
* Renamed Factory<T>::(register|deregister)Class to Factory<T>::(register|deregister)Constructor
* Renamed Factory<T> to ConstructionFactory<T>
* Created CloningFactory<T>
* Moved functions and operators of term Function to a FunctionFactory
* Added clone methods to Defuzzifiers, Hedges, Norms, and Terms
* Changed Exception::btCallStack(const int) to Exception::btCallStack(void)
* Using std::auto_ptr to (T|S)Norms in RuleBlock, SNorm in Accumulated, and Defuzzifier in OutputVariable
* Added methods Engine::set((Input|Output)Variable) and Engine::setRuleBlock()
* Added method RuleBlock::reloadRules()
* Changed Linear pointers to input variables for a pointer to Engine
* Added support to compare infinity values with fl::Op::isEq and therefore other comparison operators
* Parameters of all terms are set to fl::nan by default
* Added methods Engine::(input|output)Variables() and ::ruleBlocks() to return mutable references
* Added method Variable::terms() to return mutable reference
* Added method RuleBlock::rules() to return mutable reference
* Added methods Ramp::direction() and Sigmoid::direction() to represent direction of slope
* Added method fl::Op::isFinite(x) to check x is not (nan or inf)
* Changed fl::Op::isEq(a,b) to return true if a = b = NaN
* Added method Accumulated::terms() to return mutable reference
* Changed visibility of Linear::coefficients to protected
* Added methods Linear::coefficients(), Linear::setCoefficients()
* Removed public variables Discrete::x,y
* Added in Discrete a typedef to std::pair<scalar, scalar> Pair, and changed signatures of methods and types of their parameters
* Changed representation of Discrete::(x,y) from std::vector<scalar> to std::vector<Pair>
* Added methods Discrete::setXY(), Discrete::xy(), ::xy(int) to set and get new representation
* Added methods Discrete::toPairs(std::vector<scalar>) and Discrete::toVector(std::vector<Pair>)
* Added method Discrete::formatXY() to get pairs (x,y) nicely formatted
* Linear term no longer throws exception when inputVariables != |coefficients|
* Changed visibility of Function::root to protected and renamed it to Function::_root
* Added method Function::root() to return pointer to Function::_root
* Added option to prefix the namespace in CppExporter, by default it does not prefix
* Added method OutputVariable::clear() to restart the output variable
* Renamed variable OutputVariable::_lastValidOutputValue to ::_previousOutputValue
* Renamed method OutputVariable::(get|set)LastValidOutputValue to ::(get|set)PreviousOutputValue
* Renamed variable OutputVariable::_lockOutputRange to ::_lockOutputValueInRange
* Renamed method OutputVariable::setLockOutputRange() to ::setLockOutputValueInRange
* Renamed method OutputVariable::isLockingOutputRange() to ::isLockedOutputValueInRange
* Renamed variable OutputVariable::_lockValidOutput to ::_lockPreviousOutputValue
* Renamed method OutputVariable::setLockValidOutput() to ::setLockPreviousOutputValue
* Renamed method OutputVariable::isLockingValidOutput() to ::isLockedPreviousOutputValue
* Renamed FLL property 'lock-valid' to 'lock-previous'
* Renamed FIS property 'LockValid' to 'LockPrevious'
* Renamed FCL property 'LOCK: VALID' to 'LOCK: PREVIOUS'
* Added method Engine::variables() to retrieve both Input and OutputVariables
* Added method Term::updateReference(Term*, Engine*) to ensure Linear and Function terms to update references of engines
* Added method Engine::updateReferences() to update references to the engine in its terms.
* Added in Discrete a typedef to std::pair<scalar, scalar> Pair, and changed signatures of methods and types of their parameters
* Added terms: Concave, Cosine and Spike
* Renamed methods Triangle::(set|get)(A|B|C) to (set|get)(Vertex(A|B|C))
* Renamed methods Trapezoid::(set|get)(A|B|C|D) to (set|get)(Vertex(A|B|C|D))
* Removed method fuzzylite::configuration()
* Renamed MACRO FL_DEBUG to FL_DBG
* Renamed MACRO (FL_BEGIN_DEBUG_BLOCK and FL_END_DEBUG_BLOCK) to (FL_DEBUG_BEGIN and FL_DEBUG_END)
* Renamed methods in (Fis|Fcl)Importers::extract? to ::parse?
* Made defaultResolution a static property of IntegralDefuzzifiers
* Added method Engine::type(name, reason) to show type and reason why type
* Added method Engine::clone()
* Added support for Tsukamoto with Concave terms
* Changed Accumulated to take Activated* terms instead of const Terms*
* Deleted class Tsukamoto
* Created class WeightedDefuzzifier from which Weighted(Average|Sum) derive with options: Automatic|TakagiSugeno|Tsukamoto
* Added methods WeightedDefuzzifier::tsukamoto() and ::inferType()
* Added benchmarks for fuzzylite in Linux
* Created the FuzzyLite Interactive Console
* Added basic rule chaining such that Output Variables can be utilized as antecedents
* Added two examples for rule chaining: mamdani/Laundry.fll and mamdani/SimpleDimmerInverse.fll
* Added Term::(get|set)Height and changed all terms accordingly
* Renamed method Op::makeValidId to Op::validName, which now returns "unnamed" for empty strings.
* Converted examples/original/*.fis to examples/original/*.fll
* Removed Exception Specification from methods in Discrete, Linear and Function terms
* Changed name of debug libraries to fuzzylited.dll and fuzzylite-staticd.lib
* Removed method Operation::toScalar(std::string, bool, scalar)
* Added method Operation::toScalar(std::string) [throws Exception], and ::toScalar(std::string, scalar alternative) throw()
* Added method ImEx::(from|to)File to import and export engines using files
* WeightedAverage and WeightedSum without Activation operators have default behaviour, i.e., AlgebraicProduct
* FactoryManager utilizes smart pointers.
* Rule utilizes smart pointers for Antecedent and Consequent
* Exceptions are thrown when Conjunction, Disjunction, Activation and Accumulation operators are NULL when they are required
* Exception is thrown when Defuzzifier is required and not set.
* Added support for C++11 utilizing smart pointers, identifiers (override, noexcept), and delete identifiers to DISABLE_COPY(Class)
* Macros for identifiers are FL_IOVERRIDE, FL_IFINAL, FL_IDEFAULT, FL_IDELETE, and FL_INOEXCEPT (fl/fuzzylite.h)
* Added macro FL_unique_ptr to refer to std::auto_ptr (C++98) or std::unique_ptr (C++11), and its respective FL_move_ptr(x) to move a smart pointer.
* Added constant fl::null to refer to 0L (C++98) or nullptr (C++11)
* Added macros FL_DEFAULT_COPY(Class), FL_DEFAULT_MOVE(Class), and FL_DEFAULT_COPY_AND_MOVE(Class) for default copy and move constructors and operators
* Added build.sh to build fuzzylite
* Changed default to fuzzylite::_macheps = 1e-6;
* Renamed macro FL_EXPORTS to FL_API
* Added macro FL_SHARED_LIBRARY and FL_STATIC_LIBRARY to be defined when building shared and static libraries
Version 4.0
* FuzzyRule merged with Rule, and FuzzyRule deleted.
* FuzzyAntecedent merged with Antecedent, and FuzzyAntecedent deleted
* FuzzyConsequent merged with Consequent, and FuzzyConsequent deleted
* FuzzyExpression renamed Expression
* Renamed Rule::get/setUnparsedRule to get/setText
* Renamed RuleBlock::get/set(Tnorm|Snorm) to get/set(Conjunction|Disjunction)
* Renamed RuleBlock::fireRules to activate
* Renamed Rule::fireStrength to activationDegree, fire to activate
* Renamed Consequent::fire to modify
* Created IntegralDefuzzifier to extract divisions from Defuzzifier
* Renamed divisions from IntegralDefuzzifier to resolution, FL_DIVISIONS to FL_RESOLUTION
* Deleted MaximumDefuzzifier
* Centroid, Bisector, and Largest/Smallest/Mean Defuzzifiers inherit from IntegralDefuzzifier
* Changed names of arithmetic operations in fl::Operation
* Renamed Function::get/set(Infix) to get/set(Formula)
* Renamed InputVariable::get/set(Input) to get/set(InputValue)
* Renamed Antecedent::firingStrength to activationDegree
* Renamed Antecedent::toString/(Prefix,Infix,Postfix) to to/(Prefix,Infix,Postfix)
* Renamed Rule::FL_ASSIGN to Rule::FL_EQUALS
* New method restart in Engine
* New methods Engine::setInputValue(name, value), scalar Engine::getOutputValue(name)
* Renamed Op::str(vector/varargs) to Op::join(vector/varargs)
* Refactored associtativity, unary and binary properties in Element within Function
* Removed unnecessary Hedges creation upon importing engines, now is automatic via Factories
* Created the JavaExporter
* Renamed methods within Fis/Fcl/CppExporter to toString(*);
* Extracted TNorms and SNorms from TNorm.h/cpp and SNorm.h/cpp
* Created proper Factories with registration of classes and constructors
* Renamed method Factory::create to Factory::createInstance
* Added static constructor method to every Defuzzifier, Hedge, TNorm, and SNorm
* Removed FL_PRECISION, FL_DECIMALS as Macros, and created static variables in fuzzylite.h
* Renamed FL_PRECISION to macheps, i.e., machine epsilon to differentiate real numbers
* Removed FL_DEBUG and created a static variable in fuzzylite.h
* Removed FL_NO_LOG as it is now controlled with fuzzylite::logging(), previously named logEnabled()
* Libraries and Console application are both built in folder bin/ (previously libraries were at lib/)
* Removed Engine::toStringFis/Fcl/Cpp to encourage use of Fcl/Fis/CppExporters instead
* Renamed Op::logical_and to Op::logicalAnd, Op::logical_or to Op::logicalOr
* Added support to Fis/FclImporters to treat comments (%,#,//,/*) in fis and fcl files
* Created the Console application instead of previous demo
* Added Variable::range() to return (maximum - minimum)
* Removed Variable::isEmpty, use Variable::terms().empty()
* Removed RuleBlock::isEmpty, use RuleBlock::rules().empty()
* Created method Op::makeValidId to ensure names are valid
* Engine, Variable and Term::toString return FllExport::toString
* Created Term::parameters to return list of parameter values as string separated by spaces
* Created Term::configure to configure from Term::parameters
* FclImEx import and export terms using Term::parameters
* Created the FuzzyLite Language in FllImporter and FllExporter
* Created the FuzzyLite Dataset FldExporter
* Added property Enable to Engine, Variable and RuleBlock
* Extended FCL and FIS to consider Enabled properties
* Changed Engine::defuzzify() to consider enabled variables
* Changed Engine::process() to consider enabled rule blocks
* Changed OutputVariable::output() to OutputVariable::fuzzyOutput()
* Renamed Rectangle::minimum/maximum to Rectangle::start/end
* Renamed fuzzylite::shortVersion to fuzzylite::version
* Improved accuracy of Triangle and Trapezoid

View File

@ -1,252 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="FuzzyLite" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug-win32">
<Option platforms="Windows;" />
<Option output="../FuzzyLite" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option object_output="obj/Debug/x86/" />
<Option type="2" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Compiler>
<Add option="-Og" />
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release-win32">
<Option platforms="Windows;" />
<Option output="../FuzzyLite" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option object_output="obj/Release/x86/" />
<Option type="2" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Compiler>
<Add option="-fomit-frame-pointer" />
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
<Target title="Debug-win64">
<Option platforms="Windows;" />
<Option output="../FuzzyLite" prefix_auto="1" extension_auto="1" />
<Option working_dir="" />
<Option object_output="obj/Debug/x64/" />
<Option type="2" />
<Option compiler="gnu_gcc_compiler_x64" />
<Option createDefFile="1" />
<Compiler>
<Add option="-Og" />
<Add option="-g" />
</Compiler>
</Target>
</Build>
<Compiler>
<Add option="-Wextra" />
<Add option="-Wall" />
<Add option="-std=gnu++11" />
<Add option="-fexceptions" />
<Add option="-Wpointer-arith" />
<Add option="-Wno-switch" />
<Add option="-Wno-sign-compare" />
<Add option="-Wno-unused-parameter" />
<Add option="-Wno-overloaded-virtual" />
<Add option="-DFL_CPP11" />
<Add option="-DFL_WINDOWS" />
<Add directory="fuzzylite" />
</Compiler>
<Unit filename="fuzzylite/fl/Console.h" />
<Unit filename="fuzzylite/fl/Engine.h" />
<Unit filename="fuzzylite/fl/Exception.h" />
<Unit filename="fuzzylite/fl/Headers.h" />
<Unit filename="fuzzylite/fl/Operation.h" />
<Unit filename="fuzzylite/fl/defuzzifier/Bisector.h" />
<Unit filename="fuzzylite/fl/defuzzifier/Centroid.h" />
<Unit filename="fuzzylite/fl/defuzzifier/Defuzzifier.h" />
<Unit filename="fuzzylite/fl/defuzzifier/IntegralDefuzzifier.h" />
<Unit filename="fuzzylite/fl/defuzzifier/LargestOfMaximum.h" />
<Unit filename="fuzzylite/fl/defuzzifier/MeanOfMaximum.h" />
<Unit filename="fuzzylite/fl/defuzzifier/SmallestOfMaximum.h" />
<Unit filename="fuzzylite/fl/defuzzifier/WeightedAverage.h" />
<Unit filename="fuzzylite/fl/defuzzifier/WeightedDefuzzifier.h" />
<Unit filename="fuzzylite/fl/defuzzifier/WeightedSum.h" />
<Unit filename="fuzzylite/fl/factory/CloningFactory.h" />
<Unit filename="fuzzylite/fl/factory/ConstructionFactory.h" />
<Unit filename="fuzzylite/fl/factory/DefuzzifierFactory.h" />
<Unit filename="fuzzylite/fl/factory/FactoryManager.h" />
<Unit filename="fuzzylite/fl/factory/FunctionFactory.h" />
<Unit filename="fuzzylite/fl/factory/HedgeFactory.h" />
<Unit filename="fuzzylite/fl/factory/SNormFactory.h" />
<Unit filename="fuzzylite/fl/factory/TNormFactory.h" />
<Unit filename="fuzzylite/fl/factory/TermFactory.h" />
<Unit filename="fuzzylite/fl/fuzzylite.h" />
<Unit filename="fuzzylite/fl/hedge/Any.h" />
<Unit filename="fuzzylite/fl/hedge/Extremely.h" />
<Unit filename="fuzzylite/fl/hedge/Hedge.h" />
<Unit filename="fuzzylite/fl/hedge/Not.h" />
<Unit filename="fuzzylite/fl/hedge/Seldom.h" />
<Unit filename="fuzzylite/fl/hedge/Somewhat.h" />
<Unit filename="fuzzylite/fl/hedge/Very.h" />
<Unit filename="fuzzylite/fl/imex/CppExporter.h" />
<Unit filename="fuzzylite/fl/imex/Exporter.h" />
<Unit filename="fuzzylite/fl/imex/FclExporter.h" />
<Unit filename="fuzzylite/fl/imex/FclImporter.h" />
<Unit filename="fuzzylite/fl/imex/FisExporter.h" />
<Unit filename="fuzzylite/fl/imex/FisImporter.h" />
<Unit filename="fuzzylite/fl/imex/FldExporter.h" />
<Unit filename="fuzzylite/fl/imex/FllExporter.h" />
<Unit filename="fuzzylite/fl/imex/FllImporter.h" />
<Unit filename="fuzzylite/fl/imex/Importer.h" />
<Unit filename="fuzzylite/fl/imex/JavaExporter.h" />
<Unit filename="fuzzylite/fl/norm/Norm.h" />
<Unit filename="fuzzylite/fl/norm/SNorm.h" />
<Unit filename="fuzzylite/fl/norm/TNorm.h" />
<Unit filename="fuzzylite/fl/norm/s/AlgebraicSum.h" />
<Unit filename="fuzzylite/fl/norm/s/BoundedSum.h" />
<Unit filename="fuzzylite/fl/norm/s/DrasticSum.h" />
<Unit filename="fuzzylite/fl/norm/s/EinsteinSum.h" />
<Unit filename="fuzzylite/fl/norm/s/HamacherSum.h" />
<Unit filename="fuzzylite/fl/norm/s/Maximum.h" />
<Unit filename="fuzzylite/fl/norm/s/NilpotentMaximum.h" />
<Unit filename="fuzzylite/fl/norm/s/NormalizedSum.h" />
<Unit filename="fuzzylite/fl/norm/t/AlgebraicProduct.h" />
<Unit filename="fuzzylite/fl/norm/t/BoundedDifference.h" />
<Unit filename="fuzzylite/fl/norm/t/DrasticProduct.h" />
<Unit filename="fuzzylite/fl/norm/t/EinsteinProduct.h" />
<Unit filename="fuzzylite/fl/norm/t/HamacherProduct.h" />
<Unit filename="fuzzylite/fl/norm/t/Minimum.h" />
<Unit filename="fuzzylite/fl/norm/t/NilpotentMinimum.h" />
<Unit filename="fuzzylite/fl/rule/Antecedent.h" />
<Unit filename="fuzzylite/fl/rule/Consequent.h" />
<Unit filename="fuzzylite/fl/rule/Expression.h" />
<Unit filename="fuzzylite/fl/rule/Rule.h" />
<Unit filename="fuzzylite/fl/rule/RuleBlock.h" />
<Unit filename="fuzzylite/fl/term/Accumulated.h" />
<Unit filename="fuzzylite/fl/term/Activated.h" />
<Unit filename="fuzzylite/fl/term/Bell.h" />
<Unit filename="fuzzylite/fl/term/Concave.h" />
<Unit filename="fuzzylite/fl/term/Constant.h" />
<Unit filename="fuzzylite/fl/term/Cosine.h" />
<Unit filename="fuzzylite/fl/term/Discrete.h" />
<Unit filename="fuzzylite/fl/term/Function.h" />
<Unit filename="fuzzylite/fl/term/Gaussian.h" />
<Unit filename="fuzzylite/fl/term/GaussianProduct.h" />
<Unit filename="fuzzylite/fl/term/Linear.h" />
<Unit filename="fuzzylite/fl/term/PiShape.h" />
<Unit filename="fuzzylite/fl/term/Ramp.h" />
<Unit filename="fuzzylite/fl/term/Rectangle.h" />
<Unit filename="fuzzylite/fl/term/SShape.h" />
<Unit filename="fuzzylite/fl/term/Sigmoid.h" />
<Unit filename="fuzzylite/fl/term/SigmoidDifference.h" />
<Unit filename="fuzzylite/fl/term/SigmoidProduct.h" />
<Unit filename="fuzzylite/fl/term/Spike.h" />
<Unit filename="fuzzylite/fl/term/Term.h" />
<Unit filename="fuzzylite/fl/term/Trapezoid.h" />
<Unit filename="fuzzylite/fl/term/Triangle.h" />
<Unit filename="fuzzylite/fl/term/ZShape.h" />
<Unit filename="fuzzylite/fl/variable/InputVariable.h" />
<Unit filename="fuzzylite/fl/variable/OutputVariable.h" />
<Unit filename="fuzzylite/fl/variable/Variable.h" />
<Unit filename="fuzzylite/src/Console.cpp" />
<Unit filename="fuzzylite/src/Engine.cpp" />
<Unit filename="fuzzylite/src/Exception.cpp" />
<Unit filename="fuzzylite/src/Operation.cpp" />
<Unit filename="fuzzylite/src/defuzzifier/Bisector.cpp" />
<Unit filename="fuzzylite/src/defuzzifier/Centroid.cpp" />
<Unit filename="fuzzylite/src/defuzzifier/IntegralDefuzzifier.cpp" />
<Unit filename="fuzzylite/src/defuzzifier/LargestOfMaximum.cpp" />
<Unit filename="fuzzylite/src/defuzzifier/MeanOfMaximum.cpp" />
<Unit filename="fuzzylite/src/defuzzifier/SmallestOfMaximum.cpp" />
<Unit filename="fuzzylite/src/defuzzifier/WeightedAverage.cpp" />
<Unit filename="fuzzylite/src/defuzzifier/WeightedDefuzzifier.cpp" />
<Unit filename="fuzzylite/src/defuzzifier/WeightedSum.cpp" />
<Unit filename="fuzzylite/src/factory/CloningFactory.cpp" />
<Unit filename="fuzzylite/src/factory/ConstructionFactory.cpp" />
<Unit filename="fuzzylite/src/factory/DefuzzifierFactory.cpp" />
<Unit filename="fuzzylite/src/factory/FactoryManager.cpp" />
<Unit filename="fuzzylite/src/factory/FunctionFactory.cpp" />
<Unit filename="fuzzylite/src/factory/HedgeFactory.cpp" />
<Unit filename="fuzzylite/src/factory/SNormFactory.cpp" />
<Unit filename="fuzzylite/src/factory/TNormFactory.cpp" />
<Unit filename="fuzzylite/src/factory/TermFactory.cpp" />
<Unit filename="fuzzylite/src/fuzzylite.cpp" />
<Unit filename="fuzzylite/src/hedge/Any.cpp" />
<Unit filename="fuzzylite/src/hedge/Extremely.cpp" />
<Unit filename="fuzzylite/src/hedge/Not.cpp" />
<Unit filename="fuzzylite/src/hedge/Seldom.cpp" />
<Unit filename="fuzzylite/src/hedge/Somewhat.cpp" />
<Unit filename="fuzzylite/src/hedge/Very.cpp" />
<Unit filename="fuzzylite/src/imex/CppExporter.cpp" />
<Unit filename="fuzzylite/src/imex/Exporter.cpp" />
<Unit filename="fuzzylite/src/imex/FclExporter.cpp" />
<Unit filename="fuzzylite/src/imex/FclImporter.cpp" />
<Unit filename="fuzzylite/src/imex/FisExporter.cpp" />
<Unit filename="fuzzylite/src/imex/FisImporter.cpp" />
<Unit filename="fuzzylite/src/imex/FldExporter.cpp" />
<Unit filename="fuzzylite/src/imex/FllExporter.cpp" />
<Unit filename="fuzzylite/src/imex/FllImporter.cpp" />
<Unit filename="fuzzylite/src/imex/Importer.cpp" />
<Unit filename="fuzzylite/src/imex/JavaExporter.cpp" />
<Unit filename="fuzzylite/src/main.cpp" />
<Unit filename="fuzzylite/src/norm/s/AlgebraicSum.cpp" />
<Unit filename="fuzzylite/src/norm/s/BoundedSum.cpp" />
<Unit filename="fuzzylite/src/norm/s/DrasticSum.cpp" />
<Unit filename="fuzzylite/src/norm/s/EinsteinSum.cpp" />
<Unit filename="fuzzylite/src/norm/s/HamacherSum.cpp" />
<Unit filename="fuzzylite/src/norm/s/Maximum.cpp" />
<Unit filename="fuzzylite/src/norm/s/NilpotentMaximum.cpp" />
<Unit filename="fuzzylite/src/norm/s/NormalizedSum.cpp" />
<Unit filename="fuzzylite/src/norm/t/AlgebraicProduct.cpp" />
<Unit filename="fuzzylite/src/norm/t/BoundedDifference.cpp" />
<Unit filename="fuzzylite/src/norm/t/DrasticProduct.cpp" />
<Unit filename="fuzzylite/src/norm/t/EinsteinProduct.cpp" />
<Unit filename="fuzzylite/src/norm/t/HamacherProduct.cpp" />
<Unit filename="fuzzylite/src/norm/t/Minimum.cpp" />
<Unit filename="fuzzylite/src/norm/t/NilpotentMinimum.cpp" />
<Unit filename="fuzzylite/src/rule/Antecedent.cpp" />
<Unit filename="fuzzylite/src/rule/Consequent.cpp" />
<Unit filename="fuzzylite/src/rule/Expression.cpp" />
<Unit filename="fuzzylite/src/rule/Rule.cpp" />
<Unit filename="fuzzylite/src/rule/RuleBlock.cpp" />
<Unit filename="fuzzylite/src/term/Accumulated.cpp" />
<Unit filename="fuzzylite/src/term/Activated.cpp" />
<Unit filename="fuzzylite/src/term/Bell.cpp" />
<Unit filename="fuzzylite/src/term/Concave.cpp" />
<Unit filename="fuzzylite/src/term/Constant.cpp" />
<Unit filename="fuzzylite/src/term/Cosine.cpp" />
<Unit filename="fuzzylite/src/term/Discrete.cpp" />
<Unit filename="fuzzylite/src/term/Function.cpp" />
<Unit filename="fuzzylite/src/term/Gaussian.cpp" />
<Unit filename="fuzzylite/src/term/GaussianProduct.cpp" />
<Unit filename="fuzzylite/src/term/Linear.cpp" />
<Unit filename="fuzzylite/src/term/PiShape.cpp" />
<Unit filename="fuzzylite/src/term/Ramp.cpp" />
<Unit filename="fuzzylite/src/term/Rectangle.cpp" />
<Unit filename="fuzzylite/src/term/SShape.cpp" />
<Unit filename="fuzzylite/src/term/Sigmoid.cpp" />
<Unit filename="fuzzylite/src/term/SigmoidDifference.cpp" />
<Unit filename="fuzzylite/src/term/SigmoidProduct.cpp" />
<Unit filename="fuzzylite/src/term/Spike.cpp" />
<Unit filename="fuzzylite/src/term/Term.cpp" />
<Unit filename="fuzzylite/src/term/Trapezoid.cpp" />
<Unit filename="fuzzylite/src/term/Triangle.cpp" />
<Unit filename="fuzzylite/src/term/ZShape.cpp" />
<Unit filename="fuzzylite/src/variable/InputVariable.cpp" />
<Unit filename="fuzzylite/src/variable/OutputVariable.cpp" />
<Unit filename="fuzzylite/src/variable/Variable.cpp" />
<Extensions>
<code_completion />
<envvars />
<debugger />
<lib_finder disable_auto="1" />
</Extensions>
</Project>
</CodeBlocks_project_file>

View File

@ -1,328 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="RD|Win32">
<Configuration>RD</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="RD|x64">
<Configuration>RD</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="fuzzylite\fl\Console.h" />
<ClInclude Include="fuzzylite\fl\defuzzifier\Bisector.h" />
<ClInclude Include="fuzzylite\fl\defuzzifier\Centroid.h" />
<ClInclude Include="fuzzylite\fl\defuzzifier\Defuzzifier.h" />
<ClInclude Include="fuzzylite\fl\defuzzifier\IntegralDefuzzifier.h" />
<ClInclude Include="fuzzylite\fl\defuzzifier\LargestOfMaximum.h" />
<ClInclude Include="fuzzylite\fl\defuzzifier\MeanOfMaximum.h" />
<ClInclude Include="fuzzylite\fl\defuzzifier\SmallestOfMaximum.h" />
<ClInclude Include="fuzzylite\fl\defuzzifier\WeightedAverage.h" />
<ClInclude Include="fuzzylite\fl\defuzzifier\WeightedDefuzzifier.h" />
<ClInclude Include="fuzzylite\fl\defuzzifier\WeightedSum.h" />
<ClInclude Include="fuzzylite\fl\Engine.h" />
<ClInclude Include="fuzzylite\fl\Exception.h" />
<ClInclude Include="fuzzylite\fl\factory\CloningFactory.h" />
<ClInclude Include="fuzzylite\fl\factory\ConstructionFactory.h" />
<ClInclude Include="fuzzylite\fl\factory\DefuzzifierFactory.h" />
<ClInclude Include="fuzzylite\fl\factory\FactoryManager.h" />
<ClInclude Include="fuzzylite\fl\factory\FunctionFactory.h" />
<ClInclude Include="fuzzylite\fl\factory\HedgeFactory.h" />
<ClInclude Include="fuzzylite\fl\factory\SNormFactory.h" />
<ClInclude Include="fuzzylite\fl\factory\TermFactory.h" />
<ClInclude Include="fuzzylite\fl\factory\TNormFactory.h" />
<ClInclude Include="fuzzylite\fl\fuzzylite.h" />
<ClInclude Include="fuzzylite\fl\Headers.h" />
<ClInclude Include="fuzzylite\fl\hedge\Any.h" />
<ClInclude Include="fuzzylite\fl\hedge\Extremely.h" />
<ClInclude Include="fuzzylite\fl\hedge\Hedge.h" />
<ClInclude Include="fuzzylite\fl\hedge\Not.h" />
<ClInclude Include="fuzzylite\fl\hedge\Seldom.h" />
<ClInclude Include="fuzzylite\fl\hedge\Somewhat.h" />
<ClInclude Include="fuzzylite\fl\hedge\Very.h" />
<ClInclude Include="fuzzylite\fl\imex\CppExporter.h" />
<ClInclude Include="fuzzylite\fl\imex\Exporter.h" />
<ClInclude Include="fuzzylite\fl\imex\FclExporter.h" />
<ClInclude Include="fuzzylite\fl\imex\FclImporter.h" />
<ClInclude Include="fuzzylite\fl\imex\FisExporter.h" />
<ClInclude Include="fuzzylite\fl\imex\FisImporter.h" />
<ClInclude Include="fuzzylite\fl\imex\FldExporter.h" />
<ClInclude Include="fuzzylite\fl\imex\FllExporter.h" />
<ClInclude Include="fuzzylite\fl\imex\FllImporter.h" />
<ClInclude Include="fuzzylite\fl\imex\Importer.h" />
<ClInclude Include="fuzzylite\fl\imex\JavaExporter.h" />
<ClInclude Include="fuzzylite\fl\norm\SNorm.h" />
<ClInclude Include="fuzzylite\fl\norm\TNorm.h" />
<ClInclude Include="fuzzylite\fl\Operation.h" />
<ClInclude Include="fuzzylite\fl\rule\Antecedent.h" />
<ClInclude Include="fuzzylite\fl\rule\Consequent.h" />
<ClInclude Include="fuzzylite\fl\rule\Expression.h" />
<ClInclude Include="fuzzylite\fl\rule\Rule.h" />
<ClInclude Include="fuzzylite\fl\rule\RuleBlock.h" />
<ClInclude Include="fuzzylite\fl\term\Accumulated.h" />
<ClInclude Include="fuzzylite\fl\term\Activated.h" />
<ClInclude Include="fuzzylite\fl\term\Bell.h" />
<ClInclude Include="fuzzylite\fl\term\Concave.h" />
<ClInclude Include="fuzzylite\fl\term\Constant.h" />
<ClInclude Include="fuzzylite\fl\term\Cosine.h" />
<ClInclude Include="fuzzylite\fl\term\Discrete.h" />
<ClInclude Include="fuzzylite\fl\term\Function.h" />
<ClInclude Include="fuzzylite\fl\term\Gaussian.h" />
<ClInclude Include="fuzzylite\fl\term\GaussianProduct.h" />
<ClInclude Include="fuzzylite\fl\term\Linear.h" />
<ClInclude Include="fuzzylite\fl\term\PiShape.h" />
<ClInclude Include="fuzzylite\fl\term\Ramp.h" />
<ClInclude Include="fuzzylite\fl\term\Rectangle.h" />
<ClInclude Include="fuzzylite\fl\term\Sigmoid.h" />
<ClInclude Include="fuzzylite\fl\term\SigmoidDifference.h" />
<ClInclude Include="fuzzylite\fl\term\SigmoidProduct.h" />
<ClInclude Include="fuzzylite\fl\term\Spike.h" />
<ClInclude Include="fuzzylite\fl\term\SShape.h" />
<ClInclude Include="fuzzylite\fl\term\Term.h" />
<ClInclude Include="fuzzylite\fl\term\Trapezoid.h" />
<ClInclude Include="fuzzylite\fl\term\Triangle.h" />
<ClInclude Include="fuzzylite\fl\term\ZShape.h" />
<ClInclude Include="fuzzylite\fl\variable\InputVariable.h" />
<ClInclude Include="fuzzylite\fl\variable\OutputVariable.h" />
<ClInclude Include="fuzzylite\fl\variable\Variable.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="fuzzylite\src\Console.cpp" />
<ClCompile Include="fuzzylite\src\defuzzifier\Bisector.cpp" />
<ClCompile Include="fuzzylite\src\defuzzifier\Centroid.cpp" />
<ClCompile Include="fuzzylite\src\defuzzifier\IntegralDefuzzifier.cpp" />
<ClCompile Include="fuzzylite\src\defuzzifier\LargestOfMaximum.cpp" />
<ClCompile Include="fuzzylite\src\defuzzifier\MeanOfMaximum.cpp" />
<ClCompile Include="fuzzylite\src\defuzzifier\SmallestOfMaximum.cpp" />
<ClCompile Include="fuzzylite\src\defuzzifier\WeightedAverage.cpp" />
<ClCompile Include="fuzzylite\src\defuzzifier\WeightedDefuzzifier.cpp" />
<ClCompile Include="fuzzylite\src\defuzzifier\WeightedSum.cpp" />
<ClCompile Include="fuzzylite\src\Engine.cpp" />
<ClCompile Include="fuzzylite\src\Exception.cpp" />
<ClCompile Include="fuzzylite\src\factory\CloningFactory.cpp" />
<ClCompile Include="fuzzylite\src\factory\ConstructionFactory.cpp" />
<ClCompile Include="fuzzylite\src\factory\DefuzzifierFactory.cpp" />
<ClCompile Include="fuzzylite\src\factory\FactoryManager.cpp" />
<ClCompile Include="fuzzylite\src\factory\FunctionFactory.cpp" />
<ClCompile Include="fuzzylite\src\factory\HedgeFactory.cpp" />
<ClCompile Include="fuzzylite\src\factory\SNormFactory.cpp" />
<ClCompile Include="fuzzylite\src\factory\TermFactory.cpp" />
<ClCompile Include="fuzzylite\src\factory\TNormFactory.cpp" />
<ClCompile Include="fuzzylite\src\fuzzylite.cpp" />
<ClCompile Include="fuzzylite\src\hedge\Any.cpp" />
<ClCompile Include="fuzzylite\src\hedge\Extremely.cpp" />
<ClCompile Include="fuzzylite\src\hedge\Not.cpp" />
<ClCompile Include="fuzzylite\src\hedge\Seldom.cpp" />
<ClCompile Include="fuzzylite\src\hedge\Somewhat.cpp" />
<ClCompile Include="fuzzylite\src\hedge\Very.cpp" />
<ClCompile Include="fuzzylite\src\imex\CppExporter.cpp" />
<ClCompile Include="fuzzylite\src\imex\Exporter.cpp" />
<ClCompile Include="fuzzylite\src\imex\FclExporter.cpp" />
<ClCompile Include="fuzzylite\src\imex\FclImporter.cpp" />
<ClCompile Include="fuzzylite\src\imex\FisExporter.cpp" />
<ClCompile Include="fuzzylite\src\imex\FisImporter.cpp" />
<ClCompile Include="fuzzylite\src\imex\FldExporter.cpp" />
<ClCompile Include="fuzzylite\src\imex\FllExporter.cpp" />
<ClCompile Include="fuzzylite\src\imex\FllImporter.cpp" />
<ClCompile Include="fuzzylite\src\imex\Importer.cpp" />
<ClCompile Include="fuzzylite\src\imex\JavaExporter.cpp" />
<ClCompile Include="fuzzylite\src\main.cpp" />
<ClCompile Include="fuzzylite\src\norm\s\AlgebraicSum.cpp" />
<ClCompile Include="fuzzylite\src\norm\s\BoundedSum.cpp" />
<ClCompile Include="fuzzylite\src\norm\s\DrasticSum.cpp" />
<ClCompile Include="fuzzylite\src\norm\s\EinsteinSum.cpp" />
<ClCompile Include="fuzzylite\src\norm\s\HamacherSum.cpp" />
<ClCompile Include="fuzzylite\src\norm\s\Maximum.cpp" />
<ClCompile Include="fuzzylite\src\norm\s\NilpotentMaximum.cpp" />
<ClCompile Include="fuzzylite\src\norm\s\NormalizedSum.cpp" />
<ClCompile Include="fuzzylite\src\norm\t\AlgebraicProduct.cpp" />
<ClCompile Include="fuzzylite\src\norm\t\BoundedDifference.cpp" />
<ClCompile Include="fuzzylite\src\norm\t\DrasticProduct.cpp" />
<ClCompile Include="fuzzylite\src\norm\t\EinsteinProduct.cpp" />
<ClCompile Include="fuzzylite\src\norm\t\HamacherProduct.cpp" />
<ClCompile Include="fuzzylite\src\norm\t\Minimum.cpp" />
<ClCompile Include="fuzzylite\src\norm\t\NilpotentMinimum.cpp" />
<ClCompile Include="fuzzylite\src\Operation.cpp" />
<ClCompile Include="fuzzylite\src\rule\Antecedent.cpp" />
<ClCompile Include="fuzzylite\src\rule\Consequent.cpp" />
<ClCompile Include="fuzzylite\src\rule\Expression.cpp" />
<ClCompile Include="fuzzylite\src\rule\Rule.cpp" />
<ClCompile Include="fuzzylite\src\rule\RuleBlock.cpp" />
<ClCompile Include="fuzzylite\src\term\Accumulated.cpp" />
<ClCompile Include="fuzzylite\src\term\Activated.cpp" />
<ClCompile Include="fuzzylite\src\term\Bell.cpp" />
<ClCompile Include="fuzzylite\src\term\Concave.cpp" />
<ClCompile Include="fuzzylite\src\term\Constant.cpp" />
<ClCompile Include="fuzzylite\src\term\Cosine.cpp" />
<ClCompile Include="fuzzylite\src\term\Discrete.cpp" />
<ClCompile Include="fuzzylite\src\term\Function.cpp" />
<ClCompile Include="fuzzylite\src\term\Gaussian.cpp" />
<ClCompile Include="fuzzylite\src\term\GaussianProduct.cpp" />
<ClCompile Include="fuzzylite\src\term\Linear.cpp" />
<ClCompile Include="fuzzylite\src\term\PiShape.cpp" />
<ClCompile Include="fuzzylite\src\term\Ramp.cpp" />
<ClCompile Include="fuzzylite\src\term\Rectangle.cpp" />
<ClCompile Include="fuzzylite\src\term\Sigmoid.cpp" />
<ClCompile Include="fuzzylite\src\term\SigmoidDifference.cpp" />
<ClCompile Include="fuzzylite\src\term\SigmoidProduct.cpp" />
<ClCompile Include="fuzzylite\src\term\Spike.cpp" />
<ClCompile Include="fuzzylite\src\term\SShape.cpp" />
<ClCompile Include="fuzzylite\src\term\Term.cpp" />
<ClCompile Include="fuzzylite\src\term\Trapezoid.cpp" />
<ClCompile Include="fuzzylite\src\term\Triangle.cpp" />
<ClCompile Include="fuzzylite\src\term\ZShape.cpp" />
<ClCompile Include="fuzzylite\src\variable\InputVariable.cpp" />
<ClCompile Include="fuzzylite\src\variable\OutputVariable.cpp" />
<ClCompile Include="fuzzylite\src\variable\Variable.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D15B34EC-A32C-4968-9B0B-66998B579364}</ProjectGuid>
<RootNamespace>FuzzyLite</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\VCMI_global_debug.props" />
<Import Project="..\..\VCMI_global.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\VCMI_global_debug.props" />
<Import Project="..\..\VCMI_global.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\VCMI_global_release.props" />
<Import Project="..\..\VCMI_global.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\VCMI_global_release.props" />
<Import Project="..\..\VCMI_global.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(VCMI_Out)\AI\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(VCMI_Out)\AI\</OutDir>
<IncludePath>$(IncludePath)</IncludePath>
<LibraryPath>$(LibraryPath)</LibraryPath>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'">
<OutDir>..</OutDir>
<IncludePath>$(SolutionDir)\AI\FuzzyLite\fuzzylite;$(IncludePath)</IncludePath>
<LibraryPath>$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'">
<OutDir>$(VCMI_Out)\AI\</OutDir>
<IncludePath>$(IncludePath)</IncludePath>
<LibraryPath>$(LibraryPath)</LibraryPath>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile />
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir)..;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<OutputFile>$(OutDir)FuzzyLite.dll</OutputFile>
</Link>
<ClCompile>
<AdditionalIncludeDirectories>./fuzzylite;.</AdditionalIncludeDirectories>
<PreprocessorDefinitions>FL_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Lib>
<AdditionalDependencies>Dbghelp.lib</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile />
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir)..;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<OutputFile>$(OutDir)FuzzyLite.dll</OutputFile>
</Link>
<ClCompile>
<PreprocessorDefinitions>FL_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'">
<ClCompile />
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir)..;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<OutputFile>$(OutDir)FuzzyLite.dll</OutputFile>
</Link>
<ClCompile>
<AdditionalIncludeDirectories>./fuzzylite;.</AdditionalIncludeDirectories>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>StdInc.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>FL_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Lib>
<AdditionalDependencies>Dbghelp.lib</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'">
<ClCompile />
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir)..;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<OutputFile>$(OutDir)FuzzyLite.dll</OutputFile>
</Link>
<ClCompile>
<PreprocessorDefinitions>FL_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,32 +0,0 @@
INSTALL
=======
(1) Make sure you uninstall previous versions of fuzzylite from your computer.
(2) The following building script is available in folder `fuzzylite/fuzzylite/`:
```
#In Windows,
> build.bat help
Usage: build.bat [options]
where [options] can be any of the following:
all builds fuzzylite in debug and release mode (default)
debug builds fuzzylite in debug mode
release builds fuzzylite in release mode
clean erases previous builds
help shows this information
#In Unix, from fuzzylite/fuzzylite
$ ./build.sh help
Usage: [bash] ./build.sh [options]
where [options] can be any of the following:
all builds fuzzylite in debug and release mode (default)
debug builds fuzzylite in debug mode
release builds fuzzylite in release mode
clean erases previous builds
help shows this information
```
(3) After executing the script, the binaries will be built and stored in sub-folders `release/bin` and `debug/bin`
For more advanced building options, please check the contents of `fuzzylite/fuzzylite/build.[bat|sh]` and the contents of `fuzzylite/fuzzylite/CMakeLists.txt`.

View File

@ -1,165 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@ -1,317 +0,0 @@
Extracted from [README.md](/README.md)
================================================
### <a name="features">Features</a>
**Controllers** *Types* (5) Mamdani, Takagi-Sugeno, Larsen, Tsukamoto, Inverse Tsukamoto
**Linguistic terms** *Basic* (4) triangle, trapezoid, rectangle, discrete. *Extended* (9) bell, cosine, gaussian, gaussian product, pi-shape, sigmoid difference, sigmoid product, spike. *Edges* (4) concave, ramp, sigmoid, s-shape, z-shape. *Functions* (3) constant, linear, function.
**Conjunction and Activation** *T-Norm* (7) minimum, algebraic product, bounded difference, drastic product, einstein product, hamacher product, nilpotent minimum.
**Disjunction and Accumulation** *S-Norm* (8) maximum, algebraic sum, bounded sum, normalized sum, drastic sum, einstein sum, hamacher sum, nilpotent maximum.
**Defuzzifiers** *Integral* (5) centroid, bisector, smallest of maximum, largest of maximum, mean of maximum, *Weighted* (2) weighted average, weighted sum.
**Hedges** *Types* (6) any, not, extremely, seldom, somewhat, very.
**Import** *Types* (3) FuzzyLite Language `fll`, Fuzzy Inference System `fis`, Fuzzy Control Language `fcl`.
**Export** *Types* (6) `C++`, `Java`, FuzzyLite Language `fll`, FuzzyLite Dataset `fld`, Fuzzy Inference System `fis`, Fuzzy Control Language `fcl`.
**Examples** (30+) of Mamdani, Takagi-Sugeno and Tsukamoto controllers from `fuzzylite`, Octave and Matlab, each included in the following formats: `C++`, `Java`, `fll`, `fld`, `fis`, and `fcl`.
***
### <a name="example">Example</a>
```cpp
#include "fl/Headers.h"
int main(int argc, char* argv[]){
using namespace fl;
Engine* engine = new Engine("simple-dimmer");
InputVariable* ambient = new InputVariable;
ambient->setName("Ambient");
ambient->setRange(0.000, 1.000);
ambient->addTerm(new Triangle("DARK", 0.000, 0.500));
ambient->addTerm(new Triangle("MEDIUM", 0.250, 0.750));
ambient->addTerm(new Triangle("BRIGHT", 0.500, 1.000));
engine->addInputVariable(ambient);
OutputVariable* power = new OutputVariable;
power->setName("Power");
power->setRange(0.000, 2.000);
power->setDefaultValue(fl::nan);
power->addTerm(new Triangle("LOW", 0.000, 1.000));
power->addTerm(new Triangle("MEDIUM", 0.500, 1.500));
power->addTerm(new Triangle("HIGH", 1.000, 2.000));
engine->addOutputVariable(power);
RuleBlock* ruleblock = new RuleBlock;
ruleblock->addRule(Rule::parse("if Ambient is DARK then Power is HIGH", engine));
ruleblock->addRule(Rule::parse("if Ambient is MEDIUM then Power is MEDIUM", engine));
ruleblock->addRule(Rule::parse("if Ambient is BRIGHT then Power is LOW", engine));
engine->addRuleBlock(ruleblock);
engine->configure("", "", "Minimum", "Maximum", "Centroid");
std::string status;
if (not engine->isReady(&status))
throw Exception("Engine not ready. "
"The following errors were encountered:\n" + status, FL_AT);
for (int i = 0; i < 50; ++i){
scalar light = ambient->getMinimum() + i * (ambient->range() / 50);
ambient->setInputValue(light);
engine->process();
FL_LOG("Ambient.input = " << Op::str(light) << " -> " <<
"Power.output = " << Op::str(power->getOutputValue()));
}
}
```
***
### <a name="whatsnew">What's New?</a>
The entire `fuzzylite` library has been thoroughly revised, refactored, validated, and significantly improved. The following sections detail the changes and enhancements of version 5.0. Users of previous versions are **strongly** encouraged to carefully read the list before migrating to version 5.0. Important changes and enhancements are marked as **(important)**, **(VERY important)** and **(EXTREMELY important)**.
#### <a name="new-general">General</a>
+ **(important)** `fuzzylite v5.0` is dual-licensed under the [GNU LGPL v3.0](https://www.gnu.org/licenses/lgpl.html) and a paid commercial license.
+ Support for both `C++98` and `C++11` using the latest features.
+ Support for multiple compilers `g++`, `Clang`, `MSVC`.
+ Refactoring of many classes to improve design and performance.
+ **(important)** Performance improvements of Takagi-Sugeno controllers by over 55% with respect to v4.0 (estimate based on the average performance on the examples included).
+ Smart pointers in many classes take care of automatically deleting objects when setting new pointers (`Accumulated`, `FactoryManager`, `Function`, `OutputVariable`, `Rule`, and `RuleBlock`).
* **(important)** Exceptions are thrown when any of the following `RuleBlock::[conjunction|disjunction|activation]`, `Accumulated::accumulation`, and `OutputVariable::defuzzifier` are required but set to `fl::null`, thereby replacing the operations that would lead to `[signal 11] Segmentation fault` to operations that throw a `fl::Exception` instead.
+ Automatic build script to build `fuzzylite` in `debug` and `release` mode.
+ Binaries of debug libraries are renamed to append the letter `d` (e.g.,`fuzzylited.dll`, `libfuzzylited.so`).
+ **(important)** New file [`fuzzylite/src/m/compare.m`](/fuzzylite/src/m/compare.m) <!---check link--> to compare the output values of your `fuzzylite` engines with the evaluation of the same engine in Octave/Matlab.
+ **(important)** There is practically no difference between the output values obtained with `fuzzylite` and those obtained with Octave/Matlab. Based on the examples, the average mean square error (MSE) between the output values is less than `7.3e-12` (or `0.0000000000073`) due to negligible differences in floating-point arithmetic. The results and comparison can be found in [`examples/examples.mat`](/examples/examples.mat) <!---check link-->.
+ **(important)** Source code of applications based on version 4.0 will most likely not compile with version 5.0.
+ Minor bugs and memory leaks fixed.
####<a name="new-macros">Macros</a>
* **(important)** Added support for `C++11` with smart pointers, method identifiers, move constructors and move operators as follows. For precise information, refer to file [`fuzzylite/fl/fuzzylite.h`](/fuzzylite/fl/fuzzylite.h). <!---check link-->
* **(important)** Macros for identifiers are defined as `FL_IOVERRIDE override`, `FL_IFINAL final`, `FL_IDEFAULT = default`, `FL_IDELETE = delete`, `FL_INOEXCEPT noexcept`, `FL_DEFAULT_COPY(Class)`, `FL_DEFAULT_MOVE(Class)`, and `FL_DEFAULT_COPY_AND_MOVE(Class)`.
* **(important)** Added macro `FL_unique_ptr` to refer to `std::auto_ptr` (`C++98`) or `std::unique_ptr` (`C++11`), and its respective `FL_move_ptr(x)` to move a smart pointer, albeit `FL_move_ptr(x)` is not used within the library as it is not needed.
* **(important)** Added global variables `const long fl::null = 0L` to refer to the null pointer in `C++98` and `const std::nullptr_t null = nullptr` to refer to the null pointer in `C++11`.
* **(important)** Renamed macro `FL_DEBUG` to `FL_DBG`.
* **(important)** Renamed macros `FL_BEGIN_DEBUG_BLOCK` and `FL_END_DEBUG_BLOCK` to `FL_DEBUG_BEGIN` and `FL_DEBUG_END`, respectively.
* **(important)** Renamed macro `FL_EXPORT` to `FL_API`
* **(EXTREMELY important)** Added macro definitions `FL_EXPORT_LIBRARY` and `FL_IMPORT_LIBRARY`. If you are building `fuzzylite` as a **shared library**, you need to define `FL_EXPORT_LIBRARY`. If you are building `fuzzylite` **executable** *and* it utilizes the `fuzzylite` **shared library**, you need to define `FL_IMPORT_LIBRARY`. If you are building `fuzzylite` as a **static library** and/or building `fuzzylite` **executable** using the `fuzzylite` **static library**, then you do not need to define either `FL_[IMPORT|EXPORT]_LIBRARY`. Note that the same conditions apply for your application. This is particularly important in Windows platforms, as `FL_IMPORT_LIBRARY` and `FL_EXPORT_LIBRARY` define `FL_API` to `__declspec(dllimport)` and `__declspec(dllexport)`, respectively. If in doubt, please check [`fuzzylite/CMakeLists.txt`](/fuzzylite/CMakeLists.txt)<!---check link-->
#### <a name="new-operation">Operation</a>
* **(important)** Added method `Operation::toScalar(std::string x, scalar alternative) FL_INOEXCEPT` which returns `alternative` if `x` is not a valid `scalar`, and never throws an exception.
* **(important)** Added method `Operation::toScalar(std::string x)` that returns the scalar value of `x` or throws a `fl::Exception` if `x` is not a valid `scalar`.
* **(VERY important)** Marked method (from v4.0) `Operation::toScalar(std::string, bool, scalar) FL_IDELETE;` and removed its implementation such that its usage is prevented at compile time in `C++11` and at linker time in `C++98`. Please, use the appropriate `Op::toScalar` methods mentioned above.
+ Renamed method `Op::isNan` to `Op::isNaN`.
* Added method `fl::Op::isFinite(x)` which returns `not (isNaN(x) or isInf(x))`.
* Changed `fl::Op::isEq(a,b)` to return `true` if `a == b == NaN`.
* Changed `fl::Op::isEq(a,b)` to return `true` if `a == b == Inf`.
* Changes to `fl::Op::isEq` affect other comparison methods `fl::Op::is[Lt|LEq|GEq|Gt]`.
* Added shortcuts of comparisons `fl::Op::[gt,lt,ge,le,eq,neq](scalar a, scalar b)`, mostly to provide binary versions (without `macheps`) for term `Function`.
* Deleted method `Op::repeat`.
* Removed method `fuzzylite::configuration()`.
* Changed default `fuzzylite::_macheps = 1e-6;`.
* Renamed method `Op::makeValidId` to `Op::validName`, which now returns `"unnamed"` for empty strings.
####<a name="new-engine">Engine</a>
* **(VERY important)** Moved `Engine::hedges` (and relevant methods) to `Rule::hedges`.
* Added enumeration for the type of engine: `enum Engine::Type{Mamdani, Larsen, TakagiSugeno, Tsukamoto, InverseTsukamoto, Hybrid, Unknown}`.
* Added method `Type Engine::type(std::string* name, std::string* reason)` to infer the type of the engine based on its configuration, additionally provides the name of the type and the inference reasons for its type.
* **(important)** Changed method `Engine::isReady(std::string)` to satisfy the default operation of controllers. The method `Engine::isReady(std::string)` was initially conceived to provide information before a potential `[signal 11] Segmentation fault` happened due to improper configuration. However, given the improved handling of signals and exceptions mentioned in Section [General](#new-general), using method `Engine::isReady(std::string)` is not necessary except for providing suggestions of what could potentially cause an error.
* Added methods `Engine::set[Input|Output]Variables(std::vector)` and `Engine::setRuleBlocks(std::vector)`.
* Added methods `Engine::[input|output]Variables()` and `Engine::ruleBlocks()` to return mutable references.
* Added method `Engine::variables()` to retrieve a vector (copy) containing the `InputVariables` followed by the `OutputVariables`.
* Added method `Engine::updateReferences()` to update the references to the engine in all the necessary linguistic terms (i.e., `Linear` and `Function`).
* Added method `Engine::clone()`.
* Added copy constructors, assignment operators, and default move constructor to `Engine`.
####<a name="new-inoutvars">Input Variables and Output Variables</a>
* **(important)** Added methods `OutputVariable::[get|set]OutputValue()` to [retrieve|store] value from defuzzification
* **(important)** Changed return type of `scalar OutputVariable::defuzzify()` to `void OutputVariable::defuzzify()` because now it automatically stores the defuzzified output value, and also stores the previous *valid* output value regardless of locks. Like in version 4.0, if `OutputVariable::lockPreviousOutputValue=true`, and the defuzzified output value is not valid (i.e., `[NaN|Inf]`) or no rules were activated, then the defuzzified output value is replaced for the previous valid output value.
* Removed method `OutputVariable::defuzzifyNoLocks()`.
* Renamed variable `OutputVariable::lastValidOutputValue` to `OutputVariable::previousOutputValue`.
* **(important)** Renamed method `OutputVariable::[get|set]LastValidOutput()` to `OutputVariable::[get|set]PreviousOutputValue()`.
* Renamed variable `OutputVariable::lockValidOutput` to `OutputVariable::lockPreviousOutputValue`.
* **(important)** Renamed method `OutputVariable::setLockValidOutput()` to `OutputVariable::setLockPreviousOutputValue()`.
* **(important)** Renamed method `OutputVariable::isLockingValidOutput()` to `OutputVariable::isLockedPreviousOutputValue()`.
* Renamed variable `OutputVariable::lockOutputRange` to `OutputVariable::lockOutputValueInRange`.
* **(important)** Renamed method `OutputVariable::setLockOutputRange()` to `OutputVariable::setLockOutputValueInRange()`.
* **(important)** Renamed method `OutputVariable::isLockingOutputRange()` to `OutputVariable::isLockedOutputValueInRange()`.
* Added methods `std::string InputVariable::fuzzyInputValue()` and `std::string OutputVariable::fuzzyOutputValue()`.
* Added method `OutputVariable::clear()` to clear the fuzzy output, and set `OutputVariable::previousOutputValue = fl::nan` and set `OutputVariable::outputValue = fl::nan`.
* Added copy constructors, assignment operators, move constructors and move operators to [Input|Output]Variable.
* Added method `Variable::terms()` to return mutable reference.
* **(important)** Changed `OutputVariable::[defuzzifier|fuzzyOutput]` to smart pointers (`FL_unique_ptr`).
#### <a name="new-terms">Linguistic Terms</a>
* **(VERY important)** Added Term::[get|set]Height to define the height of *integral* terms, and multiply their respective membership functions accordingly.
* Added copy constructors, assignment operators, move constructors and move operators to every `Term`.
* **(VERY important)** Parameters of all terms are set by default to `fl::nan`.
* **(important)** Renamed method `Term::copy()` to `Term::clone()` in every `Term`.
* Added method `Term::updateReference(Term*, Engine*)` to ensure `Linear` and `Function` terms have updated pointers to the `Engine` (useful when cloning and copy-constructing).
+ **(important)** Added linguistic terms `Concave`, `Cosine` and `Spike`.
* **(important)** Changed `Accumulated` to take `Activated*` terms instead of `const Terms*`.
* Removed `const` from return type of method `SNorm* Accumulated::[get|set]Accumulation()`.
* Changed `Accumulated::accumulation` to a smart pointer (`FL_unique_ptr`).
* Added method `Accumulated::terms()` to return mutable reference.
* **(important)** Renamed methods `Triangle::[set|get][A|B|C]` to `::[set|get]Vertex[A|B|C]`.
* **(important)** Renamed methods `Trapezoid::[set|get][A|B|C|D]` to `::[set|get]Vertex[A|B|C|D]`.
* **(important)** Renamed term `Thresholded` to `Activated`.
* **(important)** Renamed methods `Thresholded::[set|get]Threshold()` to `Activated::[set|get]Degree()`.
* Added enumeration `[Ramp|Sigmoid]::Direction{ NEGATIVE, ZERO, POSITIVE }` to refer to the slope.
* Added methods `Ramp::direction()` and `Sigmoid::direction()` to retrieve direction of slope.
* Removed Exception Specification from methods in `Discrete`, `Linear` and `Function` terms.
#### <a name="new-linear-discrete">Linear and Discrete Terms</a>
* **(important)** Changed `Linear` from having pointers to the input variables to having a pointer to the `Engine`.
* Changed visibility of `Linear::coefficients` to `protected`.
* **(important)** Added methods `Linear::coefficients()`, `Linear::setCoefficients()`.
* `Linear` term no longer throws exception when `inputVariables != |coefficients|`.
* **(important)** Removed public vector of variables `Discrete::[x|y]`.
* **(important)** Added a `typedef std::pair<scalar, scalar> Discrete::Pair`.
* **(important)** Changed representation of `Discrete::[x|y]` from `std::vector<scalar>` to `std::vector<Discrete::Pair>`.
* Added methods `Discrete::setXY()` and `Discrete::xy()` to set and get the new representation of pairs.
* Added methods `Discrete::xy(int index)` to retrieve `Discrete::Pair` at `index`.
* **(important)** Added methods `Discrete::toPairs(std::vector<scalar>)` which throws an exception if the vector is missing a value (i.e., `std::vector<scalar>.size() % 2 != 0`), and `Discrete::toPairs(std::vector<scalar>, scalar missingValue)` which adds `missingValue` in case `std::vector<scalar>.size() %2 == 1`, hence never throwing an exception.
* Added method `Discrete::toVector(std::vector<Discrete::Pair>)` to convert `std::vector<Discrete::Pair>` to a `std::vector<scalar>`.
* Added method `Discrete::formatXY()` to get pairs `(x,y)` nicely formatted.
####<a name="new-function">Function Term</a>
* **(important)** Merged structs `Function::Operator` and `Function::BuiltInFunction` into a single `struct Function::Element`.
* **(EXTREMELY important)** Changed the precedence of all built-in instances of `Function::Element` of type `Operator` starting from `100` and decreasing by `10`. The precedence of built-in operators is the following: `(100)` Logical not `[!]` and Negation `[~]`; `(90)` Power `[^]`; `(80)` Multiplication `[*]`, Division `[/]` and Modulo `[%]`; `(70)` Addition `[+]` and Subtraction `[-]`; `(60)` Logical AND `[and]` and Logical OR `[or]`. If you have registered your own operators, please adjust their precedence as required.
* Added to `Function` built-in comparison functions `gt,lt,ge,le,eq` and operator logical not `!`.
* Modified typedefs `Function::Unary` and `Function::Binary` to take `scalar` instead of `double`.
* Changed `public Function::root` to `protected Function::_root` and it is now a smart pointer (`FL_unique_ptr`).
* Added method `Function::root()` to return pointer to `Function::root`.
* **(EXTREMELY important)** Moved built-in functions and operators from `Function` to a `FunctionFactory`.
#### <a name="new-norms-hedges">[T|S]Norms and Hedges</a>
+ **(important)** Fixed operation when using multiple hedges to operate from right-most to left-most, e.g. `if Ambient is not very extremely bright`, now evaluates as follows `not(very(extremely(bright)))`.
+ Added `TNorm` nilpotent minimum and `SNorm` nilpotent maximum.
* Added clone methods to every `Norm`.
* Added clone methods to every `Hedge`.
* **(VERY important)** Moved `Engine::hedges` to `Rule::hedges`.
#### <a name="new-rules">Rules</a>
* **(VERY important)** Moved `Engine::hedges` (and methods) to `Rule::hedges`.
* Added method `Rule::isLoaded()` to determine whether a rule was properly parsed and thus can be activated.
* Added method `Rule::unload()` to allow the existence of a rule in an inactive state (useful for invalid rules).
* **(important)** Removed variable `Rule::FL_ASSIGNS` and method `Rule::assignsKeyword()`, for which the symbol `=` in rules is no longer valid.
* Changed visibility of method `Rule::setText()` to `public`.
* Added method `Rule::load(const Engine*)`.
* Changed `Rule::[antecedent|consequent]` to smart pointers (`FL_unique_ptr`).
* **(important)** Renamed method `Antecedent::[get|set]Root()` to `Antecedent::[get|set]Expression()`.
* Added methods `[Antecedent|Consequent]::[get|set]Text()`.
* **(important)** Added methods `[Antecedent|Consequent]::[load|unload]()`, with the same objective as `Rule::[load|unload]()`.
#### <a name="new-ruleblocks">Rule Blocks</a>
* Added method `RuleBlock::reloadRules()`.
* Added method `RuleBlock::setRules(std::vector)`.
* Added method `RuleBlock::rules()` to return mutable reference.
* Removed `const` from `TNorm` and `SNorm` in `RuleBlock::[get|set][Conjunction|Disjunction|Activation]()`, respectively.
* Changed `RuleBlock::[conjunction|disjunction|activation]` to smart pointers (`FL_unique_ptr`).
* **(VERY important)** Added basic rule chaining such that an `OutputVariable` can be utilized in the `Antecedent` of a `Rule`. For example, considering the rule `if Power is high then InversePower is low`, where `Power` and `InversePower` are both output variables, the activation degree of the `Antecedent` will correspond to the accumulated activation degree of the term `high` in the fuzzy output of `Power`. If `Power::accumulation = none`, the accumulated activation degree of the term `high` will be computed as the regular sum of the activation degrees of term `high` in the fuzzy output of `Power`. Otherwise, the accumulated activation degree is computed utilizing the `Power::accumulation` operator.
#### <a name="new-weighted">Weighted Defuzzifiers</a>
+ **(VERY important)** Performance improvements of Takagi-Sugeno controllers by over 55% (with respect to v4.0) based on the average performance on the examples included.
* **(important)** Created class `WeightedDefuzzifier` from which classes `Weighted[Average|Sum]` are derived.
* **(important)** Added enumeration `WeightedDefuzzifier::Type{Automatic, TakagiSugeno, Tsukamoto}` and respective methods `WeightedDefuzzifier::[get|set]Type()` and `WeightedDefuzzifer::getTypeName()`.
* Added method `WeightedDefuzzifier::inferType(Term*)` to automatically determine the `WeightedDefuzzifier::Type` based on the class of `Term`.
* **(important)** By default, `WeightedDefuzzifier::type = Automatic`, which automatically infers the type based on the `WeightedDefuzzifier::inferType()`.
* **(important)** There is a small performance penalty when using `WeightedDefuzzifier::type = Automatic` because `WeightedDefuzzifier::inferType()` performs three `dynamic_cast<>`.
* **(important)** Deleted class `Tsukamoto`. Its method `static tsukamoto()` was moved to `virtual WeightedDefuzzifier::tsukamoto()`, which allows overriding it
* Added support for `Tsukamoto` with `Concave` terms.
+ **(EXTREMELY important)** In version 5.0, the traditional operation of Takagi-Sugeno and Tsukamoto controllers is achieved by setting `OutputVariable::accumulation = none`. Unlike version 4.0, the `RuleBlock::activation` will not have any effect on Takagi-Sugeno nor Tsukamoto controllers, for which `RuleBlock::activation` should also be set to `none`. More information about the roles of the `OutputVariable::accumulation` and `RuleBlock::activation` operators are detailed as follows. Refer to [sciweavers](http://www.sciweavers.org/free-online-latex-equation-editor) to convert LaTeX equations.
+ **(VERY important)** In version 5.0, the role of the `RuleBlock::activation` `TNorm` on the `Weighted[Average|Sum]` always performs a regular multiplication of the weights and the values (i.e., $w_i \times z_j$) regardless of the `TNorm` chosen. In other words, selecting any `RuleBlock::activation` for `Weighted[Average|Sum]` is irrelevant, and should be set to `none` as every `TNorm` will have the same multiplication effect. This operation is different from `fuzzylite` version 4.0, where the `RuleBlock::activation` operator was utilized to multiply the weights and values (i.e. $w_i \otimes z_j$), and therefore the traditional operation of the `Weighted[Average|Sum]` was achieved when `RuleBlock::activation = AlgebraicProduct;`.
+ **(VERY important)** In version 5.0, the role of the `OutputVariable::accumulation = none` on the `Weighted[Average|Sum]` results in a regular sum of the multiplied weights and values, i.e., $\dfrac{\sum_i^n w_i \times z_j}{\sum_i^n w_i}$. However, if the `OutputVariable::accumulation != none`, the role of the `SNorm` will be to accumulate the activation degrees of the *repeated* terms in the fuzzy output of the variable. For example, considering the rules `if Ambient is dark then Power is high` and `if Ambient is medium then Power is high`, for any input value of `Ambient` that activates both rules, the fuzzy output of `Power` will have the term `high` activated with the degree from `Rule 1`, and the term `high` activated with the degree from `Rule 2`. Since the term `high` appears twice in the fuzzy output, the role of the accumulation operator will be to accumulate the activation degree of `high` resulting in $\dfrac{(w_1 \oplus w_2) \times z_{high}}{(w_1 \oplus w_2)}$. If another term were activated, the result would be $\dfrac{(w_1 \oplus w_2) \times z_{high} + w_i \times z_j}{(w_1 \oplus w_2) + w_i}$. In version 4.0, the accumulation operator had no effect on the `Weighted[Average|Sum]`.
#### <a name="new-integral">Integral Defuzzifiers</a>
* **(important)** Proper handling of indefinite integral defuzzification, that is, returning `fl::nan` when `[minimum|maximum]=[NaN|Inf]`.
* Default resolution of integration is defined as `static int IntegralDefuzzifier::defaultResolution=200`, and can be changed via `static IntegralDefuzzifier::setDefaultResolution()`.
+ **(important)** In `fuzzylite`, the accumulation operator has been for several versions associated with the output variables and **not** with the rule blocks, despite that the FCL format and other fuzzy logic control libraries associate the accumulation operator with the rule blocks. The argument for such a decision is that `fuzzylite` provides **coherent** support for multiple rule blocks operating on the same engine and on the same output variables. For example, if multiple rule blocks operate on the same output variables, it only makes sense to have a single accumulation operator associated with each output variable such that the defuzzifier can naturally operate over the accumulated fuzzy output. Differently, if the accumulation operator were associated with the rule block, the possibility of having different accumulation operators in different rule blocks questions (1) **the possibility of having multiple rule blocks operating over the same output variables**; and (2) **the usage of different accumulation operators over the accumulation and defuzzification processes**. Certainly, if (1) is not possible, i.e, different rule blocks only operate on different output variables, then (2) is not a problem because the accumulation process and defuzzification of each variable will only have a single accumulation operator. It is therefore that the association of the accumulation operator with the output variable in `fuzzylite` provides a **better design** and an additional feature that allows having multiple rule blocks operating over the same output variables.
* Added copy constructors, assignment operators, move constructors and move operators.
* Added method `Defuzzifier::clone()`.
####<a name="new-imex">Importers and Exporters</a>
* **(EXTREMELY important)** Since terms have a new `height` property, `[Fll|Fis|Fcl]Exporter` exports terms with an additional `scalar` at the end, which indicates the `height` of the term. However, if `height=1.0`, the additional scalar is not exported.
* **(EXTREMELY important)** In `[Fll|Fis|Fcl]Importer`, when importing terms, if there is an additional `scalar` it will be assumed as the `height` of the term. For example, `term: high Gaussian 1.0 0.5 0.75` will create a `Gaussian` term with mean `1.0`, standard deviation `0.5` and height `0.75`. This is **extremely important** because there are some examples from Matlab in `fis` format that append a useless `0.0` to some terms.
* **(EXTREMELY important)** In `FisExporter`, if the Takagi-Sugeno controller has no `activation` or `accumulation` operators (as it should generally be the case), Octave and Matlab will not be able to import the `fis` file. To overcome this issue, you will have to set `ImpMethod="min"` and `AggMethod="max"`, where `ImpMethod` and `AggMethod` are just dummy operators that can be set to any `TNorm` and `SNorm`, respectively.
+ **(important)** Improved compatibility of the exported code obtained with `[Fis|Fcl]Exporter` by exporting the additional features of `fuzzylite` only when these are different from the default operation. For example, the following features will not be exported given their values: `[Input|Output]Variable::enabled = true;`, `OutputVariable::lock-previous = false;`, `OutputVariable::lock-range = false;`, amongst others.
* **(important)** Renamed FLL property `'lock-valid'` to `'lock-previous'`.
* **(important)** Renamed FIS property `'LockValid'` to `'LockPrevious'`.
* **(important)** Renamed FCL property `'LOCK: VALID'` to `'LOCK: PREVIOUS'`.
+ **(important)** Export your controllers to files using `[Fll|Fld|Fis|Fcl]Exporter::toFile()`.
+ **(important)** Import your controllers from files using `[Fll|Fis|Fcl]Importer::fromFile()`.
+ **(important)** `FldExporter` exports the FuzzyLite Dataset of an engine utilizing the input values of another FuzzyLite Dataset.
* `FldExporter` no longer restarts the engine when exporting.
* **(important)** Renamed method `FldExporter::toWriter()` to `FldExporter::write()`.
* Removed variable and methods for property `int FldExporter::_maximum`.
* Added option in `CppExporter` to prepend the namespace prefix `fl::` to the classes, and by default it does not prepend prefix.
* Improvement accuracy of `FisImporter` when importing `fis` files whose scalar values have more than three decimal numbers.
* Renamed methods in `[Fis|Fcl]Importer::extract*` to `[Fis|Fcl]Importer::parse*`.
#### <a name="new-factories">Factories</a>
* Created a generic `CloningFactory<T>` to create clones of objects.
* **(important)** Created `FunctionFactory` based on `CloningFactory<Function::Element>` where function operators and methods are stored to be cloned as necessary by `Function`. Additional functions and operators can be easily registered.
* **(VERY important)** Moved built-in functions and operators from `Function` to `FunctionFactory`.
* Renamed methods `Factory<T>::[register|deregister]Class()` to `Factory<T>::[register|deregister]Constructor()`.
* **(important)** Renamed `Factory<T>` to `ConstructionFactory<T>`.
* Renamed `typedef Factory::Creator` to `typedef Factory::Constructor`.
* Changed pointers of `FactoryManager` to smart pointers (`FL_unique_ptr`).
#### <a name="new-examples">Examples</a>
* **(important)** Added two examples for basic rule chaining: `mamdani/SimpleDimmerInverse.fll` and `mamdani/Laundry.fll`.
* Included the `original` example files in `fis` format.
* Added conversion of `examples/original/*.fis` to `examples/original/*.fll`.
* Modified `original/takagi-sugeno` examples to reflect `activation: none; accumulation: none;`.
* Updated FLD examples produced from the `original` examples.
+ **(important)** Added file [`fuzzylite/src/m/compare.m`](/fuzzylite/src/m/compare.m) <!---check link--> to compare the output values of your `fuzzylite` engines with the evaluation of the same engine in Octave/Matlab.
+ **(important)** Added file [`examples/examples.mat`](/examples/examples.mat) <!---check link--> containing the comparison of the output values between `fuzzylite` and Matlab's Fuzzy Logic Toolbox.
* Added code to perform benchmarks in Linux.
#### <a name="new-console">Console</a>
* **(important)** Console includes option to import custom input dataset from file an export its respective output values.
* **(important)** Created the FuzzyLite Interactive Console, which can be started by specifying an input file and the output format, e.g., `fuzzylite -i SimpleDimmer.fll -of fld`.
* Console provides more information about its usage.
####<a name="new-fixes"> Fixes Bugs and Leaks</a>
+ **(important)** Fixed operation when using multiple hedges to operate from right-most to left-most, e.g. `if Ambient is not very extremely bright` evaluates as follows `not(very(extremely(bright)))`.
* **(important)** Fixed membership functions of specific cases of `Triangle` when `a=b` or `b=c`, and `Trapezoid` when `a=b` or `c=d`.
* Fixed minor memory leak at `~RuleBlock::[conjunction|disjunction|activation]`.
* Fixed minor memory leak at `~Accumulated::accumulation`.
* Fixed minor memory leak at `~OutputVariable::defuzzifier`.
* Fixed minor memory leak at `~Function::Node`.
* Fixed minor memory leak at `~FactoryManager::[factories]`.
* Fixed some rethrowing of exceptions to provide proper information about errors. Specifically, changed some rethrown exceptions from `throw ex;` to just `throw;`
* Fixed building using `-DFL_USE_FLOAT=ON`
***
For more information, visit [www.fuzzylite.com](http://www.fuzzylite.com).
fuzzylite&trade; is a trademark of FuzzyLite Limited.
Copyright &#xa9; 2010-2014 FuzzyLite Limited. All rights reserved.

View File

@ -1,454 +0,0 @@
fuzzylite &trade; <img src="https://github.com/fuzzylite/fuzzylite/raw/master/fuzzylite.png" align="right" alt="fuzzylite">
===========
A Fuzzy Logic Control Library in C++
------------------------------------
By: [Juan Rada-Vilela](http://www.fuzzylite.com/jcrada), Ph.D.
***
### Table of Contents
[License](#license) &nbsp;
[Introduction](#introduction) &nbsp;
[Features](#features) &nbsp;
[Example](#example) &nbsp;
[What's new](#whatsnew) : [General](#new-general), [Macros](#new-macros), [Operation](#new-operation), [Engine](#new-engine), [Input Variables and Output Variables](#new-inoutvars), [Linguistic Terms](#new-terms), [Linear and Discrete Terms](#new-linear-discrete), [Function Term](#new-function), [[T|S]Norms and Hedges](#new-norms-hedges), [Rules](#new-rules), [Rule Blocks](#new-ruleblocks), [Weighted Defuzzifiers](#new-weighted), [Integral Defuzzifiers](#new-integral), [Importers and Exporters](#new-imex), [Examples](#new-examples), [Console](#new-console), [Fixed Bugs and Leaks](#new-fixes)
[What's next](#whatsnext) &nbsp;
[Migrating to v5.0](#migrating) &nbsp;
[Bulding from source](#building) &nbsp;
[Binaries](#binaries)
### <a name="license">License</a>
`fuzzylite` will **always** be free and open source. However, `fuzzylite` is **no** longer released under the Apache License. Since version 5.0, `fuzzylite` is **dual-licensed** under the [**GNU Lesser General Public License (LGPL) v3.0**](https://www.gnu.org/licenses/lgpl.html) and a **paid commercial license**.
In brief, an important restriction the LGPL imposes on your closed-source application is that **you are no longer allowed to statically link** against `fuzzylite`. If your application requires static linking, **you will need to purchase a commercial license** from FuzzyLite Limited. Please, contact [sales@fuzzylite.com](mailto:sales@fuzzylite.com) for commercial licenses, and refer to the [GNU LGPL](https://www.gnu.org/licenses/lgpl.html) for further information on your rights.
The change of license is an attempt to raise funds in order to be able to work part-time in the development of the `fuzzylite` family of products, namely `fuzzylite` (C++), `jfuzzylite` (Java), `pyfuzzylite` (Python), and `QtFuzzyLite` (Windows/Linux/Mac).
**There are still many things to do!**
Besides [donations](http://www.fuzzylite.com/donations/), you can significantly contribute by **purchasing a license** of the entirely new [`QtFuzzyLite`](http://www.fuzzylite.com/QtFuzzyLite/) commercial application. In addition, if you require (paid) private support, please contact [jcrada@fuzzylite.com](mailto:jcrada@fuzzylite.com).
***
### <a name="introduction">Introduction</a>
`fuzzylite` is a free and open-source fuzzy logic control library programmed in C++ for multiple platforms (Windows, Linux, Mac, iOS). Its goal is to allow you to easily create fuzzy logic controllers in a few steps utilizing object-oriented programming without requiring any third-party libraries.
#### Reference
If you are using `fuzzylite`, please cite the following reference in your article:
Juan Rada-Vilela. fuzzylite: a fuzzy logic control library, 2014. URL http://www.fuzzylite.com.
```bibtex
@misc{fl::fuzzylite,
author={Juan Rada-Vilela},
title={fuzzylite: a fuzzy logic control library},
url={http://www.fuzzylite.com},
year={2014}}
```
***
### <a name="features">Features</a>
**Controllers** *Types* (5) Mamdani, Takagi-Sugeno, Larsen, Tsukamoto, Inverse Tsukamoto
**Linguistic terms** *Basic* (4) triangle, trapezoid, rectangle, discrete. *Extended* (9) bell, cosine, gaussian, gaussian product, pi-shape, sigmoid difference, sigmoid product, spike. *Edges* (4) concave, ramp, sigmoid, s-shape, z-shape. *Functions* (3) constant, linear, function.
**Conjunction and Activation** *T-Norm* (7) minimum, algebraic product, bounded difference, drastic product, einstein product, hamacher product, nilpotent minimum.
**Disjunction and Accumulation** *S-Norm* (8) maximum, algebraic sum, bounded sum, normalized sum, drastic sum, einstein sum, hamacher sum, nilpotent maximum.
**Defuzzifiers** *Integral* (5) centroid, bisector, smallest of maximum, largest of maximum, mean of maximum, *Weighted* (2) weighted average, weighted sum.
**Hedges** *Types* (6) any, not, extremely, seldom, somewhat, very.
**Import** *Types* (3) FuzzyLite Language `fll`, Fuzzy Inference System `fis`, Fuzzy Control Language `fcl`.
**Export** *Types* (6) `C++`, `Java`, FuzzyLite Language `fll`, FuzzyLite Dataset `fld`, Fuzzy Inference System `fis`, Fuzzy Control Language `fcl`.
**Examples** (30+) of Mamdani, Takagi-Sugeno and Tsukamoto controllers from `fuzzylite`, Octave and Matlab, each included in the following formats: `C++`, `Java`, `fll`, `fld`, `fis`, and `fcl`.
***
### <a name="example">Example</a>
```cpp
#include "fl/Headers.h"
int main(int argc, char* argv[]){
using namespace fl;
Engine* engine = new Engine("simple-dimmer");
InputVariable* ambient = new InputVariable;
ambient->setName("Ambient");
ambient->setRange(0.000, 1.000);
ambient->addTerm(new Triangle("DARK", 0.000, 0.500));
ambient->addTerm(new Triangle("MEDIUM", 0.250, 0.750));
ambient->addTerm(new Triangle("BRIGHT", 0.500, 1.000));
engine->addInputVariable(ambient);
OutputVariable* power = new OutputVariable;
power->setName("Power");
power->setRange(0.000, 2.000);
power->setDefaultValue(fl::nan);
power->addTerm(new Triangle("LOW", 0.000, 1.000));
power->addTerm(new Triangle("MEDIUM", 0.500, 1.500));
power->addTerm(new Triangle("HIGH", 1.000, 2.000));
engine->addOutputVariable(power);
RuleBlock* ruleblock = new RuleBlock;
ruleblock->addRule(Rule::parse("if Ambient is DARK then Power is HIGH", engine));
ruleblock->addRule(Rule::parse("if Ambient is MEDIUM then Power is MEDIUM", engine));
ruleblock->addRule(Rule::parse("if Ambient is BRIGHT then Power is LOW", engine));
engine->addRuleBlock(ruleblock);
engine->configure("", "", "Minimum", "Maximum", "Centroid");
std::string status;
if (not engine->isReady(&status))
throw Exception("Engine not ready. "
"The following errors were encountered:\n" + status, FL_AT);
for (int i = 0; i < 50; ++i){
scalar light = ambient->getMinimum() + i * (ambient->range() / 50);
ambient->setInputValue(light);
engine->process();
FL_LOG("Ambient.input = " << Op::str(light) << " -> " <<
"Power.output = " << Op::str(power->getOutputValue()));
}
}
```
***
### <a name="whatsnew">What's New?</a>
The entire `fuzzylite` library has been thoroughly revised, refactored, validated, and significantly improved. The following sections detail the changes and enhancements of version 5.0. Users of previous versions are **strongly** encouraged to carefully read the list before migrating to version 5.0. Important changes and enhancements are marked as **(important)**, **(VERY important)** and **(EXTREMELY important)**.
#### <a name="new-general">General</a>
+ **(important)** `fuzzylite v5.0` is dual-licensed under the [GNU LGPL v3.0](https://www.gnu.org/licenses/lgpl.html) and a paid commercial license.
+ Support for both `C++98` and `C++11` using the latest features.
+ Support for multiple compilers `g++`, `Clang`, `MSVC`.
+ Refactoring of many classes to improve design and performance.
+ **(important)** Performance improvements of Takagi-Sugeno controllers by over 55% with respect to v4.0 (estimate based on the average performance on the examples included).
+ Smart pointers in many classes take care of automatically deleting objects when setting new pointers (`Accumulated`, `FactoryManager`, `Function`, `OutputVariable`, `Rule`, and `RuleBlock`).
* **(important)** Exceptions are thrown when any of the following `RuleBlock::[conjunction|disjunction|activation]`, `Accumulated::accumulation`, and `OutputVariable::defuzzifier` are required but set to `fl::null`, thereby replacing the operations that would lead to `[signal 11] Segmentation fault` to operations that throw a `fl::Exception` instead.
+ Automatic build script to build `fuzzylite` in `debug` and `release` mode.
+ Binaries of debug libraries are renamed to append the letter `d` (e.g.,`fuzzylited.dll`, `libfuzzylited.so`).
+ **(important)** New file [`fuzzylite/src/m/compare.m`](/fuzzylite/src/m/compare.m) <!---check link--> to compare the output values of your `fuzzylite` engines with the evaluation of the same engine in Octave/Matlab.
+ **(important)** There is practically no difference between the output values obtained with `fuzzylite` and those obtained with Octave/Matlab. Based on the examples, the average mean square error (MSE) between the output values is less than `7.3e-12` (or `0.0000000000073`) due to negligible differences in floating-point arithmetic. The results and comparison can be found in [`examples/examples.mat`](/examples/examples.mat) <!---check link-->.
+ **(important)** Source code of applications based on version 4.0 will most likely not compile with version 5.0.
+ Minor bugs and memory leaks fixed.
####<a name="new-macros">Macros</a>
* **(important)** Added support for `C++11` with smart pointers, method identifiers, move constructors and move operators as follows. For precise information, refer to file [`fuzzylite/fl/fuzzylite.h`](/fuzzylite/fl/fuzzylite.h). <!---check link-->
* **(important)** Macros for identifiers are defined as `FL_IOVERRIDE override`, `FL_IFINAL final`, `FL_IDEFAULT = default`, `FL_IDELETE = delete`, `FL_INOEXCEPT noexcept`, `FL_DEFAULT_COPY(Class)`, `FL_DEFAULT_MOVE(Class)`, and `FL_DEFAULT_COPY_AND_MOVE(Class)`.
* **(important)** Added macro `FL_unique_ptr` to refer to `std::auto_ptr` (`C++98`) or `std::unique_ptr` (`C++11`), and its respective `FL_move_ptr(x)` to move a smart pointer, albeit `FL_move_ptr(x)` is not used within the library as it is not needed.
* **(important)** Added global variables `const long fl::null = 0L` to refer to the null pointer in `C++98` and `const std::nullptr_t null = nullptr` to refer to the null pointer in `C++11`.
* **(important)** Renamed macro `FL_DEBUG` to `FL_DBG`.
* **(important)** Renamed macros `FL_BEGIN_DEBUG_BLOCK` and `FL_END_DEBUG_BLOCK` to `FL_DEBUG_BEGIN` and `FL_DEBUG_END`, respectively.
* **(important)** Renamed macro `FL_EXPORT` to `FL_API`
* **(EXTREMELY important)** Added macro definitions `FL_EXPORT_LIBRARY` and `FL_IMPORT_LIBRARY`. If you are building `fuzzylite` as a **shared library**, you need to define `FL_EXPORT_LIBRARY`. If you are building `fuzzylite` **executable** *and* it utilizes the `fuzzylite` **shared library**, you need to define `FL_IMPORT_LIBRARY`. If you are building `fuzzylite` as a **static library** and/or building `fuzzylite` **executable** using the `fuzzylite` **static library**, then you do not need to define either `FL_[IMPORT|EXPORT]_LIBRARY`. Note that the same conditions apply for your application. This is particularly important in Windows platforms, as `FL_IMPORT_LIBRARY` and `FL_EXPORT_LIBRARY` define `FL_API` to `__declspec(dllimport)` and `__declspec(dllexport)`, respectively. If in doubt, please check [`fuzzylite/CMakeLists.txt`](/fuzzylite/CMakeLists.txt)<!---check link-->
#### <a name="new-operation">Operation</a>
* **(important)** Added method `Operation::toScalar(std::string x, scalar alternative) FL_INOEXCEPT` which returns `alternative` if `x` is not a valid `scalar`, and never throws an exception.
* **(important)** Added method `Operation::toScalar(std::string x)` that returns the scalar value of `x` or throws a `fl::Exception` if `x` is not a valid `scalar`.
* **(VERY important)** Marked method (from v4.0) `Operation::toScalar(std::string, bool, scalar) FL_IDELETE;` and removed its implementation such that its usage is prevented at compile time in `C++11` and at linker time in `C++98`. Please, use the appropriate `Op::toScalar` methods mentioned above.
+ Renamed method `Op::isNan` to `Op::isNaN`.
* Added method `fl::Op::isFinite(x)` which returns `not (isNaN(x) or isInf(x))`.
* Changed `fl::Op::isEq(a,b)` to return `true` if `a == b == NaN`.
* Changed `fl::Op::isEq(a,b)` to return `true` if `a == b == Inf`.
* Changes to `fl::Op::isEq` affect other comparison methods `fl::Op::is[Lt|LEq|GEq|Gt]`.
* Added shortcuts of comparisons `fl::Op::[gt,lt,ge,le,eq,neq](scalar a, scalar b)`, mostly to provide binary versions (without `macheps`) for term `Function`.
* Deleted method `Op::repeat`.
* Removed method `fuzzylite::configuration()`.
* Changed default `fuzzylite::_macheps = 1e-6;`.
* Renamed method `Op::makeValidId` to `Op::validName`, which now returns `"unnamed"` for empty strings.
####<a name="new-engine">Engine</a>
* **(VERY important)** Moved `Engine::hedges` (and relevant methods) to `Rule::hedges`.
* Added enumeration for the type of engine: `enum Engine::Type{Mamdani, Larsen, TakagiSugeno, Tsukamoto, InverseTsukamoto, Hybrid, Unknown}`.
* Added method `Type Engine::type(std::string* name, std::string* reason)` to infer the type of the engine based on its configuration, additionally provides the name of the type and the inference reasons for its type.
* **(important)** Changed method `Engine::isReady(std::string)` to satisfy the default operation of controllers. The method `Engine::isReady(std::string)` was initially conceived to provide information before a potential `[signal 11] Segmentation fault` happened due to improper configuration. However, given the improved handling of signals and exceptions mentioned in Section [General](#new-general), using method `Engine::isReady(std::string)` is not necessary except for providing suggestions of what could potentially cause an error.
* Added methods `Engine::set[Input|Output]Variables(std::vector)` and `Engine::setRuleBlocks(std::vector)`.
* Added methods `Engine::[input|output]Variables()` and `Engine::ruleBlocks()` to return mutable references.
* Added method `Engine::variables()` to retrieve a vector (copy) containing the `InputVariables` followed by the `OutputVariables`.
* Added method `Engine::updateReferences()` to update the references to the engine in all the necessary linguistic terms (i.e., `Linear` and `Function`).
* Added method `Engine::clone()`.
* Added copy constructors, assignment operators, and default move constructor to `Engine`.
####<a name="new-inoutvars">Input Variables and Output Variables</a>
* **(important)** Added methods `OutputVariable::[get|set]OutputValue()` to [retrieve|store] value from defuzzification
* **(important)** Changed return type of `scalar OutputVariable::defuzzify()` to `void OutputVariable::defuzzify()` because now it automatically stores the defuzzified output value, and also stores the previous *valid* output value regardless of locks. Like in version 4.0, if `OutputVariable::lockPreviousOutputValue=true`, and the defuzzified output value is not valid (i.e., `[NaN|Inf]`) or no rules were activated, then the defuzzified output value is replaced for the previous valid output value.
* Removed method `OutputVariable::defuzzifyNoLocks()`.
* Renamed variable `OutputVariable::lastValidOutputValue` to `OutputVariable::previousOutputValue`.
* **(important)** Renamed method `OutputVariable::[get|set]LastValidOutput()` to `OutputVariable::[get|set]PreviousOutputValue()`.
* Renamed variable `OutputVariable::lockValidOutput` to `OutputVariable::lockPreviousOutputValue`.
* **(important)** Renamed method `OutputVariable::setLockValidOutput()` to `OutputVariable::setLockPreviousOutputValue()`.
* **(important)** Renamed method `OutputVariable::isLockingValidOutput()` to `OutputVariable::isLockedPreviousOutputValue()`.
* Renamed variable `OutputVariable::lockOutputRange` to `OutputVariable::lockOutputValueInRange`.
* **(important)** Renamed method `OutputVariable::setLockOutputRange()` to `OutputVariable::setLockOutputValueInRange()`.
* **(important)** Renamed method `OutputVariable::isLockingOutputRange()` to `OutputVariable::isLockedOutputValueInRange()`.
* Added methods `std::string InputVariable::fuzzyInputValue()` and `std::string OutputVariable::fuzzyOutputValue()`.
* Added method `OutputVariable::clear()` to clear the fuzzy output, and set `OutputVariable::previousOutputValue = fl::nan` and set `OutputVariable::outputValue = fl::nan`.
* Added copy constructors, assignment operators, move constructors and move operators to [Input|Output]Variable.
* Added method `Variable::terms()` to return mutable reference.
* **(important)** Changed `OutputVariable::[defuzzifier|fuzzyOutput]` to smart pointers (`FL_unique_ptr`).
#### <a name="new-terms">Linguistic Terms</a>
* **(VERY important)** Added Term::[get|set]Height to define the height of *integral* terms, and multiply their respective membership functions accordingly.
* Added copy constructors, assignment operators, move constructors and move operators to every `Term`.
* **(VERY important)** Parameters of all terms are set by default to `fl::nan`.
* **(important)** Renamed method `Term::copy()` to `Term::clone()` in every `Term`.
* Added method `Term::updateReference(Term*, Engine*)` to ensure `Linear` and `Function` terms have updated pointers to the `Engine` (useful when cloning and copy-constructing).
+ **(important)** Added linguistic terms `Concave`, `Cosine` and `Spike`.
* **(important)** Changed `Accumulated` to take `Activated*` terms instead of `const Terms*`.
* Removed `const` from return type of method `SNorm* Accumulated::[get|set]Accumulation()`.
* Changed `Accumulated::accumulation` to a smart pointer (`FL_unique_ptr`).
* Added method `Accumulated::terms()` to return mutable reference.
* **(important)** Renamed methods `Triangle::[set|get][A|B|C]` to `::[set|get]Vertex[A|B|C]`.
* **(important)** Renamed methods `Trapezoid::[set|get][A|B|C|D]` to `::[set|get]Vertex[A|B|C|D]`.
* **(important)** Renamed term `Thresholded` to `Activated`.
* **(important)** Renamed methods `Thresholded::[set|get]Threshold()` to `Activated::[set|get]Degree()`.
* Added enumeration `[Ramp|Sigmoid]::Direction{ NEGATIVE, ZERO, POSITIVE }` to refer to the slope.
* Added methods `Ramp::direction()` and `Sigmoid::direction()` to retrieve direction of slope.
* Removed Exception Specification from methods in `Discrete`, `Linear` and `Function` terms.
#### <a name="new-linear-discrete">Linear and Discrete Terms</a>
* **(important)** Changed `Linear` from having pointers to the input variables to having a pointer to the `Engine`.
* Changed visibility of `Linear::coefficients` to `protected`.
* **(important)** Added methods `Linear::coefficients()`, `Linear::setCoefficients()`.
* `Linear` term no longer throws exception when `inputVariables != |coefficients|`.
* **(important)** Removed public vector of variables `Discrete::[x|y]`.
* **(important)** Added a `typedef std::pair<scalar, scalar> Discrete::Pair`.
* **(important)** Changed representation of `Discrete::[x|y]` from `std::vector<scalar>` to `std::vector<Discrete::Pair>`.
* Added methods `Discrete::setXY()` and `Discrete::xy()` to set and get the new representation of pairs.
* Added methods `Discrete::xy(int index)` to retrieve `Discrete::Pair` at `index`.
* **(important)** Added methods `Discrete::toPairs(std::vector<scalar>)` which throws an exception if the vector is missing a value (i.e., `std::vector<scalar>.size() % 2 != 0`), and `Discrete::toPairs(std::vector<scalar>, scalar missingValue)` which adds `missingValue` in case `std::vector<scalar>.size() %2 == 1`, hence never throwing an exception.
* Added method `Discrete::toVector(std::vector<Discrete::Pair>)` to convert `std::vector<Discrete::Pair>` to a `std::vector<scalar>`.
* Added method `Discrete::formatXY()` to get pairs `(x,y)` nicely formatted.
####<a name="new-function">Function Term</a>
* **(important)** Merged structs `Function::Operator` and `Function::BuiltInFunction` into a single `struct Function::Element`.
* **(EXTREMELY important)** Changed the precedence of all built-in instances of `Function::Element` of type `Operator` starting from `100` and decreasing by `10`. The precedence of built-in operators is the following: `(100)` Logical not `[!]` and Negation `[~]`; `(90)` Power `[^]`; `(80)` Multiplication `[*]`, Division `[/]` and Modulo `[%]`; `(70)` Addition `[+]` and Subtraction `[-]`; `(60)` Logical AND `[and]` and Logical OR `[or]`. If you have registered your own operators, please adjust their precedence as required.
* Added to `Function` built-in comparison functions `gt,lt,ge,le,eq` and operator logical not `!`.
* Modified typedefs `Function::Unary` and `Function::Binary` to take `scalar` instead of `double`.
* Changed `public Function::root` to `protected Function::_root` and it is now a smart pointer (`FL_unique_ptr`).
* Added method `Function::root()` to return pointer to `Function::root`.
* **(EXTREMELY important)** Moved built-in functions and operators from `Function` to a `FunctionFactory`.
#### <a name="new-norms-hedges">[T|S]Norms and Hedges</a>
+ **(important)** Fixed operation when using multiple hedges to operate from right-most to left-most, e.g. `if Ambient is not very extremely bright`, now evaluates as follows `not(very(extremely(bright)))`.
+ Added `TNorm` nilpotent minimum and `SNorm` nilpotent maximum.
* Added clone methods to every `Norm`.
* Added clone methods to every `Hedge`.
* **(VERY important)** Moved `Engine::hedges` to `Rule::hedges`.
#### <a name="new-rules">Rules</a>
* **(VERY important)** Moved `Engine::hedges` (and methods) to `Rule::hedges`.
* Added method `Rule::isLoaded()` to determine whether a rule was properly parsed and thus can be activated.
* Added method `Rule::unload()` to allow the existence of a rule in an inactive state (useful for invalid rules).
* **(important)** Removed variable `Rule::FL_ASSIGNS` and method `Rule::assignsKeyword()`, for which the symbol `=` in rules is no longer valid.
* Changed visibility of method `Rule::setText()` to `public`.
* Added method `Rule::load(const Engine*)`.
* Changed `Rule::[antecedent|consequent]` to smart pointers (`FL_unique_ptr`).
* **(important)** Renamed method `Antecedent::[get|set]Root()` to `Antecedent::[get|set]Expression()`.
* Added methods `[Antecedent|Consequent]::[get|set]Text()`.
* **(important)** Added methods `[Antecedent|Consequent]::[load|unload]()`, with the same objective as `Rule::[load|unload]()`.
#### <a name="new-ruleblocks">Rule Blocks</a>
* Added method `RuleBlock::reloadRules()`.
* Added method `RuleBlock::setRules(std::vector)`.
* Added method `RuleBlock::rules()` to return mutable reference.
* Removed `const` from `TNorm` and `SNorm` in `RuleBlock::[get|set][Conjunction|Disjunction|Activation]()`, respectively.
* Changed `RuleBlock::[conjunction|disjunction|activation]` to smart pointers (`FL_unique_ptr`).
* **(VERY important)** Added basic rule chaining such that an `OutputVariable` can be utilized in the `Antecedent` of a `Rule`. For example, considering the rule `if Power is high then InversePower is low`, where `Power` and `InversePower` are both output variables, the activation degree of the `Antecedent` will correspond to the accumulated activation degree of the term `high` in the fuzzy output of `Power`. If `Power::accumulation = none`, the accumulated activation degree of the term `high` will be computed as the regular sum of the activation degrees of term `high` in the fuzzy output of `Power`. Otherwise, the accumulated activation degree is computed utilizing the `Power::accumulation` operator.
#### <a name="new-weighted">Weighted Defuzzifiers</a>
+ **(VERY important)** Performance improvements of Takagi-Sugeno controllers by over 55% (with respect to v4.0) based on the average performance on the examples included.
* **(important)** Created class `WeightedDefuzzifier` from which classes `Weighted[Average|Sum]` are derived.
* **(important)** Added enumeration `WeightedDefuzzifier::Type{Automatic, TakagiSugeno, Tsukamoto}` and respective methods `WeightedDefuzzifier::[get|set]Type()` and `WeightedDefuzzifer::getTypeName()`.
* Added method `WeightedDefuzzifier::inferType(Term*)` to automatically determine the `WeightedDefuzzifier::Type` based on the class of `Term`.
* **(important)** By default, `WeightedDefuzzifier::type = Automatic`, which automatically infers the type based on the `WeightedDefuzzifier::inferType()`.
* **(important)** There is a small performance penalty when using `WeightedDefuzzifier::type = Automatic` because `WeightedDefuzzifier::inferType()` performs three `dynamic_cast<>`.
* **(important)** Deleted class `Tsukamoto`. Its method `static tsukamoto()` was moved to `virtual WeightedDefuzzifier::tsukamoto()`, which allows overriding it
* Added support for `Tsukamoto` with `Concave` terms.
+ **(EXTREMELY important)** In version 5.0, the traditional operation of Takagi-Sugeno and Tsukamoto controllers is achieved by setting `OutputVariable::accumulation = none`. Unlike version 4.0, the `RuleBlock::activation` will not have any effect on Takagi-Sugeno nor Tsukamoto controllers, for which `RuleBlock::activation` should also be set to `none`. More information about the roles of the `OutputVariable::accumulation` and `RuleBlock::activation` operators are detailed as follows. Refer to [sciweavers](http://www.sciweavers.org/free-online-latex-equation-editor) to convert LaTeX equations.
+ **(VERY important)** In version 5.0, the role of the `RuleBlock::activation` `TNorm` on the `Weighted[Average|Sum]` always performs a regular multiplication of the weights and the values (i.e., $w_i \times z_j$) regardless of the `TNorm` chosen. In other words, selecting any `RuleBlock::activation` for `Weighted[Average|Sum]` is irrelevant, and should be set to `none` as every `TNorm` will have the same multiplication effect. This operation is different from `fuzzylite` version 4.0, where the `RuleBlock::activation` operator was utilized to multiply the weights and values (i.e. $w_i \otimes z_j$), and therefore the traditional operation of the `Weighted[Average|Sum]` was achieved when `RuleBlock::activation = AlgebraicProduct;`.
+ **(VERY important)** In version 5.0, the role of the `OutputVariable::accumulation = none` on the `Weighted[Average|Sum]` results in a regular sum of the multiplied weights and values, i.e., $\dfrac{\sum_i^n w_i \times z_j}{\sum_i^n w_i}$. However, if the `OutputVariable::accumulation != none`, the role of the `SNorm` will be to accumulate the activation degrees of the *repeated* terms in the fuzzy output of the variable. For example, considering the rules `if Ambient is dark then Power is high` and `if Ambient is medium then Power is high`, for any input value of `Ambient` that activates both rules, the fuzzy output of `Power` will have the term `high` activated with the degree from `Rule 1`, and the term `high` activated with the degree from `Rule 2`. Since the term `high` appears twice in the fuzzy output, the role of the accumulation operator will be to accumulate the activation degree of `high` resulting in $\dfrac{(w_1 \oplus w_2) \times z_{high}}{(w_1 \oplus w_2)}$. If another term were activated, the result would be $\dfrac{(w_1 \oplus w_2) \times z_{high} + w_i \times z_j}{(w_1 \oplus w_2) + w_i}$. In version 4.0, the accumulation operator had no effect on the `Weighted[Average|Sum]`.
#### <a name="new-integral">Integral Defuzzifiers</a>
* **(important)** Proper handling of indefinite integral defuzzification, that is, returning `fl::nan` when `[minimum|maximum]=[NaN|Inf]`.
* Default resolution of integration is defined as `static int IntegralDefuzzifier::defaultResolution=200`, and can be changed via `static IntegralDefuzzifier::setDefaultResolution()`.
+ **(important)** In `fuzzylite`, the accumulation operator has been for several versions associated with the output variables and **not** with the rule blocks, despite that the FCL format and other fuzzy logic control libraries associate the accumulation operator with the rule blocks. The argument for such a decision is that `fuzzylite` provides **coherent** support for multiple rule blocks operating on the same engine and on the same output variables. For example, if multiple rule blocks operate on the same output variables, it only makes sense to have a single accumulation operator associated with each output variable such that the defuzzifier can naturally operate over the accumulated fuzzy output. Differently, if the accumulation operator were associated with the rule block, the possibility of having different accumulation operators in different rule blocks questions (1) **the possibility of having multiple rule blocks operating over the same output variables**; and (2) **the usage of different accumulation operators over the accumulation and defuzzification processes**. Certainly, if (1) is not possible, i.e, different rule blocks only operate on different output variables, then (2) is not a problem because the accumulation process and defuzzification of each variable will only have a single accumulation operator. It is therefore that the association of the accumulation operator with the output variable in `fuzzylite` provides a **better design** and an additional feature that allows having multiple rule blocks operating over the same output variables.
* Added copy constructors, assignment operators, move constructors and move operators.
* Added method `Defuzzifier::clone()`.
####<a name="new-imex">Importers and Exporters</a>
* **(EXTREMELY important)** Since terms have a new `height` property, `[Fll|Fis|Fcl]Exporter` exports terms with an additional `scalar` at the end, which indicates the `height` of the term. However, if `height=1.0`, the additional scalar is not exported.
* **(EXTREMELY important)** In `[Fll|Fis|Fcl]Importer`, when importing terms, if there is an additional `scalar` it will be assumed as the `height` of the term. For example, `term: high Gaussian 1.0 0.5 0.75` will create a `Gaussian` term with mean `1.0`, standard deviation `0.5` and height `0.75`. This is **extremely important** because there are some examples from Matlab in `fis` format that append a useless `0.0` to some terms.
* **(EXTREMELY important)** In `FisExporter`, if the Takagi-Sugeno controller has no `activation` or `accumulation` operators (as it should generally be the case), Octave and Matlab will not be able to import the `fis` file. To overcome this issue, you will have to set `ImpMethod="min"` and `AggMethod="max"`, where `ImpMethod` and `AggMethod` are just dummy operators that can be set to any `TNorm` and `SNorm`, respectively.
+ **(important)** Improved compatibility of the exported code obtained with `[Fis|Fcl]Exporter` by exporting the additional features of `fuzzylite` only when these are different from the default operation. For example, the following features will not be exported given their values: `[Input|Output]Variable::enabled = true;`, `OutputVariable::lock-previous = false;`, `OutputVariable::lock-range = false;`, amongst others.
* **(important)** Renamed FLL property `'lock-valid'` to `'lock-previous'`.
* **(important)** Renamed FIS property `'LockValid'` to `'LockPrevious'`.
* **(important)** Renamed FCL property `'LOCK: VALID'` to `'LOCK: PREVIOUS'`.
+ **(important)** Export your controllers to files using `[Fll|Fld|Fis|Fcl]Exporter::toFile()`.
+ **(important)** Import your controllers from files using `[Fll|Fis|Fcl]Importer::fromFile()`.
+ **(important)** `FldExporter` exports the FuzzyLite Dataset of an engine utilizing the input values of another FuzzyLite Dataset.
* `FldExporter` no longer restarts the engine when exporting.
* **(important)** Renamed method `FldExporter::toWriter()` to `FldExporter::write()`.
* Removed variable and methods for property `int FldExporter::_maximum`.
* Added option in `CppExporter` to prepend the namespace prefix `fl::` to the classes, and by default it does not prepend prefix.
* Improvement accuracy of `FisImporter` when importing `fis` files whose scalar values have more than three decimal numbers.
* Renamed methods in `[Fis|Fcl]Importer::extract*` to `[Fis|Fcl]Importer::parse*`.
#### <a name="new-factories">Factories</a>
* Created a generic `CloningFactory<T>` to create clones of objects.
* **(important)** Created `FunctionFactory` based on `CloningFactory<Function::Element>` where function operators and methods are stored to be cloned as necessary by `Function`. Additional functions and operators can be easily registered.
* **(VERY important)** Moved built-in functions and operators from `Function` to `FunctionFactory`.
* Renamed methods `Factory<T>::[register|deregister]Class()` to `Factory<T>::[register|deregister]Constructor()`.
* **(important)** Renamed `Factory<T>` to `ConstructionFactory<T>`.
* Renamed `typedef Factory::Creator` to `typedef Factory::Constructor`.
* Changed pointers of `FactoryManager` to smart pointers (`FL_unique_ptr`).
#### <a name="new-examples">Examples</a>
* **(important)** Added two examples for basic rule chaining: `mamdani/SimpleDimmerInverse.fll` and `mamdani/Laundry.fll`.
* Included the `original` example files in `fis` format.
* Added conversion of `examples/original/*.fis` to `examples/original/*.fll`.
* Modified `original/takagi-sugeno` examples to reflect `activation: none; accumulation: none;`.
* Updated FLD examples produced from the `original` examples.
+ **(important)** Added file [`fuzzylite/src/m/compare.m`](/fuzzylite/src/m/compare.m) <!---check link--> to compare the output values of your `fuzzylite` engines with the evaluation of the same engine in Octave/Matlab.
+ **(important)** Added file [`examples/examples.mat`](/examples/examples.mat) <!---check link--> containing the comparison of the output values between `fuzzylite` and Matlab's Fuzzy Logic Toolbox.
* Added code to perform benchmarks in Linux.
#### <a name="new-console">Console</a>
* **(important)** Console includes option to import custom input dataset from file an export its respective output values.
* **(important)** Created the FuzzyLite Interactive Console, which can be started by specifying an input file and the output format, e.g., `fuzzylite -i SimpleDimmer.fll -of fld`.
* Console provides more information about its usage.
####<a name="new-fixes"> Fixes Bugs and Leaks</a>
+ **(important)** Fixed operation when using multiple hedges to operate from right-most to left-most, e.g. `if Ambient is not very extremely bright` evaluates as follows `not(very(extremely(bright)))`.
* **(important)** Fixed membership functions of specific cases of `Triangle` when `a=b` or `b=c`, and `Trapezoid` when `a=b` or `c=d`.
* Fixed minor memory leak at `~RuleBlock::[conjunction|disjunction|activation]`.
* Fixed minor memory leak at `~Accumulated::accumulation`.
* Fixed minor memory leak at `~OutputVariable::defuzzifier`.
* Fixed minor memory leak at `~Function::Node`.
* Fixed minor memory leak at `~FactoryManager::[factories]`.
* Fixed some rethrowing of exceptions to provide proper information about errors. Specifically, changed some rethrown exceptions from `throw ex;` to just `throw;`
* Fixed building using `-DFL_USE_FLOAT=ON`
***
### <a name="whatsnext">What's Next?</a>
+ Source code documentation
+ Type-2 Fuzzy Logic Controllers
+ Adaptive Neuro-Fuzzy Inference System (ANFIS)
+ Fuzzy C-means data clustering
***
### <a name="building">Building from Source</a>
Building from source requires you to have CMake installed.
The files [`fuzzylite/build.bat`](/fuzzylite/build.bat) and [`fuzzylite/build.sh`](/fuzzylite/build.sh) are automatic build scripts for Windows and Unix platforms, respectively. The usage of these scripts is presented as follows.
#### Windows
```bash
> build.bat help
Usage: build.bat [options]
where [options] can be any of the following:
all builds fuzzylite in debug and release mode (default)
debug builds fuzzylite in debug mode
release builds fuzzylite in release mode
clean erases previous builds
help shows this information
```
#### Unix
```bash
$ ./build.sh help
Usage: [bash] ./build.sh [options]
where [options] can be any of the following:
all builds fuzzylite in debug and release mode (default)
debug builds fuzzylite in debug mode
release builds fuzzylite in release mode
clean erases previous builds
help shows this information
```
**(important)** After executing the building script, the binaries will be built and stored in the sub-folders `release/bin` and `debug/bin`.
#### Advanced Building Options
For more advanced building options, please check the contents of [`fuzzylite/build.bat`](/fuzzylite/build.bat) or [`fuzzylite/build.sh`](/fuzzylite/build.sh), and the contents of [`fuzzylite/CMakeLists.txt`](/fuzzylite/CMakeLists.txt).
The following building options are available:
`-DFL_USE_FLOAT=ON` builds the binaries using `typedef float fl::scalar` instead of `typedef double fl::scalar` (default is OFF, i.e., double is used)
`-DFL_BACKTRACE=OFF` disables the backtrace information in case of errors (default in Unix platforms is ON, and in Windows platforms is OFF). In Windows, the backtrace information requires the library `dbghelp`, which should be available in your system.
`-DFL_CPP11=ON` builds `fuzzylite` utilizing `C++11` features (default is OFF, i.e., `C++98`)
`-DCMAKE_BUILD_TYPE=[Debug|Release]` sets the mode of your build. You can only build one mode at a time with a single CMake script.
***
### <a name="binaries">Binaries</a>
After building from source, the following are the relevant binaries that will be created in `release` mode. In `debug` mode, binaries will append a `d` at the end of the name (e.g., `fuzzylited.dll`).
#### Windows
- console application: `fuzzylite.exe`
- shared library: `fuzzylite.dll`, `fuzzylite.lib`
- static library: `fuzzylite-static.lib`
#### Linux
- console application: `fuzzylite`
- shared library: `libfuzzylite.so`
- static library: `libfuzzylite.a`
#### Mac
- console application: `fuzzylite`
- shared library: `libfuzzylite.dylib`
- static library: `libfuzzylite.a`
The console application of `fuzzylite` allows you to import and export your controllers. Its usage can be obtained executing the console binary. In addition, the FuzzyLite Interactive Console is activated when exporting to `fld` without providing an output file. The interactive console allows you to evaluate any controller by manually providing the input the values.
***
For more information, visit [www.fuzzylite.com](http://www.fuzzylite.com).
fuzzylite&trade; is a trademark of FuzzyLite Limited.
Copyright &#xa9; 2010-2014 FuzzyLite Limited. All rights reserved.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -1,240 +0,0 @@
cmake_minimum_required(VERSION 2.8.8)
project(fuzzylite CXX)
###DEFINES SECTION
if(NOT CMAKE_VERBOSE_MAKEFILE)
set(CMAKE_VERBOSE_MAKEFILE false)
endif()
set(FL_VERSION 5.0)
add_definitions(-DFL_VERSION="${FL_VERSION}")
set(FL_DATE "1408")
add_definitions(-DFL_DATE="${FL_DATE}")
add_definitions(-DFL_BUILD_PATH="${CMAKE_SOURCE_DIR}") #used to determine FL__FILE__
option(FL_BUILD_SHARED "Build shared library" ON)
option(FL_BUILD_STATIC "Build static library" ON)
if(FL_BUILD_SHARED)
option(FL_BUILD_BINARY "Build fuzzylite binary" ON)
endif()
option(FL_USE_FLOAT "Use fl::scalar as float" OFF)
option(FL_BACKTRACE "Provide backtrace information in case of errors" OFF)
option(FL_CPP11 "Builds utilizing C++11, i.e., passing -std=c++11" OFF)
if(FL_CPP11 AND MSVC)
message("Warning: MSVC not compatible with FL_CPP11 flag")
endif()
if(FL_USE_FLOAT)
add_definitions(-DFL_USE_FLOAT)
endif(FL_USE_FLOAT)
if(NOT FL_BACKTRACE)
add_definitions(-DFL_BACKTRACE_OFF)
endif()
if(FL_CPP11)
add_definitions(-DFL_CPP11)
if(NOT MSVC)
add_definitions(-std=c++11)
endif(NOT MSVC)
endif(FL_CPP11)
if(WIN32)
message("Windows")
add_definitions(-DFL_WINDOWS)
endif()
if (UNIX)
message("Unix")
add_definitions(-DFL_UNIX)
endif()
if (APPLE)
message("Apple")
add_definitions(-DFL_APPLE)
endif()
if (NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY bin)
endif()
if (NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY bin)
endif()
if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY bin)
endif()
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "-pedantic -Werror -Wall -Wextra ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
if(NOT APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}") #To avoid undefined methods in library
endif()
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-non-literal-null-conversion")
endif()
set(FL_LIBS)
#link with rt lib on Linux. Fixes problem with clock_gettime()
include(CheckLibraryExists)
if(UNIX AND NOT APPLE)
ENABLE_LANGUAGE(C)
CHECK_LIBRARY_EXISTS(rt shm_open "" HAVE_RT_LIB)
if(HAVE_RT_LIB)
set(FL_LIBS ${FL_LIBS} rt)
endif()
endif()
if(MSVC)
set(CMAKE_CXX_FLAGS "/W4 /EHsc")
#set(CMAKE_CXX_FLAGS "/WX /W4 /EHsc")
#Wx: Treat warnings as errors. W4: All warnings
#http://msdn.microsoft.com/en-us/library/thxezb7y.aspx
#EHsc: call destructors on __try __catch, and to ignore C4530: C++ exception handler used. Note, unwind semantics are not enabled
#/wd4251 disable warning 4251 #http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html
#To avoid issues from disabling warning 4251, MSVCRT.lib is statically linked to resolve external references
#http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
#By default, MD is selected.
if (FL_BACKTRACE)
set(FL_LIBS dbghelp)
endif()
endif()
###BUILD SECTION
include_directories(.)
link_directories(.)
cmake_policy(SET CMP0015 OLD)
if (APPLE)
cmake_policy(SET CMP0042 NEW)
endif()
file(STRINGS FL_HEADERS fl-headers)
file(STRINGS FL_SOURCES fl-sources)
string(REGEX REPLACE "\n" " " ${fl-headers} ${fl-headers})
string(REGEX REPLACE "\n" " " ${fl-sources} ${fl-sources})
message("${exepath}")
set(CMAKE_DEBUG_POSTFIX d)
if (MSVC OR CMAKE_GENERATOR STREQUAL Xcode)
if(FL_BUILD_SHARED)
add_library(fl-shared SHARED ${fl-headers} ${fl-sources})
endif()
if(FL_BUILD_STATIC)
add_library(fl-static STATIC ${fl-headers} ${fl-sources})
endif()
else()
if(FL_BUILD_SHARED OR FL_BUILD_STATIC)
add_library(fl-obj OBJECT ${fl-headers} ${fl-sources})
if(NOT MINGW)
set_target_properties(fl-obj PROPERTIES COMPILE_FLAGS "-fPIC")
endif()
endif()
if(FL_BUILD_SHARED)
add_library(fl-shared SHARED $<TARGET_OBJECTS:fl-obj>)
endif(FL_BUILD_SHARED)
if(FL_BUILD_STATIC)
add_library(fl-static STATIC $<TARGET_OBJECTS:fl-obj>)
endif(FL_BUILD_STATIC)
endif()
if(FL_BUILD_SHARED)
set_target_properties(fl-shared PROPERTIES OUTPUT_NAME fuzzylite)
set_target_properties(fl-shared PROPERTIES DEBUG_POSTFIX d)
set_target_properties(fl-shared PROPERTIES COMPILE_DEFINITIONS "FL_EXPORT_LIBRARY")
set_target_properties(fl-shared PROPERTIES VERSION 5.0)
target_link_libraries(fl-shared ${FL_LIBS})
endif()
if(FL_BUILD_STATIC)
set_target_properties(fl-static PROPERTIES OUTPUT_NAME fuzzylite-static)
set_target_properties(fl-static PROPERTIES DEBUG_POSTFIX d)
set_target_properties(fl-static PROPERTIES VERSION 5.0)
target_link_libraries(fl-static ${FL_LIBS})
endif()
if(FL_BUILD_BINARY)
add_executable(fl-bin src/main.cpp)
set_target_properties(fl-bin PROPERTIES OUTPUT_NAME fuzzylite)
set_target_properties(fl-bin PROPERTIES OUTPUT_NAME fuzzylite IMPORT_PREFIX tmp-) #To prevent LNK1149 in Windows
set_target_properties(fl-bin PROPERTIES DEBUG_POSTFIX d)
set_target_properties(fl-bin PROPERTIES COMPILE_DEFINITIONS "FL_IMPORT_LIBRARY")
target_link_libraries(fl-bin fl-shared ${FL_LIBS})
endif(FL_BUILD_BINARY)
###INSTALL SECTION
if(NOT FL_INSTALL_BINDIR)
set(FL_INSTALL_BINDIR bin)
endif()
if(NOT FL_INSTALL_LIBDIR)
if(NOT CMAKE_INSTALL_LIBDIR)
set(FL_INSTALL_LIBDIR lib)
else()
set(FL_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
endif()
endif()
if(FL_BUILD_BINARY)
install(TARGETS fl-bin
RUNTIME DESTINATION ${FL_INSTALL_BINDIR}
LIBRARY DESTINATION ${FL_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${FL_INSTALL_LIBDIR}
)
endif()
if(FL_BUILD_SHARED)
install(TARGETS fl-shared
RUNTIME DESTINATION ${FL_INSTALL_BINDIR}
LIBRARY DESTINATION ${FL_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${FL_INSTALL_LIBDIR}
)
endif()
if(FL_BUILD_STATIC)
install(TARGETS fl-static
RUNTIME DESTINATION ${FL_INSTALL_BINDIR}
LIBRARY DESTINATION ${FL_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${FL_INSTALL_LIBDIR}
)
endif()
install(DIRECTORY fl/ DESTINATION include/fl)
message("=====================================")
message("fuzzylite v.${FL_VERSION}b${FL_DATE}\n")
message("FL_USE_FLOAT=${FL_USE_FLOAT}")
message("FL_BACKTRACE=${FL_BACKTRACE}")
message("FL_CPP11=${FL_CPP11}")
message("FL_INSTALL_BINDIR=${FL_INSTALL_BINDIR}")
message("FL_INSTALL_LIBDIR=${FL_INSTALL_LIBDIR}")
message("Build=${CMAKE_BUILD_TYPE}")
message("=====================================\n")
###UNINSTALL SECTION
#configure_file(
#"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
#"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
#IMMEDIATE @ONLY)
#add_custom_target(uninstall
#COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake)
#unix uninstall
#xargs rm < install_manifest.txt

View File

@ -1,92 +0,0 @@
fl/Console.h
fl/defuzzifier/Bisector.h
fl/defuzzifier/Centroid.h
fl/defuzzifier/Defuzzifier.h
fl/defuzzifier/IntegralDefuzzifier.h
fl/defuzzifier/LargestOfMaximum.h
fl/defuzzifier/MeanOfMaximum.h
fl/defuzzifier/SmallestOfMaximum.h
fl/defuzzifier/WeightedAverage.h
fl/defuzzifier/WeightedDefuzzifier.h
fl/defuzzifier/WeightedSum.h
fl/Engine.h
fl/Exception.h
fl/factory/CloningFactory.h
fl/factory/ConstructionFactory.h
fl/factory/DefuzzifierFactory.h
fl/factory/FactoryManager.h
fl/factory/FunctionFactory.h
fl/factory/HedgeFactory.h
fl/factory/SNormFactory.h
fl/factory/TermFactory.h
fl/factory/TNormFactory.h
fl/fuzzylite.h
fl/Headers.h
fl/hedge/Any.h
fl/hedge/Extremely.h
fl/hedge/Hedge.h
fl/hedge/Not.h
fl/hedge/Seldom.h
fl/hedge/Somewhat.h
fl/hedge/Very.h
fl/imex/CppExporter.h
fl/imex/Exporter.h
fl/imex/FclExporter.h
fl/imex/FclImporter.h
fl/imex/FisExporter.h
fl/imex/FisImporter.h
fl/imex/FldExporter.h
fl/imex/FllExporter.h
fl/imex/FllImporter.h
fl/imex/Importer.h
fl/imex/JavaExporter.h
fl/norm/Norm.h
fl/norm/s/AlgebraicSum.h
fl/norm/s/BoundedSum.h
fl/norm/s/DrasticSum.h
fl/norm/s/EinsteinSum.h
fl/norm/s/HamacherSum.h
fl/norm/s/Maximum.h
fl/norm/s/NilpotentMaximum.h
fl/norm/s/NormalizedSum.h
fl/norm/SNorm.h
fl/norm/t/AlgebraicProduct.h
fl/norm/t/BoundedDifference.h
fl/norm/t/DrasticProduct.h
fl/norm/t/EinsteinProduct.h
fl/norm/t/HamacherProduct.h
fl/norm/t/Minimum.h
fl/norm/t/NilpotentMinimum.h
fl/norm/TNorm.h
fl/Operation.h
fl/rule/Antecedent.h
fl/rule/Consequent.h
fl/rule/Expression.h
fl/rule/RuleBlock.h
fl/rule/Rule.h
fl/term/Accumulated.h
fl/term/Activated.h
fl/term/Bell.h
fl/term/Concave.h
fl/term/Constant.h
fl/term/Cosine.h
fl/term/Discrete.h
fl/term/Function.h
fl/term/Gaussian.h
fl/term/GaussianProduct.h
fl/term/Linear.h
fl/term/PiShape.h
fl/term/Ramp.h
fl/term/Rectangle.h
fl/term/SigmoidDifference.h
fl/term/Sigmoid.h
fl/term/SigmoidProduct.h
fl/term/Spike.h
fl/term/SShape.h
fl/term/Term.h
fl/term/Trapezoid.h
fl/term/Triangle.h
fl/term/ZShape.h
fl/variable/InputVariable.h
fl/variable/OutputVariable.h
fl/variable/Variable.h

View File

@ -1,87 +0,0 @@
src/Console.cpp
src/defuzzifier/Bisector.cpp
src/defuzzifier/Centroid.cpp
src/defuzzifier/IntegralDefuzzifier.cpp
src/defuzzifier/LargestOfMaximum.cpp
src/defuzzifier/MeanOfMaximum.cpp
src/defuzzifier/SmallestOfMaximum.cpp
src/defuzzifier/WeightedAverage.cpp
src/defuzzifier/WeightedDefuzzifier.cpp
src/defuzzifier/WeightedSum.cpp
src/Engine.cpp
src/Exception.cpp
src/factory/CloningFactory.cpp
src/factory/ConstructionFactory.cpp
src/factory/DefuzzifierFactory.cpp
src/factory/FactoryManager.cpp
src/factory/FunctionFactory.cpp
src/factory/HedgeFactory.cpp
src/factory/SNormFactory.cpp
src/factory/TermFactory.cpp
src/factory/TNormFactory.cpp
src/fuzzylite.cpp
src/hedge/Any.cpp
src/hedge/Extremely.cpp
src/hedge/Not.cpp
src/hedge/Seldom.cpp
src/hedge/Somewhat.cpp
src/hedge/Very.cpp
src/imex/CppExporter.cpp
src/imex/Exporter.cpp
src/imex/FclExporter.cpp
src/imex/FclImporter.cpp
src/imex/FisExporter.cpp
src/imex/FisImporter.cpp
src/imex/FldExporter.cpp
src/imex/FllExporter.cpp
src/imex/FllImporter.cpp
src/imex/Importer.cpp
src/imex/JavaExporter.cpp
src/main.cpp
src/norm/s/AlgebraicSum.cpp
src/norm/s/BoundedSum.cpp
src/norm/s/DrasticSum.cpp
src/norm/s/EinsteinSum.cpp
src/norm/s/HamacherSum.cpp
src/norm/s/Maximum.cpp
src/norm/s/NilpotentMaximum.cpp
src/norm/s/NormalizedSum.cpp
src/norm/t/AlgebraicProduct.cpp
src/norm/t/BoundedDifference.cpp
src/norm/t/DrasticProduct.cpp
src/norm/t/EinsteinProduct.cpp
src/norm/t/HamacherProduct.cpp
src/norm/t/Minimum.cpp
src/norm/t/NilpotentMinimum.cpp
src/Operation.cpp
src/rule/Antecedent.cpp
src/rule/Consequent.cpp
src/rule/Expression.cpp
src/rule/RuleBlock.cpp
src/rule/Rule.cpp
src/term/Accumulated.cpp
src/term/Activated.cpp
src/term/Bell.cpp
src/term/Concave.cpp
src/term/Constant.cpp
src/term/Cosine.cpp
src/term/Discrete.cpp
src/term/Function.cpp
src/term/Gaussian.cpp
src/term/GaussianProduct.cpp
src/term/Linear.cpp
src/term/PiShape.cpp
src/term/Ramp.cpp
src/term/Rectangle.cpp
src/term/Sigmoid.cpp
src/term/SigmoidDifference.cpp
src/term/SigmoidProduct.cpp
src/term/Spike.cpp
src/term/SShape.cpp
src/term/Term.cpp
src/term/Trapezoid.cpp
src/term/Triangle.cpp
src/term/ZShape.cpp
src/variable/InputVariable.cpp
src/variable/OutputVariable.cpp
src/variable/Variable.cpp

View File

@ -1,104 +0,0 @@
@echo off
setlocal EnableDelayedExpansion
set argc=0
set valid="no"
for %%a in (%*) do (
set /A argc+=1
if /I "%%a"=="help" (
call:usage
goto:eof
)
if /I "%%a"=="all" set valid="yes"
if /I "%%a"=="release" set valid="yes"
if /I "%%a"=="debug" set valid="yes"
if /I "%%a"=="clean" set valid="yes"
if !valid!=="no" (
echo Invalid option: %%a
call:usage
goto:eof
)
)
if %argc%==0 echo Building schedule: all
if not %argc%==0 echo Building schedule: %*
echo Starting in 3 seconds...
ping 1.1.1.1 -n 1 -w 3000 > nul
rem sleep 3 ::This function makes command line DOS-esque C:\Archiv~1
if %argc%==0 (call:all)
for %%a in (%*) do (call:%%a)
goto:eof
:debug
echo.
echo.
echo ****************************************
echo STARTING: debug
if not exist debug mkdir debug
cd debug
cmake .. -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Debug -DFL_BACKTRACE=ON -DFL_USE_FLOAT=OFF -DFL_CPP11=OFF
nmake
cd ..
echo.
echo FINISHED: debug
echo ****************************************
goto:eof
:release
echo.
echo.
echo ****************************************
echo STARTING: release
if not exist release mkdir release
cd release
cmake .. -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DFL_BACKTRACE=OFF -DFL_USE_FLOAT=OFF -DFL_CPP11=OFF
nmake
cd ..
echo.
echo FINISHED: release
echo ****************************************
goto:eof
:all
echo.
echo.
echo ****************************************
echo STARTING: all
call:debug
call:release
echo.
echo FINISHED: all
echo ****************************************
goto:eof
:clean
echo.
echo.
echo ****************************************
echo STARTING: clean
if exist debug rmdir /S /Q debug
if exist release rmdir /S /Q release
echo.
echo FINISHED: clean
echo ****************************************
goto:eof
:usage
echo Usage: build.bat [options]
echo where [options] can be any of the following:
echo ^ all builds fuzzylite in debug and release mode (default)
echo ^ debug builds fuzzylite in debug mode
echo ^ release builds fuzzylite in release mode
echo ^ clean erases previous builds
echo ^ help shows this information
echo.
ENDLOCAL

View File

@ -1,70 +0,0 @@
#!/bin/bash
debug(){
mkdir -p debug
cd debug
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DFL_BACKTRACE=ON -DFL_USE_FLOAT=OFF -DFL_CPP11=OFF
make
cd ..
}
release(){
mkdir -p release
cd release
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFL_BACKTRACE=ON -DFL_USE_FLOAT=OFF -DFL_CPP11=OFF
make
cd ..
}
all(){
debug
release
}
clean(){
rm -rf release debug
}
usage(){
printf 'Usage:\t[bash] ./build.sh [options]\n'
printf "where\t[options] can be any of the following:\n"
printf "\tall\t\t builds fuzzylite in debug and release mode (default)\n"
printf "\tdebug\t\t builds fuzzylite in debug mode\n"
printf "\trelease\t\t builds fuzzylite in release mode\n"
printf "\tclean\t\t erases previous builds\n"
printf "\thelp\t\t shows this information\n"
printf "\n"
}
#############################
OPTIONS=( "all" "debug" "release" "clean" "help")
BUILD=( )
for arg in "$@"
do
if [[ "$arg" == "help" ]]; then usage && exit 0; fi
if [[ "$arg" == "all" || "$arg" == "debug" || "$arg" == "release" || "$arg" == "clean" ]];
then BUILD+=( $arg ); else echo "Invalid option: $arg" && usage && exit 2;
fi
done
if [ ${#BUILD[@]} -eq 0 ]; then BUILD+=( "all" ); fi
echo "Building schedule: ${BUILD[@]}"
echo "Starting in 3 seconds..."
sleep 3
for option in "${BUILD[@]}"
do
printf "\n\n"
printf "******************************\n"
printf "STARTING: $option\n"
eval ${option}
printf "\nFINISHED: $option\n"
printf "******************************\n\n"
done

View File

@ -1,89 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_CONSOLE_H
#define FL_CONSOLE_H
#include "fl/fuzzylite.h"
#include <map>
#include <string>
#include <vector>
namespace fl {
class Engine;
class FL_API Console {
public:
struct Option {
std::string key, value, description;
Option(const std::string& key = "", const std::string& value = "", const std::string& description = "") :
key(key), value(value), description(description) {
}
};
static const std::string KW_INPUT_FILE;
static const std::string KW_INPUT_FORMAT;
static const std::string KW_OUTPUT_FILE;
static const std::string KW_OUTPUT_FORMAT;
static const std::string KW_EXAMPLE;
static const std::string KW_DECIMALS;
static const std::string KW_DATA_INPUT;
static const std::string KW_DATA_MAXIMUM;
static const std::string KW_DATA_EXPORT_HEADER;
static const std::string KW_DATA_EXPORT_INPUTS;
static Engine* mamdani();
static Engine* takagiSugeno();
protected:
static std::map<std::string, std::string> parse(int argc, char** argv);
static void process(const std::map<std::string, std::string>& options);
static void process(const std::string& input, std::ostream& writer,
const std::string& inputFormat, const std::string& outputFormat,
const std::map<std::string, std::string>& options);
static int readCharacter();
static void interactive(std::ostream& writer, Engine* engine);
static std::string interactiveHelp();
static void exportAllExamples(const std::string& from, const std::string& to);
#if defined(FL_UNIX) && ! defined(FL_APPLE)
static void benchmarkExamples(int runs);
#endif
public:
static std::string usage();
static std::vector<Option> availableOptions();
static int main(int argc, char** argv);
};
}
#endif /* FL_CONSOLE_H */

View File

@ -1,151 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_ENGINE_H
#define FL_ENGINE_H
#include "fl/fuzzylite.h"
#include "fl/defuzzifier/IntegralDefuzzifier.h"
#include <string>
#include <vector>
namespace fl {
class InputVariable;
class OutputVariable;
class Variable;
class RuleBlock;
class Hedge;
class TNorm;
class SNorm;
class Defuzzifier;
class FL_API Engine {
private:
void copyFrom(const Engine& source);
protected:
std::string _name;
std::vector<InputVariable*> _inputVariables;
std::vector<OutputVariable*> _outputVariables;
std::vector<RuleBlock*> _ruleblocks;
void updateReferences() const;
public:
Engine(const std::string& name = "");
Engine(const Engine& other);
Engine& operator=(const Engine& other);
virtual ~Engine();
FL_DEFAULT_MOVE(Engine)
virtual void configure(const std::string& conjunctionT,
const std::string& disjunctionS,
const std::string& activationT,
const std::string& accumulationS,
const std::string& defuzzifier,
int resolution = IntegralDefuzzifier::defaultResolution());
virtual void configure(TNorm* conjunction, SNorm* disjunction,
TNorm* activation, SNorm* accumulation,
Defuzzifier* defuzzifier);
virtual bool isReady(std::string* status = fl::null) const;
virtual void process();
virtual void restart();
virtual void setName(const std::string& name);
virtual std::string getName() const;
virtual void setInputValue(const std::string& name, scalar value);
virtual scalar getOutputValue(const std::string& name);
virtual std::string toString() const;
enum Type {
Mamdani, Larsen, TakagiSugeno,
Tsukamoto, InverseTsukamoto, Hybrid, Unknown
};
virtual Type type(std::string* name = fl::null, std::string* reason = fl::null) const;
virtual Engine* clone() const;
virtual std::vector<Variable*> variables() const;
/**
* Operations for iterable datatype _inputVariables
*/
virtual void addInputVariable(InputVariable* inputVariable);
virtual InputVariable* setInputVariable(InputVariable* inputVariable, int index);
virtual void insertInputVariable(InputVariable* inputVariable, int index);
virtual InputVariable* getInputVariable(int index) const;
virtual InputVariable* getInputVariable(const std::string& name) const;
virtual InputVariable* removeInputVariable(int index);
virtual InputVariable* removeInputVariable(const std::string& name);
virtual bool hasInputVariable(const std::string& name) const;
virtual int numberOfInputVariables() const;
virtual const std::vector<InputVariable*>& inputVariables() const;
virtual void setInputVariables(const std::vector<InputVariable*>& inputVariables);
virtual std::vector<InputVariable*>& inputVariables();
/**
* Operations for iterable datatype _outputVariables
*/
virtual void addOutputVariable(OutputVariable* outputVariable);
virtual OutputVariable* setOutputVariable(OutputVariable* outputVariable, int index);
virtual void insertOutputVariable(OutputVariable* outputVariable, int index);
virtual OutputVariable* getOutputVariable(int index) const;
virtual OutputVariable* getOutputVariable(const std::string& name) const;
virtual bool hasOutputVariable(const std::string& name) const;
virtual OutputVariable* removeOutputVariable(int index);
virtual OutputVariable* removeOutputVariable(const std::string& name);
virtual int numberOfOutputVariables() const;
virtual const std::vector<OutputVariable*>& outputVariables() const;
virtual void setOutputVariables(const std::vector<OutputVariable*>& outputVariables);
virtual std::vector<OutputVariable*>& outputVariables();
/**
* Operations for iterable datatype _ruleblocks
*/
virtual void addRuleBlock(RuleBlock* ruleblock);
virtual RuleBlock* setRuleBlock(RuleBlock* ruleBlock, int index);
virtual void insertRuleBlock(RuleBlock* ruleblock, int index);
virtual RuleBlock* getRuleBlock(int index) const;
virtual RuleBlock* getRuleBlock(const std::string& name) const;
virtual bool hasRuleBlock(const std::string& name) const;
virtual RuleBlock* removeRuleBlock(int index);
virtual RuleBlock* removeRuleBlock(const std::string& name);
virtual int numberOfRuleBlocks() const;
virtual const std::vector<RuleBlock*>& ruleBlocks() const;
virtual void setRuleBlocks(const std::vector<RuleBlock*>& ruleBlocks);
virtual std::vector<RuleBlock*>& ruleBlocks();
};
}
#endif /* FL_ENGINE_H */

View File

@ -1,66 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_EXCEPTION_H
#define FL_EXCEPTION_H
#include "fl/fuzzylite.h"
#include <exception>
#include <string>
#include <vector>
namespace fl {
class FL_API Exception : public std::exception {
protected:
std::string _what;
public:
Exception(const std::string& what);
Exception(const std::string& what, const std::string& file, int line,
const std::string& function);
virtual ~Exception() FL_INOEXCEPT FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Exception)
virtual void setWhat(const std::string& what);
virtual std::string getWhat() const;
virtual const char* what() const FL_INOEXCEPT FL_IOVERRIDE;
virtual void append(const std::string& whatElse);
virtual void append(const std::string& file, int line, const std::string& function);
virtual void append(const std::string& whatElse,
const std::string& file, int line, const std::string& function);
static std::string btCallStack();
static void signalHandler(int signal);
static void convertToException(int signal);
static void terminate();
static void catchException(const std::exception& exception);
};
}
#endif /* FL_EXCEPTION_H */

View File

@ -1,131 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_HEADERS_H
#define FL_HEADERS_H
#include "fl/fuzzylite.h"
#include "fl/Console.h"
#include "fl/Engine.h"
#include "fl/Exception.h"
#include "fl/defuzzifier/Bisector.h"
#include "fl/defuzzifier/Centroid.h"
#include "fl/defuzzifier/Defuzzifier.h"
#include "fl/defuzzifier/IntegralDefuzzifier.h"
#include "fl/defuzzifier/SmallestOfMaximum.h"
#include "fl/defuzzifier/LargestOfMaximum.h"
#include "fl/defuzzifier/MeanOfMaximum.h"
#include "fl/defuzzifier/WeightedAverage.h"
#include "fl/defuzzifier/WeightedDefuzzifier.h"
#include "fl/defuzzifier/WeightedSum.h"
#include "fl/factory/CloningFactory.h"
#include "fl/factory/ConstructionFactory.h"
#include "fl/factory/FactoryManager.h"
#include "fl/factory/FunctionFactory.h"
#include "fl/factory/DefuzzifierFactory.h"
#include "fl/factory/HedgeFactory.h"
#include "fl/factory/SNormFactory.h"
#include "fl/factory/TNormFactory.h"
#include "fl/factory/TermFactory.h"
#include "fl/imex/CppExporter.h"
#include "fl/imex/FclImporter.h"
#include "fl/imex/FclExporter.h"
#include "fl/imex/FisImporter.h"
#include "fl/imex/FisExporter.h"
#include "fl/imex/FldExporter.h"
#include "fl/imex/FllImporter.h"
#include "fl/imex/FllExporter.h"
#include "fl/imex/JavaExporter.h"
#include "fl/hedge/Any.h"
#include "fl/hedge/Extremely.h"
#include "fl/hedge/Hedge.h"
#include "fl/hedge/Not.h"
#include "fl/hedge/Seldom.h"
#include "fl/hedge/Somewhat.h"
#include "fl/hedge/Very.h"
#include "fl/Operation.h"
#include "fl/norm/Norm.h"
#include "fl/norm/SNorm.h"
#include "fl/norm/TNorm.h"
#include "fl/norm/s/AlgebraicSum.h"
#include "fl/norm/s/BoundedSum.h"
#include "fl/norm/s/DrasticSum.h"
#include "fl/norm/s/EinsteinSum.h"
#include "fl/norm/s/HamacherSum.h"
#include "fl/norm/s/Maximum.h"
#include "fl/norm/s/NilpotentMaximum.h"
#include "fl/norm/s/NormalizedSum.h"
#include "fl/norm/t/AlgebraicProduct.h"
#include "fl/norm/t/BoundedDifference.h"
#include "fl/norm/t/DrasticProduct.h"
#include "fl/norm/t/EinsteinProduct.h"
#include "fl/norm/t/HamacherProduct.h"
#include "fl/norm/t/Minimum.h"
#include "fl/norm/t/NilpotentMinimum.h"
#include "fl/rule/Antecedent.h"
#include "fl/rule/Consequent.h"
#include "fl/rule/Rule.h"
#include "fl/rule/RuleBlock.h"
#include "fl/rule/Expression.h"
#include "fl/term/Accumulated.h"
#include "fl/term/Bell.h"
#include "fl/term/Concave.h"
#include "fl/term/Constant.h"
#include "fl/term/Cosine.h"
#include "fl/term/Discrete.h"
#include "fl/term/Function.h"
#include "fl/term/Gaussian.h"
#include "fl/term/GaussianProduct.h"
#include "fl/term/Linear.h"
#include "fl/term/PiShape.h"
#include "fl/term/Ramp.h"
#include "fl/term/Rectangle.h"
#include "fl/term/SShape.h"
#include "fl/term/Sigmoid.h"
#include "fl/term/SigmoidDifference.h"
#include "fl/term/SigmoidProduct.h"
#include "fl/term/Spike.h"
#include "fl/term/Term.h"
#include "fl/term/Activated.h"
#include "fl/term/Trapezoid.h"
#include "fl/term/Triangle.h"
#include "fl/term/ZShape.h"
#include "fl/variable/InputVariable.h"
#include "fl/variable/OutputVariable.h"
#include "fl/variable/Variable.h"
#endif /* FL_HEADERS_H */

View File

@ -1,144 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_OPERATION_H
#define FL_OPERATION_H
#include "fl/fuzzylite.h"
#include "fl/Exception.h"
#include <string>
#include <vector>
namespace fl {
class FL_API Operation {
public:
template <typename T>
static T min(T a, T b);
template <typename T>
static T max(T a, T b);
template <typename T>
static T bound(T x, T min, T max);
template <typename T>
static bool in(T x, T min, T max, bool geq = true, bool leq = true);
template <typename T>
static bool isInf(T x);
template <typename T>
static bool isNaN(T x);
template <typename T>
static bool isFinite(T x);
//Is less than
static bool isLt(scalar a, scalar b, scalar macheps = fl::fuzzylite::macheps());
static bool isLE(scalar a, scalar b, scalar macheps = fl::fuzzylite::macheps());
static bool isEq(scalar a, scalar b, scalar macheps = fl::fuzzylite::macheps());
static bool isGt(scalar a, scalar b, scalar macheps = fl::fuzzylite::macheps());
static bool isGE(scalar a, scalar b, scalar macheps = fl::fuzzylite::macheps());
static scalar scale(scalar x, scalar fromMin, scalar fromMax,
scalar toMin, scalar toMax, bool bounded = false);
static scalar add(scalar a, scalar b);
static scalar subtract(scalar a, scalar b);
static scalar multiply(scalar a, scalar b);
static scalar divide(scalar a, scalar b);
static scalar modulo(scalar a, scalar b);
static scalar logicalAnd(scalar a, scalar b);
static scalar logicalOr(scalar a, scalar b);
static scalar logicalNot(scalar a);
static scalar negate(scalar a);
static scalar round(scalar x);
//greater than
static scalar gt(scalar a, scalar b);
//greater than or equal to
static scalar ge(scalar a, scalar b);
//equal to
static scalar eq(scalar a, scalar b);
//not equal to
static scalar neq(scalar a, scalar b);
//less than or equal to
static scalar le(scalar a, scalar b);
//less than
static scalar lt(scalar a, scalar b);
static bool increment(std::vector<int>& x, std::vector<int>& min, std::vector<int>& max);
static bool increment(std::vector<int>& x, int position, std::vector<int>& min, std::vector<int>& max);
static double mean(const std::vector<scalar>& x);
static double variance(const std::vector<scalar>& x);
static double variance(const std::vector<scalar>& x, scalar mean);
static double standardDeviation(const std::vector<scalar>& x);
static double standardDeviation(const std::vector<scalar>& x, scalar mean);
static std::string validName(const std::string& name);
static int isValidForName(int character);
static std::string findReplace(const std::string& str, const std::string& find,
const std::string& replace, bool replaceAll = true);
static std::vector<std::string> split(const std::string& str,
const std::string& delimiter = " ", bool ignoreEmpty = true);
static std::string trim(const std::string& text);
static std::string format(const std::string& text, int matchesChar(int),
const std::string& replacement = "");
//Intentionally results in a compiler error in C++11, or linker error in C++98
//in order to avoid the deprecated usage of this method from version 4.0
static scalar toScalar(const std::string& x, bool quiet,
scalar alternative = fl::nan) FL_IDELETE;
static scalar toScalar(const std::string& x); //throws fl::Exception
static scalar toScalar(const std::string& x, scalar alternative) FL_INOEXCEPT;
static bool isNumeric(const std::string& x);
template <typename T>
static std::string str(T x, int decimals = fuzzylite::decimals());
template <typename T>
static std::string join(const std::vector<T>& x, const std::string& separator);
template <typename T>
static std::string join(int items, const std::string& separator, T first, ...);
};
typedef Operation Op;
}
#endif /* FL_OPERATION_H */

View File

@ -1,49 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_BISECTOR_H
#define FL_BISECTOR_H
#include "fl/defuzzifier/IntegralDefuzzifier.h"
namespace fl {
class FL_API Bisector : public IntegralDefuzzifier {
public:
Bisector(int resolution = defaultResolution());
virtual ~Bisector() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Bisector)
virtual std::string className() const FL_IOVERRIDE;
virtual scalar defuzzify(const Term* term,
scalar minimum, scalar maximum) const FL_IOVERRIDE;
virtual Bisector* clone() const FL_IOVERRIDE;
static Defuzzifier* constructor();
};
}
#endif /* FL_BISECTOR_H */

View File

@ -1,47 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_CENTROID_H
#define FL_CENTROID_H
#include "fl/defuzzifier/IntegralDefuzzifier.h"
namespace fl {
class FL_API Centroid : public IntegralDefuzzifier {
public:
Centroid(int resolution = defaultResolution());
virtual ~Centroid() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Centroid)
virtual std::string className() const FL_IOVERRIDE;
virtual scalar defuzzify(const Term* term,
scalar minimum, scalar maximum) const FL_IOVERRIDE;
virtual Centroid* clone() const FL_IOVERRIDE;
static Defuzzifier* constructor();
};
}
#endif /* FL_CENTROID_H */

View File

@ -1,53 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
//TODO Check http://en.wikipedia.org/wiki/Defuzzification for other defuzzifiers.
#ifndef FL_DEFUZZIFIER_H
#define FL_DEFUZZIFIER_H
#include "fl/fuzzylite.h"
#include <string>
namespace fl {
class Term;
class FL_API Defuzzifier {
public:
Defuzzifier() {
}
virtual ~Defuzzifier() {
}
FL_DEFAULT_COPY_AND_MOVE(Defuzzifier)
virtual std::string className() const = 0;
virtual Defuzzifier* clone() const = 0;
virtual scalar defuzzify(const Term* term, scalar minimum, scalar maximum) const = 0;
};
}
#endif /* FL_DEFUZZIFIER_H */

View File

@ -1,53 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_INTEGRALDEFUZZIFIER_H
#define FL_INTEGRALDEFUZZIFIER_H
#include "fl/defuzzifier/Defuzzifier.h"
namespace fl {
//TODO: check http://en.wikipedia.org/wiki/Adaptive_quadrature
class FL_API IntegralDefuzzifier : public Defuzzifier {
protected:
static int _defaultResolution;
int _resolution;
public:
static void setDefaultResolution(int defaultResolution);
static int defaultResolution();
IntegralDefuzzifier(int resolution = defaultResolution());
virtual ~IntegralDefuzzifier() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(IntegralDefuzzifier)
virtual void setResolution(int resolution);
virtual int getResolution() const;
};
}
#endif /* INTEGRALDEFUZZIFIER_H */

View File

@ -1,47 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_LARGESTOFMAXIMUM_H
#define FL_LARGESTOFMAXIMUM_H
#include "fl/defuzzifier/IntegralDefuzzifier.h"
namespace fl {
class FL_API LargestOfMaximum : public IntegralDefuzzifier {
public:
LargestOfMaximum(int resolution = defaultResolution());
virtual ~LargestOfMaximum() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(LargestOfMaximum)
virtual std::string className() const FL_IOVERRIDE;
virtual scalar defuzzify(const Term* term,
scalar minimum, scalar maximum) const FL_IOVERRIDE;
virtual LargestOfMaximum* clone() const FL_IOVERRIDE;
static Defuzzifier* constructor();
};
}
#endif /* FL_LARGESTOFMAXIMUM_H */

View File

@ -1,48 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_MEANOFMAXIMUM_H
#define FL_MEANOFMAXIMUM_H
#include "fl/defuzzifier/IntegralDefuzzifier.h"
namespace fl {
class FL_API MeanOfMaximum : public IntegralDefuzzifier {
public:
MeanOfMaximum(int resolution = defaultResolution());
virtual ~MeanOfMaximum() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(MeanOfMaximum)
virtual std::string className() const FL_IOVERRIDE;
virtual scalar defuzzify(const Term* term,
scalar minimum, scalar maximum) const FL_IOVERRIDE;
virtual MeanOfMaximum* clone() const FL_IOVERRIDE;
static Defuzzifier* constructor();
};
}
#endif /* FL_MEANOFMAXIMUM_H */

View File

@ -1,48 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_SMALLESTOFMAXIMUM_H
#define FL_SMALLESTOFMAXIMUM_H
#include "fl/defuzzifier/IntegralDefuzzifier.h"
namespace fl {
class FL_API SmallestOfMaximum : public IntegralDefuzzifier {
public:
SmallestOfMaximum(int resolution = defaultResolution());
virtual ~SmallestOfMaximum() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(SmallestOfMaximum)
virtual std::string className() const FL_IOVERRIDE;
virtual scalar defuzzify(const Term* term,
scalar minimum, scalar maximum) const FL_IOVERRIDE;
virtual SmallestOfMaximum* clone() const FL_IOVERRIDE;
static Defuzzifier* constructor();
};
}
#endif /* FL_SMALLESTOFMAXIMUM_H */

View File

@ -1,50 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_WEIGHTEDAVERAGE_H
#define FL_WEIGHTEDAVERAGE_H
#include "fl/defuzzifier/WeightedDefuzzifier.h"
namespace fl {
class Activated;
class FL_API WeightedAverage : public WeightedDefuzzifier {
public:
WeightedAverage(Type type = Automatic);
WeightedAverage(const std::string& type);
virtual ~WeightedAverage() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(WeightedAverage)
virtual std::string className() const FL_IOVERRIDE;
virtual scalar defuzzify(const Term* term,
scalar minimum, scalar maximum) const FL_IOVERRIDE;
virtual WeightedAverage* clone() const FL_IOVERRIDE;
static Defuzzifier* constructor();
};
}
#endif /* FL_WEIGHTEDAVERAGE_H */

View File

@ -1,63 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_WEIGHTEDDEFUZZIFIER_H
#define FL_WEIGHTEDDEFUZZIFIER_H
#include "fl/defuzzifier/Defuzzifier.h"
namespace fl {
class Activated;
class FL_API WeightedDefuzzifier : public Defuzzifier {
public:
enum Type {
Automatic, TakagiSugeno, Tsukamoto
};
static std::string typeName(Type);
WeightedDefuzzifier(Type type = Automatic);
WeightedDefuzzifier(const std::string& type);
virtual ~WeightedDefuzzifier() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(WeightedDefuzzifier)
virtual void setType(Type type);
virtual Type getType() const;
virtual std::string getTypeName() const;
virtual Type inferType(const Term* term) const;
virtual bool isMonotonic(const Term* term) const;
virtual scalar tsukamoto(const Term* monotonic, scalar activationDegree,
scalar minimum, scalar maximum) const;
protected:
Type _type;
};
}
#endif /* FL_WEIGHTEDDEFUZZIFIER_H */

View File

@ -1,50 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_WEIGHTEDSUM_H
#define FL_WEIGHTEDSUM_H
#include "fl/defuzzifier/WeightedDefuzzifier.h"
namespace fl {
class FL_API WeightedSum : public WeightedDefuzzifier {
public:
WeightedSum(Type type = Automatic);
WeightedSum(const std::string& type);
virtual ~WeightedSum() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(WeightedSum)
virtual std::string className() const FL_IOVERRIDE;
virtual scalar defuzzify(const Term* term,
scalar minimum, scalar maximum) const FL_IOVERRIDE;
virtual WeightedSum* clone() const FL_IOVERRIDE;
static Defuzzifier* constructor();
};
}
#endif /* FL_WEIGHTEDSUM_H */

View File

@ -1,62 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_CLONINGFACTORY_H
#define FL_CLONINGFACTORY_H
#include "fl/fuzzylite.h"
#include <map>
#include <string>
#include <vector>
namespace fl {
template <typename T>
class FL_API CloningFactory {
protected:
std::string _name;
std::map<std::string, T> _objects;
public:
CloningFactory(const std::string& name = "");
CloningFactory(const CloningFactory& other);
CloningFactory& operator=(const CloningFactory& other);
virtual ~CloningFactory();
FL_DEFAULT_MOVE(CloningFactory)
virtual std::string name() const;
virtual void registerObject(const std::string& key, T object);
virtual void deregisterObject(const std::string& key);
virtual bool hasObject(const std::string& key) const;
virtual T getObject(const std::string& key) const;
virtual T cloneObject(const std::string& key) const;
virtual std::vector<std::string> available() const;
};
}
#endif /* FL_CLONINGFACTORY_H */

View File

@ -1,64 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_FACTORY_H
#define FL_FACTORY_H
#include "fl/fuzzylite.h"
#include <map>
#include <string>
#include <vector>
namespace fl {
template <typename T>
class FL_API ConstructionFactory {
public:
typedef T(*Constructor)();
protected:
std::string _name;
std::map<std::string, Constructor> _constructors;
public:
ConstructionFactory(const std::string& name);
virtual ~ConstructionFactory();
FL_DEFAULT_COPY_AND_MOVE(ConstructionFactory)
virtual std::string name() const;
virtual void registerConstructor(const std::string& key, Constructor constructor);
virtual void deregisterConstructor(const std::string& key);
virtual bool hasConstructor(const std::string& key) const;
virtual Constructor getConstructor(const std::string& key) const;
virtual T constructObject(const std::string& key) const;
virtual std::vector<std::string> available() const;
};
}
#endif /* FL_FACTORY_H */

View File

@ -1,51 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_DEFUZZIFIERFACTORY_H
#define FL_DEFUZZIFIERFACTORY_H
#include "fl/factory/ConstructionFactory.h"
#include "fl/defuzzifier/Defuzzifier.h"
#include "fl/defuzzifier/IntegralDefuzzifier.h"
#include "fl/defuzzifier/WeightedDefuzzifier.h"
namespace fl {
class FL_API DefuzzifierFactory : public ConstructionFactory<Defuzzifier*> {
public:
DefuzzifierFactory();
virtual ~DefuzzifierFactory() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(DefuzzifierFactory)
virtual Defuzzifier* constructDefuzzifier(const std::string& key,
int resolution, WeightedDefuzzifier::Type) const;
virtual Defuzzifier* constructDefuzzifier(const std::string& key, int resolution) const;
virtual Defuzzifier* constructDefuzzifier(const std::string& key, WeightedDefuzzifier::Type type);
};
}
#endif /* DEFUZZIFIERFACTORY_H */

View File

@ -1,81 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_FACTORYMANAGER_H
#define FL_FACTORYMANAGER_H
#include "fl/fuzzylite.h"
namespace fl {
class TNormFactory;
class SNormFactory;
class DefuzzifierFactory;
class TermFactory;
class HedgeFactory;
class FunctionFactory;
class FL_API FactoryManager {
protected:
static FactoryManager _instance;
FL_unique_ptr<TNormFactory> _tnorm;
FL_unique_ptr<SNormFactory> _snorm;
FL_unique_ptr<DefuzzifierFactory> _defuzzifier;
FL_unique_ptr<TermFactory> _term;
FL_unique_ptr<HedgeFactory> _hedge;
FL_unique_ptr<FunctionFactory> _function;
FactoryManager();
FactoryManager(TNormFactory* tnorm, SNormFactory* snorm,
DefuzzifierFactory* defuzzifier, TermFactory* term,
HedgeFactory* hedge, FunctionFactory* function);
FactoryManager(const FactoryManager& other);
FactoryManager& operator=(const FactoryManager& other);
FL_DEFAULT_MOVE(FactoryManager)
virtual ~FactoryManager();
public:
static FactoryManager* instance();
virtual void setTnorm(TNormFactory* tnorm);
virtual TNormFactory* tnorm() const;
virtual void setSnorm(SNormFactory* snorm);
virtual SNormFactory* snorm() const;
virtual void setDefuzzifier(DefuzzifierFactory* defuzzifier);
virtual DefuzzifierFactory* defuzzifier() const;
virtual void setTerm(TermFactory* term);
virtual TermFactory* term() const;
virtual void setHedge(HedgeFactory* hedge);
virtual HedgeFactory* hedge() const;
virtual void setFunction(FunctionFactory* function);
virtual FunctionFactory* function() const;
};
}
#endif /* FL_FACTORYMANAGER_H */

View File

@ -1,48 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_FUNCTIONFACTORY_H
#define FL_FUNCTIONFACTORY_H
#include "fl/factory/CloningFactory.h"
#include "fl/term/Function.h"
namespace fl {
class FunctionFactory : public CloningFactory<Function::Element*> {
public:
FunctionFactory();
virtual ~FunctionFactory() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(FunctionFactory)
virtual std::vector<std::string> availableOperators() const;
virtual std::vector<std::string> availableFunctions() const;
};
}
#endif /* FL_FUNCTIONFACTORY_H */

View File

@ -1,42 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_HEDGEFACTORY_H
#define FL_HEDGEFACTORY_H
#include "fl/factory/ConstructionFactory.h"
#include "fl/hedge/Hedge.h"
namespace fl {
class FL_API HedgeFactory : public ConstructionFactory<Hedge*> {
public:
HedgeFactory();
virtual ~HedgeFactory() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(HedgeFactory)
};
}
#endif /* FL_HEDGEFACTORY_H */

View File

@ -1,42 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_SNORMFACTORY_H
#define FL_SNORMFACTORY_H
#include "fl/factory/ConstructionFactory.h"
#include "fl/norm/SNorm.h"
namespace fl {
class FL_API SNormFactory : public ConstructionFactory<SNorm*> {
public:
SNormFactory();
virtual ~SNormFactory() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(SNormFactory)
};
}
#endif /* FL_SNORMFACTORY_H */

View File

@ -1,42 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_TNORMFACTORY_H
#define FL_TNORMFACTORY_H
#include "fl/factory/ConstructionFactory.h"
#include "fl/norm/TNorm.h"
namespace fl {
class FL_API TNormFactory : public ConstructionFactory<TNorm*> {
public:
TNormFactory();
virtual ~TNormFactory() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(TNormFactory)
};
}
#endif /* FL_TNORMFACTORY_H */

View File

@ -1,43 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_TERMFACTORY_H
#define FL_TERMFACTORY_H
#include "fl/factory/ConstructionFactory.h"
#include "fl/term/Term.h"
namespace fl {
class FL_API TermFactory : public ConstructionFactory<Term*> {
public:
TermFactory();
virtual ~TermFactory() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(TermFactory)
};
}
#endif /* FL_TERMFACTORY_H */

View File

@ -1,210 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_FUZZYLITE_H
#define FL_FUZZYLITE_H
#include <algorithm>
#include <cmath>
#include <iostream>
#include <sstream>
#include <limits>
#include <memory>
#ifndef FL_VERSION
#define FL_VERSION "?"
#endif
#ifndef FL_DATE
#define FL_DATE "?"
#endif
#ifndef FL_BUILD_PATH
#define FL_BUILD_PATH ""
#endif
#define FL__FILE__ std::string(__FILE__).substr(std::string(FL_BUILD_PATH).size())
#define FL_LOG_PREFIX FL__FILE__ << " [" << __LINE__ << "]:"
#define FL_AT FL__FILE__, __LINE__, __FUNCTION__
#define FL_LOG(message) {if (fl::fuzzylite::logging()){std::cout << FL_LOG_PREFIX << message << std::endl;}}
#define FL_LOGP(message) {if (fl::fuzzylite::logging()){std::cout << message << std::endl;}}
#define FL_DEBUG_BEGIN if (fl::fuzzylite::debug()){
#define FL_DEBUG_END }
#define FL_DBG(message) FL_DEBUG_BEGIN\
std::cout << FL__FILE__ << "::" << __FUNCTION__ << "[" << __LINE__ << "]:" \
<< message << std::endl;\
FL_DEBUG_END
#ifdef FL_WINDOWS
#include <ciso646> //alternative operator spellings:
//#define and &&
//#define or ||
//#define not !
//#define bitand &
//#define bitor |
//TODO: Address warning 4251 by exporting members?
//http://www.unknownroad.com/rtfm/VisualStudio/warningC4251.html
#ifdef _MSC_VER
#pragma warning (disable:4251)
#endif
//fuzzylite as a shared library is exported
//Applications linking with fuzzylite as a shared library need to import
//fuzzylite as a static library does not export or import
//Applications linking with fuzzylite as a static library do not import
#if defined(FL_EXPORT_LIBRARY)
#define FL_API __declspec(dllexport)
#elif defined(FL_IMPORT_LIBRARY)
#define FL_API __declspec(dllimport)
#else
#define FL_API
#endif
#else
#define FL_API
#endif
namespace fl {
#ifdef FL_USE_FLOAT
typedef float scalar;
#else
typedef double scalar;
#endif
const scalar nan = std::numeric_limits<scalar>::quiet_NaN();
const scalar inf = std::numeric_limits<scalar>::infinity();
#ifdef FL_CPP11
//C++11 defines
//Pointers
const std::nullptr_t null = nullptr;
#define FL_unique_ptr std::unique_ptr
#define FL_move_ptr(x) std::move(x)
//Identifiers
#define FL_IOVERRIDE override
#define FL_IFINAL final
#define FL_IDEFAULT = default
#define FL_IDELETE = delete
#define FL_INOEXCEPT noexcept
//Constructors
#define FL_DEFAULT_COPY(Class) \
Class(const Class&) = default; \
Class& operator=(const Class&) = default;
#define FL_DEFAULT_MOVE(Class) \
Class(Class&&) = default; \
Class& operator=(Class&&) = default;
#define FL_DEFAULT_COPY_AND_MOVE(Class) \
Class(const Class&) = default; \
Class& operator=(const Class&) = default;\
Class(Class&&) = default; \
Class& operator=(Class&&) = default;
#define FL_DISABLE_COPY(Class) \
Class(const Class &) = delete;\
Class &operator=(const Class &) = delete;
#else
//C++98 defines
//Pointers
const long null = 0L;
#define FL_unique_ptr std::auto_ptr
#define FL_move_ptr(x) x
//Identifiers
#define FL_IOVERRIDE
#define FL_IFINAL
#define FL_IDEFAULT
#define FL_IDELETE
#define FL_INOEXCEPT throw()
//Constructors
#define FL_DEFAULT_COPY(Class)
#define FL_DEFAULT_MOVE(Class)
#define FL_DEFAULT_COPY_AND_MOVE(Class)
#define FL_DISABLE_COPY(Class) \
Class(const Class &);\
Class &operator=(const Class &);
#endif
}
namespace fl {
class FL_API fuzzylite {
protected:
static int _decimals;
static scalar _macheps;
static bool _debug;
static bool _logging;
public:
static std::string name();
static std::string fullname();
static std::string version();
static std::string longVersion();
static std::string license();
static std::string author();
static std::string company();
static std::string website();
static std::string date();
static std::string platform();
static std::string floatingPoint();
static bool debug();
static void setDebug(bool debug);
static int decimals();
static void setDecimals(int decimals);
static scalar macheps();
static void setMachEps(scalar macheps);
static bool logging();
static void setLogging(bool logging);
};
}
#endif /* FL_FUZZYLITE_H */

View File

@ -1,47 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_ANY_H
#define FL_ANY_H
#include "fl/hedge/Hedge.h"
namespace fl {
//Only this hedge has virtual methods due to its special case use.
class FL_API Any : public Hedge {
public:
Any();
virtual ~Any() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Any)
virtual std::string name() const FL_IOVERRIDE;
virtual scalar hedge(scalar x) const FL_IOVERRIDE;
virtual Any* clone() const FL_IOVERRIDE;
static Hedge* constructor();
};
}
#endif /* FL_ANY_H */

View File

@ -1,42 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_EXTREMELY_H
#define FL_EXTREMELY_H
#include "fl/hedge/Hedge.h"
namespace fl {
class FL_API Extremely : public Hedge {
public:
std::string name() const;
scalar hedge(scalar x) const;
Extremely* clone() const;
static Hedge* constructor();
};
}
#endif /* FL_EXTREMELY_H */

View File

@ -1,51 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_HEDGE_H
#define FL_HEDGE_H
#include "fl/fuzzylite.h"
#include <string>
namespace fl {
class FL_API Hedge {
public:
Hedge() {
}
virtual ~Hedge() {
}
FL_DEFAULT_COPY_AND_MOVE(Hedge)
virtual std::string name() const = 0;
virtual scalar hedge(scalar x) const = 0;
virtual Hedge* clone() const = 0;
};
}
#endif /* FL_HEDGE_H */

View File

@ -1,42 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_NOT_H
#define FL_NOT_H
#include "fl/hedge/Hedge.h"
namespace fl {
class FL_API Not : public Hedge {
public:
std::string name() const FL_IOVERRIDE;
scalar hedge(scalar x) const FL_IOVERRIDE;
Not* clone() const FL_IOVERRIDE;
static Hedge* constructor();
};
}
#endif /* FL_NOT_H */

View File

@ -1,42 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_SELDOM_H
#define FL_SELDOM_H
#include "fl/hedge/Hedge.h"
namespace fl {
class FL_API Seldom : public Hedge {
public:
std::string name() const FL_IOVERRIDE;
scalar hedge(scalar x) const FL_IOVERRIDE;
Seldom* clone() const FL_IOVERRIDE;
static Hedge* constructor();
};
}
#endif /* FL_SELDOM_H */

View File

@ -1,42 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_SOMEWHAT_H
#define FL_SOMEWHAT_H
#include "fl/hedge/Hedge.h"
namespace fl {
class FL_API Somewhat : public Hedge {
public:
std::string name() const FL_IOVERRIDE;
scalar hedge(scalar x) const FL_IOVERRIDE;
Somewhat* clone() const FL_IOVERRIDE;
static Hedge* constructor();
};
}
#endif /* FL_SOMEWHAT_H */

View File

@ -1,42 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_VERY_H
#define FL_VERY_H
#include "fl/hedge/Hedge.h"
namespace fl {
class FL_API Very : public Hedge {
public:
std::string name() const FL_IOVERRIDE;
scalar hedge(scalar x) const FL_IOVERRIDE;
Very* clone() const FL_IOVERRIDE;
static Hedge* constructor();
};
}
#endif /* FL_VERY_H */

View File

@ -1,67 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_CPPEXPORTER_H
#define FL_CPPEXPORTER_H
#include "fl/imex/Exporter.h"
namespace fl {
class Engine;
class InputVariable;
class OutputVariable;
class Term;
class RuleBlock;
class Norm;
class Defuzzifier;
class Hedge;
class FL_API CppExporter : public Exporter {
protected:
bool _prefixNamespace;
virtual std::string fl(const std::string& clazz) const;
public:
CppExporter(bool prefixNamespace = false);
virtual ~CppExporter() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(CppExporter)
virtual std::string name() const FL_IOVERRIDE;
virtual std::string toString(const Engine* engine) const FL_IOVERRIDE;
virtual std::string toString(const InputVariable* inputVariable, const Engine* engine) const;
virtual std::string toString(const OutputVariable* outputVariable, const Engine* engine) const;
virtual std::string toString(const RuleBlock* ruleBlock, const Engine* engine) const;
virtual std::string toString(scalar value) const;
virtual std::string toString(const Hedge* hedge) const;
virtual std::string toString(const Term* term) const;
virtual std::string toString(const Norm* op) const;
virtual std::string toString(const Defuzzifier* defuzzifier) const;
virtual CppExporter* clone() const FL_IOVERRIDE;
};
}
#endif /* FL_CPPEXPORTER_H */

View File

@ -1,52 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_EXPORTER_H
#define FL_EXPORTER_H
#include "fl/fuzzylite.h"
#include <string>
namespace fl {
class Engine;
class FL_API Exporter {
public:
Exporter();
virtual ~Exporter();
FL_DEFAULT_COPY_AND_MOVE(Exporter)
virtual std::string toString(const Engine* engine) const = 0;
virtual void toFile(const std::string& path, const Engine* engine) const;
virtual std::string name() const = 0;
virtual Exporter* clone() const = 0;
};
}
#endif /* FL_EXPORTER_H */

View File

@ -1,60 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_FCLEXPORTER_H
#define FL_FCLEXPORTER_H
#include "fl/imex/Exporter.h"
namespace fl {
class TNorm;
class SNorm;
class Defuzzifier;
class Term;
class FL_API FclExporter : public Exporter {
protected:
std::string _indent;
public:
FclExporter(const std::string& indent = " ");
virtual ~FclExporter() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(FclExporter)
virtual void setIndent(const std::string& indent);
virtual std::string getIndent() const;
virtual std::string name() const FL_IOVERRIDE;
virtual std::string toString(const Engine* engine) const FL_IOVERRIDE;
virtual std::string toString(const TNorm* tnorm) const;
virtual std::string toString(const SNorm* snorm) const;
virtual std::string toString(const Defuzzifier* defuzzifier) const;
virtual std::string toString(const Term* term) const;
virtual FclExporter* clone() const FL_IOVERRIDE;
};
}
#endif /* FL_FCLEXPORTER_H */

View File

@ -1,74 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_FCLIMPORTER_H
#define FL_FCLIMPORTER_H
#include "fl/imex/Importer.h"
#include <string>
#include <utility>
#include <vector>
namespace fl {
class Norm;
class TNorm;
class SNorm;
class Term;
class Defuzzifier;
class FL_API FclImporter : public Importer {
public:
FclImporter();
virtual ~FclImporter() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(FclImporter)
virtual std::string name() const FL_IOVERRIDE;
virtual Engine* fromString(const std::string& fcl) const FL_IOVERRIDE;
virtual FclImporter* clone() const FL_IOVERRIDE;
protected:
virtual void processBlock(const std::string& tag, const std::string& block, Engine* engine) const;
virtual void processVar(const std::string& var, const std::string& block, Engine* engine)const;
virtual void processFuzzify(const std::string& block, Engine* engine)const;
virtual void processDefuzzify(const std::string& block, Engine* engine)const;
virtual void processRuleBlock(const std::string& block, Engine* engine)const;
virtual TNorm* parseTNorm(const std::string& line) const;
virtual SNorm* parseSNorm(const std::string& line) const;
virtual Term* parseTerm(const std::string& line, const Engine* engine) const;
virtual Defuzzifier* parseDefuzzifier(const std::string& line) const;
virtual std::pair<scalar, bool> parseDefaultValue(const std::string& line) const;
virtual std::pair<scalar, scalar> parseRange(const std::string& line) const;
virtual std::pair<bool, bool> parseLocks(const std::string& line) const;
virtual bool parseEnabled(const std::string& line) const;
};
}
#endif /* FL_FCLIMPORTER_H */

View File

@ -1,72 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_FISEXPORTER_H
#define FL_FISEXPORTER_H
#include "fl/imex/Exporter.h"
#include <vector>
namespace fl {
class TNorm;
class SNorm;
class Defuzzifier;
class Term;
class Rule;
class Proposition;
class Variable;
class FL_API FisExporter : public Exporter {
protected:
virtual std::string translate(const std::vector<Proposition*>& propositions,
const std::vector<Variable*> variables) const;
public:
FisExporter();
virtual ~FisExporter() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(FisExporter)
virtual std::string name() const FL_IOVERRIDE;
virtual std::string toString(const Engine* engine) const FL_IOVERRIDE;
virtual std::string toString(const TNorm* tnorm) const;
virtual std::string toString(const SNorm* snorm) const;
virtual std::string toString(const Defuzzifier* defuzzifier) const;
virtual std::string toString(const Term* term) const;
virtual std::string exportSystem(const Engine* engine) const;
virtual std::string exportInputs(const Engine* engine) const;
virtual std::string exportOutputs(const Engine* engine) const;
virtual std::string exportRules(const Engine* engine) const;
virtual std::string exportRule(const Rule* rule, const Engine* engine) const;
virtual FisExporter* clone() const FL_IOVERRIDE;
};
}
#endif /* FL_FISEXPORTER_H */

View File

@ -1,77 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_FISIMPORTER_H
#define FL_FISIMPORTER_H
#include "fl/imex/Importer.h"
#include <utility>
#include <vector>
namespace fl {
class Norm;
class TNorm;
class SNorm;
class Term;
class Defuzzifier;
class Variable;
class FL_API FisImporter : public Importer {
public:
FisImporter();
virtual ~FisImporter() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(FisImporter)
virtual std::string name() const FL_IOVERRIDE;
virtual Engine* fromString(const std::string& fcl) const FL_IOVERRIDE;
virtual FisImporter* clone() const FL_IOVERRIDE;
protected:
virtual void importSystem(const std::string& section, Engine* engine,
std::string& andMethod, std::string& orMethod,
std::string& impMethod, std::string& aggMethod,
std::string& defuzzMethod) const;
virtual void importInput(const std::string& section, Engine* engine) const;
virtual void importOutput(const std::string& section, Engine* engine) const;
virtual void importRules(const std::string& section, Engine* engine) const;
virtual std::string translateProposition(scalar code, Variable* variable) const;
virtual std::string extractTNorm(const std::string& tnorm) const;
virtual std::string extractSNorm(const std::string& tnorm) const;
virtual std::string extractDefuzzifier(const std::string& defuzzifier) const;
virtual Term* parseTerm(const std::string& line, const Engine* engine) const;
virtual Term* createInstance(const std::string& termClass, const std::string& name,
const std::vector<std::string>& params, const Engine* engine) const;
virtual std::pair<scalar, scalar> range(const std::string& range) const;
};
}
#endif /* FL_FISIMPORTER_H */

View File

@ -1,84 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_FLDEXPORTER_H
#define FL_FLDEXPORTER_H
#include "fl/imex/Exporter.h"
#include <vector>
namespace fl {
class Engine;
class InputVariable;
class OutputVariable;
class FL_API FldExporter : public Exporter {
protected:
std::string _separator;
bool _exportHeaders;
bool _exportInputValues;
bool _exportOutputValues;
public:
FldExporter(const std::string& separator = " ");
virtual ~FldExporter() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(FldExporter)
virtual std::string name() const FL_IOVERRIDE;
virtual void setSeparator(const std::string& separator);
virtual std::string getSeparator() const;
virtual void setExportHeader(bool exportHeaders);
virtual bool exportsHeader() const;
virtual void setExportInputValues(bool exportInputValues);
virtual bool exportsInputValues() const;
virtual void setExportOutputValues(bool exportOutputValues);
virtual bool exportsOutputValues() const;
virtual std::string header(const Engine* engine) const;
//WARNING: The engine will be const_casted in order to be processed!
virtual std::string toString(const Engine* engine) const FL_IOVERRIDE;
virtual std::string toString(Engine* engine, int maximumNumberOfResults) const;
virtual std::string toString(Engine* engine, const std::string& inputData) const;
using Exporter::toFile;
virtual void toFile(const std::string& path, Engine* engine, int maximumNumberOfResults) const;
virtual void toFile(const std::string& path, Engine* engine, const std::string& inputData) const;
virtual std::vector<scalar> parse(const std::string& x) const;
void write(Engine* engine, std::ostream& writer, int maximumNumberOfResults) const;
void write(Engine* engine, std::ostream& writer, std::istream& reader) const;
void write(Engine* engine, std::ostream& writer, const std::vector<scalar>& inputValues) const;
virtual FldExporter* clone() const FL_IOVERRIDE;
};
}
#endif /* FL_FLDEXPORTER_H */

View File

@ -1,83 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_FLLEXPORTER_H
#define FL_FLLEXPORTER_H
#include "fl/imex/Exporter.h"
#include <vector>
namespace fl {
class Variable;
class InputVariable;
class OutputVariable;
class RuleBlock;
class Rule;
class Norm;
class Defuzzifier;
class Term;
class FL_API FllExporter : public Exporter {
protected:
std::string _indent;
std::string _separator;
public:
FllExporter(const std::string& indent = " ", const std::string& separator = "\n");
virtual ~FllExporter() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(FllExporter)
virtual std::string name() const FL_IOVERRIDE;
virtual void setIndent(const std::string& indent);
virtual std::string getIndent() const;
virtual void setSeparator(const std::string& separator);
virtual std::string getSeparator() const;
virtual std::string toString(const Engine* engine) const FL_IOVERRIDE;
virtual std::string toString(const std::vector<Variable*>& variables) const;
virtual std::string toString(const std::vector<InputVariable*>& inputVariables) const;
virtual std::string toString(const std::vector<OutputVariable*>& outputVariables) const;
virtual std::string toString(const std::vector<RuleBlock*>& ruleBlocks) const;
virtual std::string toString(const Variable* variable) const;
virtual std::string toString(const InputVariable* inputVariable) const;
virtual std::string toString(const OutputVariable* outputVariable) const;
virtual std::string toString(const RuleBlock* ruleBlock) const;
virtual std::string toString(const Rule* rule) const;
virtual std::string toString(const Norm* norm) const;
virtual std::string toString(const Defuzzifier* defuzzifier) const;
virtual std::string toString(const Term* term) const;
virtual FllExporter* clone() const FL_IOVERRIDE;
};
}
#endif /* FL_FLLEXPORTER_H */

View File

@ -1,77 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_FLLIMPORTER_H
#define FL_FLLIMPORTER_H
#include "fl/imex/Importer.h"
#include <utility>
namespace fl {
class TNorm;
class SNorm;
class Term;
class Defuzzifier;
class FL_API FllImporter : public Importer {
protected:
std::string _separator;
public:
FllImporter(const std::string& separator = "\n");
virtual ~FllImporter() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(FllImporter)
virtual void setSeparator(const std::string& separator);
virtual std::string getSeparator() const;
virtual std::string name() const FL_IOVERRIDE;
virtual Engine* fromString(const std::string& fll) const FL_IOVERRIDE;
virtual FllImporter* clone() const FL_IOVERRIDE;
protected:
virtual void process(const std::string& tag, const std::string& block, Engine* engine) const;
virtual void processInputVariable(const std::string& block, Engine* engine) const;
virtual void processOutputVariable(const std::string& block, Engine* engine) const;
virtual void processRuleBlock(const std::string& block, Engine* engine) const;
virtual TNorm* parseTNorm(const std::string& name) const;
virtual SNorm* parseSNorm(const std::string& name) const;
virtual Term* parseTerm(const std::string& text, Engine* engine) const;
virtual Defuzzifier* parseDefuzzifier(const std::string& line) const;
virtual std::pair<scalar, scalar> parseRange(const std::string& line) const;
virtual bool parseBoolean(const std::string& boolean) const;
virtual std::pair<std::string, std::string> parseKeyValue(const std::string& text,
char separator = ':') const;
virtual std::string clean(const std::string& line) const;
};
}
#endif /* FL_FLLIMPORTER_H */

View File

@ -1,52 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_IMPORTER_H
#define FL_IMPORTER_H
#include "fl/fuzzylite.h"
#include <string>
namespace fl {
class Engine;
class FL_API Importer {
public:
Importer();
virtual ~Importer();
FL_DEFAULT_COPY_AND_MOVE(Importer)
virtual Engine* fromString(const std::string& s) const = 0;
virtual Engine* fromFile(const std::string& path) const;
virtual std::string name() const = 0;
virtual Importer* clone() const = 0;
};
}
#endif /* IMPORTER_H */

View File

@ -1,66 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_JAVAEXPORTER_H
#define FL_JAVAEXPORTER_H
#include "fl/imex/Exporter.h"
namespace fl {
class Engine;
class InputVariable;
class OutputVariable;
class RuleBlock;
class Term;
class Defuzzifier;
class SNorm;
class TNorm;
class FL_API JavaExporter : public Exporter {
public:
JavaExporter();
virtual ~JavaExporter() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(JavaExporter)
virtual std::string name() const FL_IOVERRIDE;
virtual std::string toString(const Engine* engine) const FL_IOVERRIDE;
virtual std::string toString(const InputVariable* inputVariable, const Engine* engine) const;
virtual std::string toString(const OutputVariable* outputVariable, const Engine* engine) const;
virtual std::string toString(const RuleBlock* ruleBlock, const Engine* engine) const;
virtual std::string toString(const Term* term) const;
virtual std::string toString(const Defuzzifier* defuzzifier) const;
virtual std::string toString(const SNorm* norm) const;
virtual std::string toString(const TNorm* norm) const;
virtual std::string toString(scalar value) const;
virtual JavaExporter* clone() const FL_IOVERRIDE;
};
}
#endif /* FL_JAVAEXPORTER_H */

View File

@ -1,55 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_NORM_H
#define FL_NORM_H
#include "fl/fuzzylite.h"
#include "fl/Operation.h"
#include <string>
namespace fl {
class FL_API Norm {
public:
Norm() {
}
virtual ~Norm() {
}
FL_DEFAULT_COPY_AND_MOVE(Norm)
virtual std::string className() const = 0;
virtual scalar compute(scalar a, scalar b) const = 0;
virtual Norm* clone() const = 0;
};
}
#endif /* FL_NORM_H */

View File

@ -1,47 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_SNORM_H
#define FL_SNORM_H
#include "fl/norm/Norm.h"
namespace fl {
class FL_API SNorm : public Norm {
public:
SNorm() {
}
virtual ~SNorm() FL_IOVERRIDE {
}
FL_DEFAULT_COPY_AND_MOVE(SNorm)
virtual SNorm* clone() const FL_IOVERRIDE = 0;
};
}
#endif /* FL_SNORM_H */

View File

@ -1,47 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_TNORM_H
#define FL_TNORM_H
#include "fl/norm/Norm.h"
namespace fl {
class FL_API TNorm : public Norm {
public:
TNorm() {
}
virtual ~TNorm() FL_IOVERRIDE {
}
FL_DEFAULT_COPY_AND_MOVE(TNorm)
virtual TNorm* clone() const FL_IOVERRIDE = 0;
};
}
#endif /* TNORM_H */

View File

@ -1,46 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_ALGEBRAICSUM_H
#define FL_ALGEBRAICSUM_H
#include "fl/norm/SNorm.h"
namespace fl {
class FL_API AlgebraicSum : public SNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
AlgebraicSum* clone() const FL_IOVERRIDE;
static SNorm* constructor();
};
}
#endif /* FL_ALGEBRAICSUM_H */

View File

@ -1,43 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_BOUNDEDSUM_H
#define FL_BOUNDEDSUM_H
#include "fl/norm/SNorm.h"
namespace fl {
class FL_API BoundedSum : public SNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
BoundedSum* clone() const FL_IOVERRIDE;
static SNorm* constructor();
};
}
#endif /* FL_BOUNDEDSUM_H */

View File

@ -1,43 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_DRASTICSUM_H
#define FL_DRASTICSUM_H
#include "fl/norm/SNorm.h"
namespace fl {
class FL_API DrasticSum : public SNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
DrasticSum* clone() const FL_IOVERRIDE;
static SNorm* constructor();
};
}
#endif /* FL_DRASTICSUM_H */

View File

@ -1,44 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_EINSTEINSUM_H
#define FL_EINSTEINSUM_H
#include "fl/norm/SNorm.h"
namespace fl {
class FL_API EinsteinSum : public SNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
EinsteinSum* clone() const FL_IOVERRIDE;
static SNorm* constructor();
};
}
#endif /* FL_EINSTEINSUM_H */

View File

@ -1,44 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_HAMACHERSUM_H
#define FL_HAMACHERSUM_H
#include "fl/norm/SNorm.h"
namespace fl {
class FL_API HamacherSum : public SNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
HamacherSum* clone() const FL_IOVERRIDE;
static SNorm* constructor();
};
}
#endif /* FL_HAMACHERSUM_H */

View File

@ -1,45 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_MAXIMUM_H
#define FL_MAXIMUM_H
#include "fl/norm/SNorm.h"
namespace fl {
class FL_API Maximum : public SNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
Maximum* clone() const FL_IOVERRIDE;
static SNorm* constructor();
};
}
#endif /* FL_MAXIMUM_H */

View File

@ -1,43 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_NILPOTENTMAXIMUM_H
#define FL_NILPOTENTMAXIMUM_H
#include "fl/norm/SNorm.h"
namespace fl {
class FL_API NilpotentMaximum : public SNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
NilpotentMaximum* clone() const FL_IOVERRIDE;
static SNorm* constructor();
};
}
#endif /* FL_NILPOTENTMAXIMUM_H */

View File

@ -1,44 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_NORMALIZEDSUM_H
#define FL_NORMALIZEDSUM_H
#include "fl/norm/SNorm.h"
namespace fl {
class FL_API NormalizedSum : public SNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
NormalizedSum* clone() const FL_IOVERRIDE;
static SNorm* constructor();
};
}
#endif /* FL_NORMALIZEDSUM_H */

View File

@ -1,45 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_ALGEBRAICPRODUCT_H
#define FL_ALGEBRAICPRODUCT_H
#include "fl/norm/TNorm.h"
namespace fl {
class FL_API AlgebraicProduct : public TNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
AlgebraicProduct* clone() const FL_IOVERRIDE;
static TNorm* constructor();
};
}
#endif /* FL_ALGEBRAICPRODUCT_H */

View File

@ -1,44 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_BOUNDEDDIFFERENCE_H
#define FL_BOUNDEDDIFFERENCE_H
#include "fl/norm/TNorm.h"
namespace fl {
class FL_API BoundedDifference : public TNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
BoundedDifference* clone() const FL_IOVERRIDE;
static TNorm* constructor();
};
}
#endif /* FL_BOUNDEDDIFFERENCE_H */

View File

@ -1,45 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_DRASTICPRODUCT_H
#define FL_DRASTICPRODUCT_H
#include "fl/norm/TNorm.h"
namespace fl {
class FL_API DrasticProduct : public TNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
DrasticProduct* clone() const FL_IOVERRIDE;
static TNorm* constructor();
};
}
#endif /* FL_DRASTICPRODUCT_H */

View File

@ -1,45 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_EINSTEINPRODUCT_H
#define FL_EINSTEINPRODUCT_H
#include "fl/norm/TNorm.h"
namespace fl {
class FL_API EinsteinProduct : public TNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
EinsteinProduct* clone() const FL_IOVERRIDE;
static TNorm* constructor();
};
}
#endif /* FL_EINSTEINPRODUCT_H */

View File

@ -1,44 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_HAMACHERPRODUCT_H
#define FL_HAMACHERPRODUCT_H
#include "fl/norm/TNorm.h"
namespace fl {
class FL_API HamacherProduct : public TNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
HamacherProduct* clone() const FL_IOVERRIDE;
static TNorm* constructor();
};
}
#endif /* FL_HAMACHERPRODUCT_H */

View File

@ -1,44 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_MINIMUM_H
#define FL_MINIMUM_H
#include "fl/norm/TNorm.h"
namespace fl {
class FL_API Minimum : public TNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
Minimum* clone() const FL_IOVERRIDE;
static TNorm* constructor();
};
}
#endif /* FL_MINIMUM_H */

View File

@ -1,43 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_NILPOTENTMINIMUM_H
#define FL_NILPOTENTMINIMUM_H
#include "fl/norm/TNorm.h"
namespace fl {
class FL_API NilpotentMinimum : public TNorm {
public:
std::string className() const FL_IOVERRIDE;
scalar compute(scalar a, scalar b) const FL_IOVERRIDE;
NilpotentMinimum* clone() const FL_IOVERRIDE;
static TNorm* constructor();
};
}
#endif /* FL_NILPOTENTMINIMUM_H */

View File

@ -1,77 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_ANTECEDENT_H
#define FL_ANTECEDENT_H
#include "fl/fuzzylite.h"
#include <string>
namespace fl {
class Engine;
class Rule;
class TNorm;
class SNorm;
class Expression;
class FL_API Antecedent {
protected:
std::string _text;
Expression* _expression;
public:
Antecedent();
virtual ~Antecedent();
virtual void setText(const std::string& text);
virtual std::string getText() const;
virtual Expression* getExpression() const;
virtual bool isLoaded() const;
virtual void unload();
virtual void load(Rule* rule, const Engine* engine);
virtual void load(const std::string& antecedent, Rule* rule, const Engine* engine);
virtual scalar activationDegree(const TNorm* conjunction, const SNorm* disjunction,
const Expression* node) const;
virtual scalar activationDegree(const TNorm* conjunction, const SNorm* disjunction) const;
virtual std::string toString() const;
virtual std::string toPrefix(const Expression* node = fl::null) const;
virtual std::string toInfix(const Expression* node = fl::null) const;
virtual std::string toPostfix(const Expression* node = fl::null) const;
private:
FL_DISABLE_COPY(Antecedent)
};
}
#endif /* FL_ANTECEDENT_H */

View File

@ -1,68 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_CONSEQUENT_H
#define FL_CONSEQUENT_H
#include "fl/fuzzylite.h"
#include <string>
#include <vector>
namespace fl {
class Engine;
class Rule;
class Proposition;
class TNorm;
class FL_API Consequent {
protected:
std::string _text;
std::vector<Proposition*> _conclusions;
public:
Consequent();
virtual ~Consequent();
virtual void setText(const std::string& text);
virtual std::string getText() const;
virtual const std::vector<Proposition*>& conclusions() const;
virtual bool isLoaded();
virtual void unload();
virtual void load(Rule* rule, const Engine* engine);
virtual void load(const std::string& consequent, Rule* rule, const Engine* engine);
virtual void modify(scalar activationDegree, const TNorm* activation);
virtual std::string toString() const;
private:
FL_DISABLE_COPY(Consequent)
};
}
#endif /* FL_CONSEQUENT_H */

View File

@ -1,84 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_EXPRESSION_H
#define FL_EXPRESSION_H
#include "fl/fuzzylite.h"
#include <string>
#include <vector>
namespace fl {
class Variable;
class Hedge;
class Term;
class FL_API Expression {
public:
Expression();
virtual ~Expression();
virtual std::string toString() const = 0;
private:
FL_DISABLE_COPY(Expression)
};
class FL_API Proposition : public Expression {
public:
Variable* variable;
std::vector<Hedge*> hedges;
Term* term;
Proposition();
virtual ~Proposition() FL_IOVERRIDE;
virtual std::string toString() const FL_IOVERRIDE;
private:
FL_DISABLE_COPY(Proposition)
};
class FL_API Operator : public Expression {
public:
std::string name;
Expression* left;
Expression* right;
Operator();
virtual ~Operator() FL_IOVERRIDE;
virtual std::string toString() const FL_IOVERRIDE;
private:
FL_DISABLE_COPY(Operator)
};
}
#endif /* FL_FUZZYEXPRESSION_H */

View File

@ -1,119 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_RULE_H
#define FL_RULE_H
#include "fl/fuzzylite.h"
#include <map>
#include <string>
namespace fl {
class Engine;
class Antecedent;
class Consequent;
class Hedge;
class TNorm;
class SNorm;
class FL_API Rule {
protected:
std::string _text;
scalar _weight;
FL_unique_ptr<Antecedent> _antecedent;
FL_unique_ptr<Consequent> _consequent;
std::map<std::string, Hedge*> _hedges;
public:
Rule(const std::string& text = "", scalar weight = 1.0);
Rule(const Rule& other);
Rule& operator=(const Rule& other);
virtual ~Rule();
FL_DEFAULT_MOVE(Rule)
virtual void setText(const std::string& text);
virtual std::string getText() const;
virtual void setWeight(scalar weight);
virtual scalar getWeight() const;
virtual void setAntecedent(Antecedent* antecedent);
virtual Antecedent* getAntecedent() const;
virtual void setConsequent(Consequent* consequent);
virtual Consequent* getConsequent() const;
virtual void addHedge(Hedge* hedge);
virtual Hedge* getHedge(const std::string& name) const;
virtual Hedge* removeHedge(const std::string& hedge);
virtual bool hasHedge(const std::string& name) const;
virtual int numberOfHedges() const;
virtual void setHedges(const std::map<std::string, Hedge*>& hedges);
virtual const std::map<std::string, Hedge*>& hedges() const;
virtual std::map<std::string, Hedge*>& hedges();
virtual scalar activationDegree(const TNorm* conjunction, const SNorm* disjunction) const;
virtual void activate(scalar degree, const TNorm* activation) const;
virtual std::string toString() const;
virtual bool isLoaded() const;
virtual void unload();
virtual void load(const Engine* engine);
virtual void load(const std::string& rule, const Engine* engine);
static Rule* parse(const std::string& rule, const Engine* engine);
static std::string ifKeyword() {
return "if";
}
static std::string isKeyword() {
return "is";
}
static std::string thenKeyword() {
return "then";
}
static std::string andKeyword() {
return "and";
}
static std::string orKeyword() {
return "or";
}
static std::string withKeyword() {
return "with";
}
};
}
#endif /* FL_RULE_H */

View File

@ -1,97 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_RULEBLOCK_H
#define FL_RULEBLOCK_H
#include "fl/fuzzylite.h"
#include <string>
#include <vector>
namespace fl {
class Engine;
class Rule;
class TNorm;
class SNorm;
class FL_API RuleBlock {
private:
void copyFrom(const RuleBlock& source);
protected:
std::vector<Rule*> _rules;
std::string _name;
FL_unique_ptr<TNorm> _conjunction;
FL_unique_ptr<SNorm> _disjunction;
FL_unique_ptr<TNorm> _activation;
bool _enabled;
public:
RuleBlock(const std::string& name = "");
RuleBlock(const RuleBlock& other);
RuleBlock& operator=(const RuleBlock& other);
virtual ~RuleBlock();
FL_DEFAULT_MOVE(RuleBlock)
virtual void activate();
virtual void setName(std::string name);
virtual std::string getName() const;
virtual void setConjunction(TNorm* conjunction);
virtual TNorm* getConjunction() const;
virtual void setDisjunction(SNorm* disjunction);
virtual SNorm* getDisjunction() const;
virtual void setActivation(TNorm* activation);
virtual TNorm* getActivation() const;
virtual void setEnabled(bool enabled);
virtual bool isEnabled() const;
virtual void unloadRules() const;
virtual void loadRules(const Engine* engine);
virtual void reloadRules(const Engine* engine);
virtual std::string toString() const;
/**
* Operations for iterable datatype _rules
*/
virtual void addRule(Rule* rule);
virtual void insertRule(Rule* rule, int index);
virtual Rule* getRule(int index) const;
virtual Rule* removeRule(int index);
virtual int numberOfRules() const;
virtual void setRules(const std::vector<Rule*>& rules);
virtual const std::vector<Rule*>& rules() const;
virtual std::vector<Rule*>& rules();
};
}
#endif /* RULEBLOCK_H */

View File

@ -1,94 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_ACCUMULATED_H
#define FL_ACCUMULATED_H
#include "fl/term/Term.h"
#include <vector>
namespace fl {
class Activated;
class SNorm;
class TNorm;
class FL_API Accumulated : public Term {
private:
void copyFrom(const Accumulated& source);
protected:
std::vector<Activated*> _terms;
scalar _minimum, _maximum;
FL_unique_ptr<SNorm> _accumulation;
public:
Accumulated(const std::string& name = "",
scalar minimum = fl::nan,
scalar maximum = fl::nan,
SNorm* accumulation = fl::null);
Accumulated(const Accumulated& other);
Accumulated& operator=(const Accumulated& other);
virtual ~Accumulated() FL_IOVERRIDE;
FL_DEFAULT_MOVE(Accumulated)
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
virtual Accumulated* clone() const FL_IOVERRIDE;
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual scalar activationDegree(const Term* forTerm) const;
virtual std::string toString() const FL_IOVERRIDE;
virtual void setMinimum(scalar minimum);
virtual scalar getMinimum() const;
virtual void setMaximum(scalar maximum);
virtual scalar getMaximum() const;
virtual void setRange(scalar minimum, scalar maximum);
virtual scalar range() const;
virtual void setAccumulation(SNorm* accumulation);
virtual SNorm* getAccumulation() const;
/**
* Operations for std::vector _terms
*/
virtual void addTerm(const Term* term, scalar degree, const TNorm* activation);
virtual void addTerm(Activated* term);
virtual Activated* getTerm(int index) const;
virtual Activated* removeTerm(int index);
virtual int numberOfTerms() const;
virtual const std::vector<Activated*>& terms() const;
virtual std::vector<Activated*>& terms();
virtual bool isEmpty() const;
virtual void clear();
};
}
#endif /* FL_ACCUMULATED_H */

View File

@ -1,65 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_ACTIVATED_H
#define FL_ACTIVATED_H
#include "fl/term/Term.h"
namespace fl {
class TNorm;
class FL_API Activated : public Term {
protected:
const Term* _term;
scalar _degree;
const TNorm* _activation;
public:
Activated(const Term* term = fl::null, scalar degree = 1.0,
const TNorm* activationOperator = fl::null);
virtual ~Activated() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Activated)
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual std::string toString() const FL_IOVERRIDE;
virtual void setTerm(const Term* term);
virtual const Term* getTerm() const;
virtual void setDegree(scalar degree);
virtual scalar getDegree() const;
virtual void setActivation(const TNorm* activation);
virtual const TNorm* getActivation() const;
virtual Activated* clone() const FL_IOVERRIDE;
};
}
#endif /* FL_ACTIVATED_H */

View File

@ -1,68 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_BELL_H
#define FL_BELL_H
#include "fl/term/Term.h"
namespace fl {
class FL_API Bell : public Term {
protected:
scalar _center;
scalar _width;
scalar _slope;
public:
Bell(const std::string& name = "",
scalar center = fl::nan,
scalar width = fl::nan,
scalar slope = fl::nan,
scalar height = 1.0);
virtual ~Bell() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Bell)
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual void setCenter(scalar center);
virtual scalar getCenter() const;
virtual void setWidth(scalar width);
virtual scalar getWidth() const;
virtual void setSlope(scalar slope);
virtual scalar getSlope() const;
virtual Bell* clone() const FL_IOVERRIDE;
static Term* constructor();
};
}
#endif /* FL_BELL_H */

View File

@ -1,64 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_CONCAVE_H
#define FL_CONCAVE_H
#include "fl/term/Term.h"
namespace fl {
class FL_API Concave : public Term {
protected:
scalar _inflection, _end;
public:
Concave(const std::string& name = "",
scalar inflection = fl::nan,
scalar end = fl::nan,
scalar height = 1.0);
virtual ~Concave() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Concave)
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual void setInflection(scalar inflection);
virtual scalar getInflection() const;
virtual void setEnd(scalar end);
virtual scalar getEnd() const;
virtual Concave* clone() const FL_IOVERRIDE;
static Term* constructor();
};
}
#endif /* FL_CONCAVE_H */

View File

@ -1,58 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_CONSTANT_H
#define FL_CONSTANT_H
#include "fl/term/Term.h"
namespace fl {
class FL_API Constant : public Term {
protected:
scalar _value;
public:
Constant(const std::string& name = "",
scalar value = fl::nan);
virtual ~Constant() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Constant)
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual void setValue(scalar value);
virtual scalar getValue() const;
virtual Constant* clone() const FL_IOVERRIDE;
static Term* constructor();
};
}
#endif /* FL_CONSTANT_H */

View File

@ -1,62 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_COSINE_H
#define FL_COSINE_H
#include "fl/term/Term.h"
namespace fl {
class FL_API Cosine : public Term {
protected:
scalar _center, _width;
public:
Cosine(const std::string& name = "",
scalar center = fl::nan,
scalar width = fl::nan,
scalar height = 1.0);
virtual ~Cosine() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Cosine)
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual void setCenter(scalar center);
virtual scalar getCenter() const;
virtual void setWidth(scalar width);
virtual scalar getWidth() const;
virtual Cosine* clone() const FL_IOVERRIDE;
static Term* constructor();
};
}
#endif /* FL_COSINE_H */

View File

@ -1,81 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_DISCRETE_H
#define FL_DISCRETE_H
#include "fl/term/Term.h"
#include <vector>
#include <utility>
namespace fl {
class FL_API Discrete : public Term {
public:
typedef std::pair<scalar, scalar> Pair;
protected:
std::vector<Pair> _xy;
public:
Discrete(const std::string& name = "",
const std::vector<Pair>& xy = std::vector<Pair>(),
scalar height = 1.0);
virtual ~Discrete() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Discrete)
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
//Warning: this method is unsafe. Make sure you use it correctly.
template <typename T>
static Discrete* create(const std::string& name, int argc,
T x1, T y1, ...); // throw (fl::Exception);
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual void setXY(const std::vector<Pair>& pairs);
virtual const std::vector<Pair>& xy() const;
virtual std::vector<Pair>& xy();
virtual const Pair& xy(int index) const;
virtual Pair& xy(int index);
static std::vector<scalar> toVector(const std::vector<Pair>& xy);
static std::vector<Pair> toPairs(const std::vector<scalar>& xy);
static std::vector<Pair> toPairs(const std::vector<scalar>& xy,
scalar missingValue) FL_INOEXCEPT;
static std::string formatXY(const std::vector<Pair>& xy,
const std::string& prefix = "(", const std::string& innerSeparator = ",",
const std::string& postfix = ")", const std::string& outerSeparator = " ");
virtual Discrete* clone() const FL_IOVERRIDE;
static Term* constructor();
};
}
#endif /* FL_DISCRETE_H */

View File

@ -1,171 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_FUNCTION_H
#define FL_FUNCTION_H
#include "fl/term/Term.h"
#include <map>
#include <string>
namespace fl {
class Engine;
class FL_API Function : public Term {
/****************************
* Parsing Elements
****************************/
public:
typedef scalar(*Unary)(scalar);
typedef scalar(*Binary)(scalar, scalar);
struct FL_API Element {
enum Type {
OPERATOR, FUNCTION
};
std::string name;
std::string description;
Type type;
Unary unary;
Binary binary;
int arity;
int precedence; //Operator
int associativity;
Element(const std::string& name, const std::string& description, Type type);
Element(const std::string& name, const std::string& description,
Type type, Unary unary, int precedence = 0, int associativity = -1);
Element(const std::string& name, const std::string& description,
Type type, Binary binary, int precedence = 0, int associativity = -1);
virtual ~Element();
FL_DEFAULT_COPY_AND_MOVE(Element)
virtual bool isOperator() const;
virtual bool isFunction() const;
virtual Element* clone() const;
virtual std::string toString() const;
};
/**************************
* Tree elements, wrap Elements into Nodes.
**************************/
struct FL_API Node {
FL_unique_ptr<Element> element;
FL_unique_ptr<Node> left;
FL_unique_ptr<Node> right;
std::string variable;
scalar value;
Node(Element* element, Node* left = fl::null, Node* right = fl::null);
Node(const std::string& variable);
Node(scalar value);
Node(const Node& source);
Node& operator=(const Node& rhs);
virtual ~Node();
FL_DEFAULT_MOVE(Node)
virtual scalar evaluate(const std::map<std::string, scalar>*
variables = fl::null) const;
virtual Node* clone() const;
virtual std::string toString() const;
virtual std::string toPrefix(const Node* node = fl::null) const;
virtual std::string toInfix(const Node* node = fl::null) const;
virtual std::string toPostfix(const Node* node = fl::null) const;
private:
void copyFrom(const Node& source);
};
/******************************
* Term
******************************/
protected:
FL_unique_ptr<Node> _root;
std::string _formula;
const Engine* _engine;
public:
mutable std::map<std::string, scalar> variables;
Function(const std::string& name = "",
const std::string& formula = "", const Engine* engine = fl::null);
Function(const Function& other);
Function& operator=(const Function& other);
virtual ~Function() FL_IOVERRIDE;
FL_DEFAULT_MOVE(Function)
static Function* create(const std::string& name,
const std::string& formula,
const Engine* engine = fl::null); // throw (fl::Exception);
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual scalar evaluate(const std::map<std::string, scalar>* variables) const;
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
virtual void setFormula(const std::string& formula);
virtual std::string getFormula() const;
virtual void setEngine(const Engine* engine);
virtual const Engine* getEngine() const;
virtual Node* root() const;
virtual bool isLoaded() const;
virtual void unload();
virtual void load(); // throw (fl::Exception);
virtual void load(const std::string& formula); // throw (fl::Exception);
virtual void load(const std::string& formula, const Engine* engine); // throw (fl::Exception);
virtual Node* parse(const std::string& formula); // throw (fl::Exception);
virtual std::string toPostfix(const std::string& formula) const; //throw (fl::Exception);
virtual std::string space(const std::string& formula) const;
virtual Function* clone() const FL_IOVERRIDE;
static Term* constructor();
static void main();
};
}
#endif /* FL_FUNCTION_H */

View File

@ -1,63 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_GAUSSIAN_H
#define FL_GAUSSIAN_H
#include "fl/term/Term.h"
namespace fl {
class FL_API Gaussian : public Term {
protected:
scalar _mean;
scalar _standardDeviation;
public:
Gaussian(const std::string& name = "",
scalar mean = fl::nan,
scalar standardDeviation = fl::nan,
scalar height = 1.0);
virtual ~Gaussian() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Gaussian)
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual void setMean(scalar c);
virtual scalar getMean() const;
virtual void setStandardDeviation(scalar sigma);
virtual scalar getStandardDeviation() const;
virtual Gaussian* clone() const FL_IOVERRIDE;
static Term* constructor();
};
}
#endif /* FL_GAUSSIAN_H */

View File

@ -1,73 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_GAUSSIANPRODUCT_H
#define FL_GAUSSIANPRODUCT_H
#include "fl/term/Term.h"
namespace fl {
class FL_API GaussianProduct : public Term {
protected:
scalar _meanA;
scalar _standardDeviationA;
scalar _meanB;
scalar _standardDeviationB;
public:
GaussianProduct(const std::string& name = "",
scalar meanA = fl::nan,
scalar standardDeviationA = fl::nan,
scalar meanB = fl::nan,
scalar standardDeviationB = fl::nan,
scalar height = 1.0);
virtual ~GaussianProduct() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(GaussianProduct)
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual void setMeanA(scalar meanA);
virtual scalar getMeanA() const;
virtual void setStandardDeviationA(scalar sigmaA);
virtual scalar getStandardDeviationA() const;
virtual void setMeanB(scalar meanB);
virtual scalar getMeanB() const;
virtual void setStandardDeviationB(scalar sigmaB);
virtual scalar getStandardDeviationB() const;
virtual GaussianProduct* clone() const FL_IOVERRIDE;
static Term* constructor();
};
}
#endif /* FL_GAUSSIANPRODUCT_H */

View File

@ -1,72 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_LINEAR_H
#define FL_LINEAR_H
#include "fl/term/Term.h"
namespace fl {
class Engine;
class FL_API Linear : public Term {
protected:
std::vector<scalar> _coefficients;
const Engine* _engine;
public:
Linear(const std::string& name = "",
const std::vector<scalar>& coefficients = std::vector<scalar>(),
const Engine* engine = fl::null);
virtual ~Linear() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Linear)
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual void set(const std::vector<scalar>& coeffs, const Engine* engine);
virtual void setCoefficients(const std::vector<scalar>& coeffs);
virtual const std::vector<scalar>& coefficients() const;
virtual std::vector<scalar>& coefficients();
virtual void setEngine(const Engine* engine);
virtual const Engine* getEngine() const;
virtual Linear* clone() const FL_IOVERRIDE;
static Term* constructor();
//Warning: this method is unsafe, make sure you use it correctly.
template <typename T>
static Linear* create(const std::string& name, const Engine* engine,
T firstCoefficient, ...); // throw (fl::Exception);
};
}
#endif /* FL_LINEAR_H */

View File

@ -1,74 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_PISHAPE_H
#define FL_PISHAPE_H
#include "fl/term/Term.h"
namespace fl {
class FL_API PiShape : public Term {
protected:
scalar _bottomLeft;
scalar _topLeft;
scalar _topRight;
scalar _bottomRight;
public:
PiShape(const std::string& name = "",
scalar bottomLeft = fl::nan,
scalar topLeft = fl::nan,
scalar topRight = fl::nan,
scalar bottomRight = fl::nan,
scalar height = 1.0);
virtual ~PiShape() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(PiShape)
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual void setBottomLeft(scalar a);
virtual scalar getBottomLeft() const;
virtual void setTopLeft(scalar b);
virtual scalar getTopLeft() const;
virtual void setTopRight(scalar d);
virtual scalar getTopRight() const;
virtual void setBottomRight(scalar c);
virtual scalar getBottomRight() const;
virtual PiShape* clone() const FL_IOVERRIDE;
static Term* constructor();
};
}
#endif /* FL_PISHAPE_H */

View File

@ -1,68 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_RAMP_H
#define FL_RAMP_H
#include "fl/term/Term.h"
namespace fl {
class FL_API Ramp : public Term {
protected:
scalar _start, _end;
public:
enum Direction {
POSITIVE, ZERO, NEGATIVE
};
Ramp(const std::string& name = "",
scalar start = fl::nan,
scalar end = fl::nan,
scalar height = 1.0);
virtual ~Ramp() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Ramp)
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual void setStart(scalar start);
virtual scalar getStart() const;
virtual void setEnd(scalar end);
virtual scalar getEnd() const;
virtual Direction direction() const;
virtual Ramp* clone() const FL_IOVERRIDE;
static Term* constructor();
};
}
#endif /* FL_RAMP_H */

View File

@ -1,62 +0,0 @@
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
fuzzylite is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite is a trademark of FuzzyLite Limited.
*/
#ifndef FL_RECTANGLE_H
#define FL_RECTANGLE_H
#include "fl/term/Term.h"
namespace fl {
class FL_API Rectangle : public Term {
protected:
scalar _start, _end;
public:
Rectangle(const std::string& name = "",
scalar start = fl::nan,
scalar end = fl::nan,
scalar height = 1.0);
virtual ~Rectangle() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Rectangle)
virtual std::string className() const FL_IOVERRIDE;
virtual std::string parameters() const FL_IOVERRIDE;
virtual void configure(const std::string& parameters) FL_IOVERRIDE;
virtual scalar membership(scalar x) const FL_IOVERRIDE;
virtual void setStart(scalar start);
virtual scalar getStart() const;
virtual void setEnd(scalar end);
virtual scalar getEnd() const;
virtual Rectangle* clone() const FL_IOVERRIDE;
static Term* constructor();
};
}
#endif /* FL_RECTANGLE_H */

Some files were not shown because too many files have changed in this diff Show More