Skip to content

Commit b8bdbdc

Browse files
authored
Merge pull request #64 from fuzzylite/development
Fix: Documentation
2 parents dd2f82c + 58d74f3 commit b8bdbdc

File tree

2 files changed

+302
-90
lines changed

2 files changed

+302
-90
lines changed

README.md

Lines changed: 95 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66

77
## A Fuzzy Logic Control Library in Python
88

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)
1010

1111
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://opensource.org/license/gpl-3-0/)
1212
[![License: Paid](https://img.shields.io/badge/License-proprietary-blue)](mailto:[email protected])
1313

1414
***
1515

1616
[main branch](https://github.com/fuzzylite/pyfuzzylite/tree/main)
17-
[![Python package](
18-
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/python-package.yml/badge.svg?branch=main)](
19-
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/python-package.yml)
17+
[![Build](
18+
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml/badge.svg?branch=main)](
19+
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml)
2020
[![Coverage Status](
2121
https://coveralls.io/repos/github/fuzzylite/pyfuzzylite/badge.svg?branch=main)](
2222
https://coveralls.io/github/fuzzylite/pyfuzzylite?branch=main)
2323

2424
[development branch](https://github.com/fuzzylite/pyfuzzylite/tree/development)
25-
[![Python package](
26-
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/python-package.yml/badge.svg?branch=development)](
27-
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/python-package.yml)
25+
[![Build](
26+
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml/badge.svg?branch=development)](
27+
https://github.com/fuzzylite/pyfuzzylite/actions/workflows/build.yml)
2828
[![Coverage Status](
2929
https://coveralls.io/repos/github/fuzzylite/pyfuzzylite/badge.svg?branch=development)](
3030
https://coveralls.io/github/fuzzylite/pyfuzzylite?branch=development)
@@ -54,6 +54,12 @@ significantly **speed up** the design of your fuzzy logic controllers, while pro
5454
and **beautiful** user interface.
5555
Please, download it and check it out for free at [fuzzylite.com/downloads](https://fuzzylite.com/downloads).
5656

57+
## <a name="install">Install</a>
58+
59+
```commandline
60+
pip install pyfuzzylite
61+
```
62+
5763
## <a name="features">Features</a>
5864

5965
**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
9096

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

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+
```
175181

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

docs/index.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)