FllImporter
FllImporter
¶
Bases: Importer
Import an engine and its components described using the FuzzyLite Language.
Attributes¶
Functions¶
__init__
¶
__init__(separator: str = '\n') -> None
Constructor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
separator |
str
|
separation between components of the FuzzyLite Language. |
'\n'
|
_process
¶
Process the main components of the FuzzyLite Language, namely Engine, InputVariable, OutputVariable and RuleBlock.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
component |
str
|
one of |
required |
block |
list[str]
|
list of lines that make up the component |
required |
engine |
Engine
|
engine to add the component to |
required |
activation
¶
activation(fll: str) -> Activation | None
Return the activation method described using the FuzzyLite Language.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fll |
str
|
activation method described using the FuzzyLite Language |
required |
Returns:
Type | Description |
---|---|
Activation | None
|
activation method described using the FuzzyLite Language |
boolean
¶
component
¶
component(
cls: type[Activation | Defuzzifier | TNorm | SNorm], fll: str
) -> Activation | Defuzzifier | TNorm | SNorm | None
Return the component described using the FuzzyLite Language.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cls |
type[Activation | Defuzzifier | TNorm | SNorm]
|
class of the component to import |
required |
fll |
str
|
component described using the FuzzyLite Language |
required |
Returns:
Type | Description |
---|---|
Activation | Defuzzifier | TNorm | SNorm | None
|
component described using the FuzzyLite Language |
defuzzifier
¶
defuzzifier(fll: str) -> Defuzzifier | None
Return the defuzzifier described using the FuzzyLite Language.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fll |
str
|
defuzzifier described using the FuzzyLite Language |
required |
Returns:
Type | Description |
---|---|
Defuzzifier | None
|
defuzzifier described using the FuzzyLite Language |
engine
¶
extract_key_value
¶
extract_value
¶
Return value from the key: value
pair described using the FuzzyLite Language.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fll |
str
|
key-value pair in the form |
required |
component |
str | None
|
name of the key to extract |
None
|
Returns:
Type | Description |
---|---|
str
|
value from the |
from_string
¶
input_variable
¶
input_variable(fll: str, engine: Engine | None = None) -> InputVariable
Return the input variable described using the FuzzyLite Language.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fll |
str
|
input variable described using the FuzzyLite Language |
required |
engine |
Engine | None
|
engine to update the reference of the terms in the variable |
None
|
Returns:
Type | Description |
---|---|
InputVariable
|
input variable described using the FuzzyLite Language |
output_variable
¶
output_variable(fll: str, engine: Engine | None = None) -> OutputVariable
Return the output variable described using the FuzzyLite Language.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fll |
str
|
output variable described using the FuzzyLite Language |
required |
engine |
Engine | None
|
engine to update the reference of the terms in the variable |
None
|
Returns:
Type | Description |
---|---|
OutputVariable
|
output variable described using the FuzzyLite Language |
range
¶
rule
¶
rule_block
¶
Return the rule block described using the FuzzyLite Language.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fll |
str
|
rule block described using the FuzzyLite Language |
required |
engine |
Engine | None
|
engine to use for loading the rules |
None
|
Returns:
Type | Description |
---|---|
RuleBlock
|
rule block described using the FuzzyLite Language |
snorm
¶
term
¶
Return the term described using the FuzzyLite Language.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fll |
str
|
term described using the FuzzyLite Language |
required |
engine |
Engine | None
|
engine to update the reference of the term |
None
|
Returns:
Type | Description |
---|---|
Term
|
term described using the FuzzyLite Language |