Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 1.24 KB

readme.md

File metadata and controls

59 lines (39 loc) · 1.24 KB

Mini Fuzzy Solver

This package implements a simple normalized fuzzy solver

Classes


FuzzyVar

  • Retains info about the fuzzy variables
    • List of linguistic values
    • Meaning function for each linguistic value

Operators

  • Define the operators and parameters used in each operator(minimum, maximum, union, intersect, etc)

How to use

  1. Define your fuzzy variables

    a) Base variables b) Linguistic values c) Meaning functions

  2. Decide on wich operators to use for each operator(and, or, union, intersection, etc) in your logic

  3. Use fuzzyRule.py computeRules function


How to define rules

The rules are executed from left to right.

A and B or C -> [ [A, B, C], [and, or] ]

A or B and C -> [ [ [A, B], C], [or, and] ]

A and B or C and D -> [ [ [A, B], [C, D]], [and, or, and] ]

A and (B or C) -> [ [A, [B, C] ], [and, or]]

A and (B or C or D) and D -> [ [A, [B, C, D], D], [and, or, or, and] ]


Definition Example

BASE_VARIABLES = List[float]
MEANING = List[Dict[str,float]]
FUZZY_VARS = List[FuzzyVar]
FUZZY_RULES = List[Tuple[List[Any '''float or list'''], List[Callable[[float,float], float]]]]