pyfuzzylite

pyfuzzylite: a fuzzy logic control library in Python

https://github.com/fuzzylite/pyfuzzylite

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.7%) to scientific vocabulary

Keywords

artificial-intelligence fuzzy-logic fuzzy-logic-control fuzzylite fuzzylite-libraries python soft-computing
Last synced: 6 months ago · JSON representation ·

Repository

pyfuzzylite: a fuzzy logic control library in Python

Basic Info
  • Host: GitHub
  • Owner: fuzzylite
  • License: other
  • Language: Python
  • Default Branch: main
  • Homepage: https://fuzzylite.com
  • Size: 24.1 MB
Statistics
  • Stars: 74
  • Watchers: 6
  • Forks: 14
  • Open Issues: 0
  • Releases: 10
Topics
artificial-intelligence fuzzy-logic fuzzy-logic-control fuzzylite fuzzylite-libraries python soft-computing
Created over 11 years ago · Last pushed 8 months ago
Metadata Files
Readme Changelog Funding License Citation

README.md

fuzzylite

pyfuzzylite 8.0.5

A Fuzzy Logic Control Library in Python

by Juan Rada-Vilela, PhD

[![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) [![Coverage Status]( https://coveralls.io/repos/github/fuzzylite/pyfuzzylite/badge.svg?branch=main)]( https://coveralls.io/github/fuzzylite/pyfuzzylite?branch=main) [![Build](https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml/badge.svg)]( https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml) [![Test](https://github.com/fuzzylite/pyfuzzylite/actions/workflows/test.yml/badge.svg)]( https://github.com/fuzzylite/pyfuzzylite/actions/workflows/test.yml) [![Publish](https://github.com/fuzzylite/pyfuzzylite/actions/workflows/publish.yml/badge.svg)]( https://github.com/fuzzylite/pyfuzzylite/actions/workflows/publish.yml)

FuzzyLite

The FuzzyLite Libraries for Fuzzy Logic Control refer to fuzzylite (C++), pyfuzzylite (Python), and 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.

License

pyfuzzylite is dual-licensed under the GNU 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.

QtFuzzyLite 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.

Install

commandline pip install pyfuzzylite

Features

Documentation: 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.

Examples

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", inputvariables=[ fl.InputVariable( name="obstacle", minimum=0.0, maximum=1.0, lockrange=False, terms=[fl.Ramp("left", 1.0, 0.0), fl.Ramp("right", 0.0, 1.0)], ) ], outputvariables=[ fl.OutputVariable( name="mSteer", minimum=0.0, maximum=1.0, lockrange=False, lockprevious=False, defaultvalue=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"), ], ) ], ) ```

float and vectorization

```python

single float operation

engine.inputvariable("obstacle").value = 0.5 engine.process() print("y =", engine.outputvariable("mSteer").value)

> y = 0.5

print("ỹ =", engine.outputvariable("mSteer").fuzzyvalue())

> ỹ = 0.500/left + 0.500/right

vectorization

engine.inputvariable("obstacle").value = fl.array([0, 0.25, 0.5, 0.75, 1.0]) engine.process() print("y =", repr(engine.outputvariable("mSteer").value))

> y = array([0.6666665 , 0.62179477, 0.5 , 0.37820523, 0.3333335 ])

print("ỹ =", repr(engine.outputvariable("mSteer").fuzzyvalue()))

> ỹ = array(['0.000/left + 1.000/right',

'0.250/left + 0.750/right',

'0.500/left + 0.500/right',

'0.750/left + 0.250/right',

'1.000/left + 0.000/right'], dtype='<U26')

```

Please refer to the documentation for more information: fuzzylite.github.io/pyfuzzylite/

Contributing

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

  • 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

Reference

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® is a registered trademark of FuzzyLite
jfuzzylite™, pyfuzzylite™ and QtFuzzyLite™ are trademarks of FuzzyLite

Owner

  • Name: FuzzyLite
  • Login: fuzzylite
  • Kind: organization
  • Email: sales@fuzzylite.com
  • Location: Australia

The FuzzyLite Libraries for Fuzzy Logic Control

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: pyfuzzylite
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Juan
    family-names: Rada-Vilela
    email: jcrada@fuzzylite.com
    affiliation: FuzzyLite
repository-code: 'https://github.com/fuzzylite/pyfuzzylite'
url: 'https://fuzzylite.com'
abstract: >-
  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.
keywords:
  - Artificial Intelligence
  - Fuzzy Logic
  - Control
  - Soft Computing
  - FuzzyLite
license: GPL-3.0

GitHub Events

Total
  • Release event: 4
  • Watch event: 12
  • Delete event: 7
  • Issue comment event: 12
  • Push event: 10
  • Pull request event: 10
  • Create event: 12
Last Year
  • Release event: 4
  • Watch event: 12
  • Delete event: 7
  • Issue comment event: 12
  • Push event: 10
  • Pull request event: 10
  • Create event: 12

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 249
  • Total Committers: 2
  • Avg Commits per committer: 124.5
  • Development Distribution Score (DDS): 0.068
Top Committers
Name Email Commits
Juan Rada-Vilela j****a@f****m 232
jcrada j****a@g****m 17
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 7
  • Total pull requests: 90
  • Average time to close issues: 3 days
  • Average time to close pull requests: 4 days
  • Total issue authors: 7
  • Total pull request authors: 4
  • Average comments per issue: 2.29
  • Average comments per pull request: 1.53
  • Merged pull requests: 73
  • Bot issues: 0
  • Bot pull requests: 12
Past Year
  • Issues: 1
  • Pull requests: 17
  • Average time to close issues: N/A
  • Average time to close pull requests: about 4 hours
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 1.71
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jcrada (1)
  • KatharinaSteinke (1)
  • DilHem (1)
  • mariovillamizar (1)
  • cgarzon777 (1)
  • CJxD (1)
  • ManStu (1)
  • zrg1993 (1)
Pull Request Authors
  • jcrada (90)
  • dependabot[bot] (12)
  • adriencaccia (2)
  • kdahlhaus (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (12)

Dependencies

pyproject.toml pypi
  • autoflake ^1.4 develop
  • black ^22.1.0 develop
  • coveralls ^3.3.1 develop
  • isort ^5.10.1 develop
  • mypy ^0.931 develop
  • nbqa ^1.2.3 develop
  • numpy ^1.19.5 develop
  • pylint ^2.12.2 develop
  • pytest ^7.0.1 develop
  • toml ^0.10.2 develop
  • python ^3.6.2
.github/workflows/python-package.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
poetry.lock pypi
  • attrs 22.2.0 develop
  • backports-cached-property 1.0.2 develop
  • black 23.1.0 develop
  • bleach 6.0.0 develop
  • build 0.10.0 develop
  • cachecontrol 0.12.11 develop
  • certifi 2022.12.7 develop
  • cffi 1.15.1 develop
  • charset-normalizer 3.1.0 develop
  • cleo 2.0.1 develop
  • click 8.1.3 develop
  • colorama 0.4.6 develop
  • coverage 7.2.2 develop
  • crashtest 0.4.1 develop
  • cryptography 39.0.2 develop
  • distlib 0.3.6 develop
  • docutils 0.19 develop
  • dulwich 0.21.3 develop
  • exceptiongroup 1.1.1 develop
  • filelock 3.10.3 develop
  • html5lib 1.1 develop
  • idna 3.4 develop
  • importlib-metadata 6.1.0 develop
  • importlib-resources 5.12.0 develop
  • iniconfig 2.0.0 develop
  • installer 0.7.0 develop
  • jaraco-classes 3.2.3 develop
  • jeepney 0.8.0 develop
  • jsonschema 4.17.3 develop
  • keyring 23.13.1 develop
  • lockfile 0.12.2 develop
  • markdown-it-py 2.2.0 develop
  • mdurl 0.1.2 develop
  • more-itertools 9.1.0 develop
  • msgpack 1.0.5 develop
  • mypy 1.1.1 develop
  • mypy-extensions 1.0.0 develop
  • numpy 1.21.1 develop
  • packaging 23.0 develop
  • pathspec 0.11.1 develop
  • pexpect 4.8.0 develop
  • pkginfo 1.9.6 develop
  • pkgutil-resolve-name 1.3.10 develop
  • platformdirs 2.6.2 develop
  • pluggy 1.0.0 develop
  • poetry 1.4.1 develop
  • poetry-bumpversion 0.3.0 develop
  • poetry-core 1.5.2 develop
  • poetry-plugin-export 1.3.0 develop
  • ptyprocess 0.7.0 develop
  • pycparser 2.21 develop
  • pydantic 1.10.7 develop
  • pygments 2.14.0 develop
  • pyhamcrest 2.0.4 develop
  • pyproject-hooks 1.0.0 develop
  • pyrsistent 0.19.3 develop
  • pytest 7.2.2 develop
  • pywin32-ctypes 0.2.0 develop
  • rapidfuzz 2.13.7 develop
  • readme-renderer 37.3 develop
  • requests 2.28.2 develop
  • requests-toolbelt 0.10.1 develop
  • rfc3986 2.0.0 develop
  • rich 13.3.2 develop
  • ruff 0.0.256 develop
  • secretstorage 3.3.3 develop
  • shellingham 1.5.0.post1 develop
  • six 1.16.0 develop
  • tomli 2.0.1 develop
  • tomlkit 0.11.6 develop
  • trove-classifiers 2023.3.9 develop
  • twine 4.0.2 develop
  • typed-ast 1.5.4 develop
  • typing-extensions 4.5.0 develop
  • urllib3 1.26.15 develop
  • virtualenv 20.16.5 develop
  • virtualenv 20.21.0 develop
  • webencodings 0.5.1 develop
  • xattr 0.10.1 develop
  • zipp 3.15.0 develop