FuzzyLogicController

open class FuzzyLogicController<AntecedentUniverse, ConsequentUniverse>

Undocumented

  • Undocumented

    Declaration

    Swift

    public var settings: OperationSettings
  • Undocumented

    Declaration

    Swift

    public var ruleBase: FuzzyRuleBase<(AntecedentUniverse, ConsequentUniverse)>
  • Undocumented

    Declaration

    Swift

    public var aggregatorFunction: (Grade, Grade) -> Grade
  • Undocumented

    Declaration

    Swift

    public init(
        rules: FuzzyRuleBase<(AntecedentUniverse, ConsequentUniverse)> = .init(),
        settings: OperationSettings = .init(),
        aggregatorFunction: ((Grade, Grade) -> Grade)? = nil
    )
  • Undocumented

    Declaration

    Swift

    open func consequence<S: Sequence>(
        usingFact fact: IterableFuzzySet<AntecedentUniverse, S>
    ) -> AnyFuzzySet<ConsequentUniverse>
  • Apply generalized Modus Ponens to all rules using fact as input to the controller and return the grade membership of value in the fuzzy set output.

    Declaration

    Swift

    open func consequenceGrade<S: Sequence>(
        for value: ConsequentUniverse,
        usingFact fact: IterableFuzzySet<AntecedentUniverse, S>
    ) -> Grade
  • Apply generalized Modus Ponens to all rules using fact as input to the controller and return the grade membership of value in the fuzzy set output.

    Helper for the scenario when AntecedentUniverse does not conform to Equatable. One such example might be having a tuple as a universe of discourse - they still do not conform to Equatable, even if all of their elements are Equatable.

    Declaration

    Swift

    open func consequenceGrade(
        for value: ConsequentUniverse,
        usingSingletonFact fact: AntecedentUniverse
    ) -> Grade