FuzzySet Class |
Namespace: Accord.Fuzzy
The FuzzySet type exposes the following members.
Name | Description | |
---|---|---|
LeftLimit |
The leftmost x value of the fuzzy set's membership function.
| |
Name |
Name of the fuzzy set.
| |
RightLimit |
The rightmost x value of the fuzzy set's membership function.
|
Name | Description | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetMembership |
Calculate membership of a given value to the fuzzy set.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
HasMethod |
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.) | |
IsEqual |
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.) | |
To(Type) | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) | |
ToT | Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) |
The fuzzy sets are the base for all fuzzy applications. In a classical set, the membership of a given value to the set can always be defined as true (1) or false (0). In fuzzy sets, this membership can be a value in the range [0..1], representing the imprecision existent in many real world applications.
Let us consider, for example, fuzzy sets representing some temperature. In a given application, there is the need to represent a cool and warm temperature. Like in real life, the precise point when the temperature changes from cool to warm is not easy to find, and does not makes sense. If we consider the cool around 20 degrees and warm around 30 degrees, it is not simple to find a break point. If we take the mean, we can consider values greater than or equal 25 to be warm. But we can still consider 25 a bit cool. And a bit warm at the same time. This is where fuzzy sets can help.
Fuzzy sets are often used to compose Linguistic Variables, used in Fuzzy Inference Systems.
Sample usage:
// creating 2 fuzzy sets to represent Cool and Warm TrapezoidalFunction function1 = new TrapezoidalFunction( 13, 18, 23, 28 ); FuzzySet fsCool = new FuzzySet( "Cool", function1 ); TrapezoidalFunction function2 = new TrapezoidalFunction( 23, 28, 33, 38 ); FuzzySet fsWarm = new FuzzySet( "Warm", function2 ); // show membership to the Cool set for some values Console.WriteLine( "COOL" ); for ( int i = 13; i <= 28; i++ ) Console.WriteLine( fsCool.GetMembership( i ) ); // show membership to the Warm set for some values Console.WriteLine( "WARM" ); for ( int i = 23; i <= 38; i++ ) Console.WriteLine( fsWarm.GetMembership( i ) );