C# Класс AForge.Fuzzy.Clause

This class represents a fuzzy clause, a linguistic expression of the type "Variable IS Value".

A Fuzzy Clause is used to verify if a linguistic variable can be considered as a specific value at a specific moment. Linguistic variables can only assume value of their linugistic labels. Because of the nature of the Fuzzy Logic, a Variable can be several of its labels at the same time, with different membership values.

For example, a linguistic variable "temperature" can be "hot" with a membership 0.3 and "warm" with a membership 0.7 at the same time. To obtain those memberships, Fuzzy Clauses "temperature is hot" and "temperature is war" can be built.

Typically Fuzzy Clauses are used to build Fuzzy Rules (Rule).

Sample usage:

// create a linguistic variable to represent temperature LinguisticVariable lvTemperature = new LinguisticVariable( "Temperature", 0, 80 ); // create the linguistic labels (fuzzy sets) that compose the temperature TrapezoidalFunction function1 = new TrapezoidalFunction( 10, 15, TrapezoidalFunction.EdgeType.Right ); FuzzySet fsCold = new FuzzySet( "Cold", function1 ); TrapezoidalFunction function2 = new TrapezoidalFunction( 10, 15, 20, 25 ); FuzzySet fsCool = new FuzzySet( "Cool", function2 ); TrapezoidalFunction function3 = new TrapezoidalFunction( 20, 25, 30, 35 ); FuzzySet fsWarm = new FuzzySet( "Warm", function3 ); TrapezoidalFunction function4 = new TrapezoidalFunction( 30, 35, TrapezoidalFunction.EdgeType.Left ); FuzzySet fsHot = new FuzzySet( "Hot" , function4 ); // adding labels to the variable lvTemperature.AddLabel( fsCold ); lvTemperature.AddLabel( fsCool ); lvTemperature.AddLabel( fsWarm ); lvTemperature.AddLabel( fsHot ); // creating the Clause Clause fuzzyClause = new Clause( lvTemperature, fsHot ); // setting the numerical input of the variable to evaluate the Clause lvTemperature.NumericInput = 35; double result = fuzzyClause.Evaluate( ); Console.WriteLine ( result.ToString( ) );
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Clause ( LinguisticVariable variable, AForge.Fuzzy.FuzzySet label ) : System

Initializes a new instance of the Clause class.

Evaluate ( ) : float

Evaluates the fuzzy clause.

ToString ( ) : string

Returns the fuzzy clause in its linguistic representation.

Описание методов

Clause() публичный метод

Initializes a new instance of the Clause class.
The label indicated was not found in the linguistic variable.
public Clause ( LinguisticVariable variable, AForge.Fuzzy.FuzzySet label ) : System
variable LinguisticVariable Linguistic variable of the clause.
label AForge.Fuzzy.FuzzySet Label of the linguistic variable, a fuzzy set used as label into the linguistic variable.
Результат System

Evaluate() публичный метод

Evaluates the fuzzy clause.
public Evaluate ( ) : float
Результат float

ToString() публичный метод

Returns the fuzzy clause in its linguistic representation.
public ToString ( ) : string
Результат string