|
6 | 6 |
|
7 | 7 | ## A Fuzzy Logic Control Library in Python
|
8 | 8 |
|
9 |
| -by [**Juan Rada-Vilela, PhD** :fontawesome-solid-square-arrow-up-right:](https://fuzzylite.com/about) |
| 9 | +by [**Juan Rada-Vilela, PhD**](https://fuzzylite.com/about) |
10 | 10 |
|
11 | 11 | [](https://opensource.org/license/gpl-3-0/)
|
12 | 12 | [](mailto:[email protected])
|
13 | 13 |
|
14 | 14 | ***
|
15 | 15 |
|
16 | 16 | [main branch](https://github.com/fuzzylite/pyfuzzylite/tree/main)
|
17 |
| -[]( |
19 |
| -https://github.com/fuzzylite/pyfuzzylite/actions/workflows/python-package.yml) |
| 17 | +[]( |
| 19 | +https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml) |
20 | 20 | [](
|
22 | 22 | https://coveralls.io/github/fuzzylite/pyfuzzylite?branch=main)
|
23 | 23 |
|
24 | 24 | [development branch](https://github.com/fuzzylite/pyfuzzylite/tree/development)
|
25 |
| -[]( |
27 |
| -https://github.com/fuzzylite/pyfuzzylite/actions/workflows/python-package.yml) |
| 25 | +[]( |
| 27 | +https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml) |
28 | 28 | [](
|
30 | 30 | https://coveralls.io/github/fuzzylite/pyfuzzylite?branch=development)
|
@@ -54,6 +54,12 @@ significantly **speed up** the design of your fuzzy logic controllers, while pro
|
54 | 54 | and **beautiful** user interface.
|
55 | 55 | Please, download it and check it out for free at [fuzzylite.com/downloads](https://fuzzylite.com/downloads).
|
56 | 56 |
|
| 57 | +## <a name="install">Install</a> |
| 58 | + |
| 59 | +```commandline |
| 60 | +pip install pyfuzzylite |
| 61 | +``` |
| 62 | + |
57 | 63 | ## <a name="features">Features</a>
|
58 | 64 |
|
59 | 65 | **Documentation**: [fuzzylite.github.io/pyfuzzylite/](https://fuzzylite.github.io/pyfuzzylite/)
|
@@ -90,88 +96,88 @@ each included in the following formats: `py`, `fll`, `fld`. With `fuzzylite`: `C
|
90 | 96 |
|
91 | 97 | ## <a name="examples">Examples</a>
|
92 | 98 |
|
93 |
| -=== "FuzzyLite Language" |
94 |
| - |
95 |
| - ```properties |
96 |
| - # File: examples/mamdani/ObstacleAvoidance.fll |
97 |
| - Engine: ObstacleAvoidance |
98 |
| - InputVariable: obstacle |
99 |
| - enabled: true |
100 |
| - range: 0.000 1.000 |
101 |
| - lock-range: false |
102 |
| - term: left Ramp 1.000 0.000 |
103 |
| - term: right Ramp 0.000 1.000 |
104 |
| - OutputVariable: mSteer |
105 |
| - enabled: true |
106 |
| - range: 0.000 1.000 |
107 |
| - lock-range: false |
108 |
| - aggregation: Maximum |
109 |
| - defuzzifier: Centroid 100 |
110 |
| - default: nan |
111 |
| - lock-previous: false |
112 |
| - term: left Ramp 1.000 0.000 |
113 |
| - term: right Ramp 0.000 1.000 |
114 |
| - RuleBlock: mamdani |
115 |
| - enabled: true |
116 |
| - conjunction: none |
117 |
| - disjunction: none |
118 |
| - implication: AlgebraicProduct |
119 |
| - activation: General |
120 |
| - rule: if obstacle is left then mSteer is right |
121 |
| - rule: if obstacle is right then mSteer is left |
122 |
| - ``` |
123 |
| - |
124 |
| - ```python |
125 |
| - # Python |
126 |
| - import fuzzylite as fl |
127 |
| - |
128 |
| - engine = fl.FllImporter().from_file("examples/mamdani/ObstacleAvoidance.fll") |
129 |
| - ``` |
130 |
| - |
131 |
| -=== "Python" |
132 |
| - |
133 |
| - ```python |
134 |
| - import fuzzylite as fl |
135 |
| - |
136 |
| - engine = fl.Engine( |
137 |
| - name="ObstacleAvoidance", |
138 |
| - input_variables=[ |
139 |
| - fl.InputVariable( |
140 |
| - name="obstacle", |
141 |
| - minimum=0.0, |
142 |
| - maximum=1.0, |
143 |
| - lock_range=False, |
144 |
| - terms=[fl.Ramp("left", 1.0, 0.0), fl.Ramp("right", 0.0, 1.0)], |
145 |
| - ) |
146 |
| - ], |
147 |
| - output_variables=[ |
148 |
| - fl.OutputVariable( |
149 |
| - name="mSteer", |
150 |
| - minimum=0.0, |
151 |
| - maximum=1.0, |
152 |
| - lock_range=False, |
153 |
| - lock_previous=False, |
154 |
| - default_value=fl.nan, |
155 |
| - aggregation=fl.Maximum(), |
156 |
| - defuzzifier=fl.Centroid(resolution=100), |
157 |
| - terms=[fl.Ramp("left", 1.0, 0.0), fl.Ramp("right", 0.0, 1.0)], |
158 |
| - ) |
159 |
| - ], |
160 |
| - rule_blocks=[ |
161 |
| - fl.RuleBlock( |
162 |
| - name="mamdani", |
163 |
| - conjunction=None, |
164 |
| - disjunction=None, |
165 |
| - implication=fl.AlgebraicProduct(), |
166 |
| - activation=fl.General(), |
167 |
| - rules=[ |
168 |
| - fl.Rule.create("if obstacle is left then mSteer is right"), |
169 |
| - fl.Rule.create("if obstacle is right then mSteer is left"), |
170 |
| - ], |
171 |
| - ) |
172 |
| - ], |
173 |
| - ) |
174 |
| - ``` |
| 99 | +### FuzzyLite Language |
| 100 | + |
| 101 | +```yaml |
| 102 | +# File: examples/mamdani/ObstacleAvoidance.fll |
| 103 | +Engine: ObstacleAvoidance |
| 104 | +InputVariable: obstacle |
| 105 | + enabled: true |
| 106 | + range: 0.000 1.000 |
| 107 | + lock-range: false |
| 108 | + term: left Ramp 1.000 0.000 |
| 109 | + term: right Ramp 0.000 1.000 |
| 110 | +OutputVariable: mSteer |
| 111 | + enabled: true |
| 112 | + range: 0.000 1.000 |
| 113 | + lock-range: false |
| 114 | + aggregation: Maximum |
| 115 | + defuzzifier: Centroid 100 |
| 116 | + default: nan |
| 117 | + lock-previous: false |
| 118 | + term: left Ramp 1.000 0.000 |
| 119 | + term: right Ramp 0.000 1.000 |
| 120 | +RuleBlock: mamdani |
| 121 | + enabled: true |
| 122 | + conjunction: none |
| 123 | + disjunction: none |
| 124 | + implication: AlgebraicProduct |
| 125 | + activation: General |
| 126 | + rule: if obstacle is left then mSteer is right |
| 127 | + rule: if obstacle is right then mSteer is left |
| 128 | +``` |
| 129 | +
|
| 130 | +```python |
| 131 | +# Python |
| 132 | +import fuzzylite as fl |
| 133 | + |
| 134 | +engine = fl.FllImporter().from_file("examples/mamdani/ObstacleAvoidance.fll") |
| 135 | +``` |
| 136 | + |
| 137 | +### Python |
| 138 | + |
| 139 | +```python |
| 140 | +import fuzzylite as fl |
| 141 | + |
| 142 | +engine = fl.Engine( |
| 143 | + name="ObstacleAvoidance", |
| 144 | + input_variables=[ |
| 145 | + fl.InputVariable( |
| 146 | + name="obstacle", |
| 147 | + minimum=0.0, |
| 148 | + maximum=1.0, |
| 149 | + lock_range=False, |
| 150 | + terms=[fl.Ramp("left", 1.0, 0.0), fl.Ramp("right", 0.0, 1.0)], |
| 151 | + ) |
| 152 | + ], |
| 153 | + output_variables=[ |
| 154 | + fl.OutputVariable( |
| 155 | + name="mSteer", |
| 156 | + minimum=0.0, |
| 157 | + maximum=1.0, |
| 158 | + lock_range=False, |
| 159 | + lock_previous=False, |
| 160 | + default_value=fl.nan, |
| 161 | + aggregation=fl.Maximum(), |
| 162 | + defuzzifier=fl.Centroid(resolution=100), |
| 163 | + terms=[fl.Ramp("left", 1.0, 0.0), fl.Ramp("right", 0.0, 1.0)], |
| 164 | + ) |
| 165 | + ], |
| 166 | + rule_blocks=[ |
| 167 | + fl.RuleBlock( |
| 168 | + name="mamdani", |
| 169 | + conjunction=None, |
| 170 | + disjunction=None, |
| 171 | + implication=fl.AlgebraicProduct(), |
| 172 | + activation=fl.General(), |
| 173 | + rules=[ |
| 174 | + fl.Rule.create("if obstacle is left then mSteer is right"), |
| 175 | + fl.Rule.create("if obstacle is right then mSteer is left"), |
| 176 | + ], |
| 177 | + ) |
| 178 | + ], |
| 179 | +) |
| 180 | +``` |
175 | 181 |
|
176 | 182 | ## <a name="contributing">Contributing</a>
|
177 | 183 |
|
|
0 commit comments