Metadata-Version: 2.1
Name: pyfuzzylite
Version: 8.0.0
Summary: a fuzzy logic control library in Python
Home-page: https://github.com/fuzzylite/pyfuzzylite.git
License: Proprietary
Keywords: fuzzy logic control,soft computing,artificial intelligence
Author: Juan Rada-Vilela, PhD
Author-email: jcrada@fuzzylite.com
Maintainer: Juan Rada-Vilela, PhD
Maintainer-email: jcrada@fuzzylite.com
Requires-Python: >=3.9,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Dist: numpy (>=1.20,<2.0)
Project-URL: Bug Tracker, https://github.com/fuzzylite/pyfuzzylite/issues
Project-URL: Documentation, https://fuzzylite.github.io/pyfuzzylite/
Project-URL: Repository, https://github.com/fuzzylite/pyfuzzylite.git
Project-URL: Source Code, https://github.com/fuzzylite/pyfuzzylite
Description-Content-Type: text/markdown

# pyfuzzylite 8.0.0

***

<img src="docs/image/fuzzylite.svg" align="left" alt="fuzzylite">

## A Fuzzy Logic Control Library in Python

by [**Juan Rada-Vilela, PhD**](https://fuzzylite.com/about)

[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://opensource.org/license/gpl-3-0/)
[![License: Paid](https://img.shields.io/badge/License-proprietary-blue)](mailto:sales@fuzzylite.com)

***

[main branch](https://github.com/fuzzylite/pyfuzzylite/tree/main)  
[![Build](
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml/badge.svg?branch=main)](
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml)  
[![Coverage Status](
https://coveralls.io/repos/github/fuzzylite/pyfuzzylite/badge.svg?branch=main)](
https://coveralls.io/github/fuzzylite/pyfuzzylite?branch=main)

[development branch](https://github.com/fuzzylite/pyfuzzylite/tree/development)  
[![Build](
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml/badge.svg?branch=development)](
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml)  
[![Coverage Status](
https://coveralls.io/repos/github/fuzzylite/pyfuzzylite/badge.svg?branch=development)](
https://coveralls.io/github/fuzzylite/pyfuzzylite?branch=development)

***

## <a name="fuzzylite">FuzzyLite</a>

**The FuzzyLite Libraries for Fuzzy Logic Control** refer to [`fuzzylite`](https://github.com/fuzzylite/fuzzylite/)
(C++), [`pyfuzzylite`](https://github.com/fuzzylite/pyfuzzylite/) (Python),
and [`jfuzzylite`](https://github.com/fuzzylite/jfuzzylite/) (Java).

The **goal** of the FuzzyLite Libraries is to **easily** design and **efficiently** operate fuzzy logic controllers
following an **object-oriented** programming model with minimal dependency on external libraries.

## <a name="license">License</a>

`pyfuzzylite` is dual-licensed under the [**GNU GPL 3.0**](https://opensource.org/license/gpl-3-0/) and under a
**proprietary license for commercial purposes**.

You are **strongly** encouraged to support the development of the FuzzyLite Libraries by purchasing a license
of [`QtFuzzyLite`](https://fuzzylite.com/downloads).

[`QtFuzzyLite`](https://fuzzylite.com/downloads/) is the best graphical user interface available to easily design and
directly operate fuzzy logic controllers in real time. Available for Windows, Mac, and Linux, its goal is to
significantly **speed up** the design of your fuzzy logic controllers, while providing a very **useful**, **functional**
and **beautiful** user interface.
Please, download it and check it out for free at [fuzzylite.com/downloads](https://fuzzylite.com/downloads).

## <a name="install">Install</a>

```commandline
pip install pyfuzzylite
```

## <a name="features">Features</a>

**Documentation**: [fuzzylite.github.io/pyfuzzylite/](https://fuzzylite.github.io/pyfuzzylite/)

**(6) Controllers**: Mamdani, Takagi-Sugeno, Larsen, Tsukamoto, Inverse Tsukamoto, Hybrid

**(25) Linguistic terms**:  (5) *Basic*: Triangle, Trapezoid, Rectangle, Discrete, SemiEllipse.
(8) *Extended*: Bell, Cosine, Gaussian, GaussianProduct, PiShape, SigmoidDifference, SigmoidProduct, Spike.
(7) *Edges*: Arc, Binary, Concave, Ramp, Sigmoid, SShape, ZShape.
(3) *Functions*: Constant, Linear, Function. (2) *Special*: Aggregated, Activated.

**(7) Activation methods**:  General, Proportional, Threshold, First, Last, Lowest, Highest.

**(9) Conjunction and Implication (T-Norms)**: Minimum, AlgebraicProduct, BoundedDifference, DrasticProduct,
EinsteinProduct, HamacherProduct, NilpotentMinimum, LambdaNorm, FunctionNorm.

**(11) Disjunction and Aggregation (S-Norms)**:  Maximum, AlgebraicSum, BoundedSum, DrasticSum, EinsteinSum,
HamacherSum, NilpotentMaximum, NormalizedSum, UnboundedSum, LambdaNorm, FunctionNorm.

**(7) Defuzzifiers**:  (5) *Integral*: Centroid, Bisector, SmallestOfMaximum, LargestOfMaximum, MeanOfMaximum.
(2) *Weighted*: WeightedAverage, WeightedSum.

**(7) Hedges**: Any, Not, Extremely, Seldom, Somewhat, Very, Function.

**(3) Importers**: FuzzyLite Language `fll`. With `fuzzylite`: Fuzzy Inference System `fis`, Fuzzy Control
Language `fcl`.

**(7) Exporters**: `Python`, FuzzyLite Language `fll`, FuzzyLite Dataset `fld`. With `fuzzylite`: `C++`, `Java`,
FuzzyLite Language `fll`, FuzzyLite Dataset `fld`, `R` script, Fuzzy Inference System `fis`, Fuzzy Control
Language `fcl`.

**(30+) Examples**  of Mamdani, Takagi-Sugeno, Tsukamoto, and Hybrid controllers from `fuzzylite`, Octave, and Matlab,
each included in the following formats: `py`, `fll`, `fld`. With `fuzzylite`: `C++`, `Java`, `R`, `fis`, and `fcl`.

## <a name="examples">Examples</a>

### FuzzyLite Language

```yaml
# File: examples/mamdani/ObstacleAvoidance.fll
Engine: ObstacleAvoidance
InputVariable: obstacle
  enabled: true
  range: 0.000 1.000
  lock-range: false
  term: left Ramp 1.000 0.000
  term: right Ramp 0.000 1.000
OutputVariable: mSteer
  enabled: true
  range: 0.000 1.000
  lock-range: false
  aggregation: Maximum
  defuzzifier: Centroid 100
  default: nan
  lock-previous: false
  term: left Ramp 1.000 0.000
  term: right Ramp 0.000 1.000
RuleBlock: mamdani
  enabled: true
  conjunction: none
  disjunction: none
  implication: AlgebraicProduct
  activation: General
  rule: if obstacle is left then mSteer is right
  rule: if obstacle is right then mSteer is left
```

```python
# Python
import fuzzylite as fl

engine = fl.FllImporter().from_file("examples/mamdani/ObstacleAvoidance.fll")
```

### Python

```python
import fuzzylite as fl

engine = fl.Engine(
    name="ObstacleAvoidance",
    input_variables=[
        fl.InputVariable(
            name="obstacle",
            minimum=0.0,
            maximum=1.0,
            lock_range=False,
            terms=[fl.Ramp("left", 1.0, 0.0), fl.Ramp("right", 0.0, 1.0)],
        )
    ],
    output_variables=[
        fl.OutputVariable(
            name="mSteer",
            minimum=0.0,
            maximum=1.0,
            lock_range=False,
            lock_previous=False,
            default_value=fl.nan,
            aggregation=fl.Maximum(),
            defuzzifier=fl.Centroid(resolution=100),
            terms=[fl.Ramp("left", 1.0, 0.0), fl.Ramp("right", 0.0, 1.0)],
        )
    ],
    rule_blocks=[
        fl.RuleBlock(
            name="mamdani",
            conjunction=None,
            disjunction=None,
            implication=fl.AlgebraicProduct(),
            activation=fl.General(),
            rules=[
                fl.Rule.create("if obstacle is left then mSteer is right"),
                fl.Rule.create("if obstacle is right then mSteer is left"),
            ],
        )
    ],
)
```

## <a name="contributing">Contributing</a>

All contributions are welcome, provided they follow the following guidelines:

- Pull requests are made to the [development](https://github.com/fuzzylite/pyfuzzylite/tree/development) branch
- Source code is consistent with standards in the library
- Contribution is properly documented and tested, raising issues where appropriate
- Contribution is licensed under the FuzzyLite License

## <a name="reference">Reference</a>

If you are using the FuzzyLite Libraries, please cite the following reference in your article:

> Juan Rada-Vilela. The FuzzyLite Libraries for Fuzzy Logic Control, 2018. URL https://fuzzylite.com.

Or using `bibtex`:

```bibtex
@misc{fl::fuzzylite,
    author={Juan Rada-Vilela},
    title={The FuzzyLite Libraries for Fuzzy Logic Control},
    url={https://fuzzylite.com},
    year={2018}
}
```

***

fuzzylite&reg; is a registered trademark of FuzzyLite Limited <br>
jfuzzylite&trade; is a trademark of FuzzyLite Limited <br>
pyfuzzylite&trade; is a trademark of FuzzyLite Limited <br>
QtFuzzyLite&trade; is a trademark of FuzzyLite Limited <br>

