Click here to Skip to main content
15,881,413 members
Articles / Programming Languages / C#

Fuzzy Framework

Rate me:
Please Sign up or sign in to vote.
4.93/5 (107 votes)
27 Jan 2011CPOL26 min read 139.3K   12.5K   185  
In the following article, we briefly introduce Fuzzy Framework library which supports calculations based on fuzzy logic in .NET.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FuzzyFramework.Operators;

namespace FuzzyFramework
{
    /// <summary>
    /// Represents a fuzzy relation. 
    /// Note that fuzzy set is a special (terminal, leaf) case of fuzzy relation.
    /// We consider fuzzy relation a relation of two other fuzzy relations by means of operator. If more than two subrelations required, simply concatenate them:
    /// ((subrelation1 operator subrelation 2) operator subrelation3) ... operator subrelation n).
    /// 
    /// We don't expect particular subrelations being especially prioritized. Once using parenthesis in an expression definyng the relation, the tree will be automatically built in the proper order.
    /// </summary>
    public interface IFuzzyRelation
    {
        /// <summary>
        /// Specifies whether the relation is actually an ordinary fuzzy set, i.e. there are no subrelations. Terminal, leaf relation 
        /// </summary>
        bool Terminal {get;}
        /// <summary>
        /// First operand. Null if terminal relation
        /// </summary>
        IFuzzyRelation Subrelation1 { get; }
        /// <summary>
        /// Secod operand. Null if terminal relation or if an unary operator used
        /// </summary>
        IFuzzyRelation Subrelation2 { get; }
        /// <summary>
        /// -Binary operator over Subrelation1 and Subrelation2
        /// -Unary operator over Subrelation1 (whereas Subrelation2 is null)
        /// -null if terminal relation
        /// </summary>
        IOperator Operator { get; }

        //All distinct dimensions used throughout the relation (including nested levels).
        IDimension[] Dimensions { get; }

        /// <summary>
        /// Returns lowest value where the membership function > 0 for the specified dimension.
        /// Suitable for painting a graph, for example, if we want to avoid to draw it for the whole univesre.
        /// If more than one fuzzy set for the single dimension used in the relation (E.g. in expression "temperature hot or temperature cold"), than the result will be minimum for all these sets.
        /// </summary>
        /// <param name="dimension">Dimension to return the boundaries for</param>
        /// <returns>the lower boundary</returns>
        System.Decimal GetLowerSupportBound(IDimension dimension);

        System.Decimal GetUpperSupportBound(IDimension dimension);



    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Student
Czech Republic Czech Republic
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions