Membership function used in fuzzy singletons: fuzzy sets that have just one point with membership value 1.

**Namespace:**
AForge.Fuzzy

**Assembly:**
AForge.Fuzzy (in AForge.Fuzzy.dll) Version: 2.2.4.0 (2.2.4.0)

# Syntax

C# |
---|

public class SingletonFunction : IMembershipFunction |

# Remarks

Sometimes it is needed to represent crisp (classical) number in the fuzzy domain. Several approaches can be used, like adding some uncertain (fuzziness) in the original number (the number one, for instance, can be seen as a TrapezoidalFunction with -0.5, 1.0 and 0.5 parameters). Another approach is to declare fuzzy singletons: fuzzy sets with only one point returning a none zero membership.

While trapezoidal and half trapezoidal are classic functions used in fuzzy functions, this class supports any function or approximation that can be represented as a sequence of lines.

Sample usage:

CopyC#

// creating the instance SingletonFunction membershipFunction = new SingletonFunction( 10 ); // getting membership for several points for ( int i = 0; i < 20; i++ ) Console.WriteLine( membershipFunction.GetMembership( i ) );