예제 #1
0
        /// <summary>
        /// Maps a binary operation on two fuzzy numbers
        /// (Performs the operation over each pair of corresponding alpha-cuts)
        /// </summary>
        public static FuzzyNumber Map(FuzzyNumber X, FuzzyNumber Y, Func <Interval, Interval, Interval> operation)
        {
            if (X.AlphaCuts.Count == Y.AlphaCuts.Count)
            {
                return(new FuzzyNumber(X.AlphaCuts.Zip(Y.AlphaCuts, operation)));
            }

            throw new NotImplementedException();
        }
예제 #2
0
        /// <summary>
        /// How much is greater than other fuzzy number?
        /// </summary>
        /// <param name="other"></param>
        /// <returns>A Presumption (0 - 1) that the fuzzy number is greater</returns>
        public double GreaterThan(FuzzyNumber other)
        {
            if (other.AlphaCuts.Count == AlphaCuts.Count)
            {
                var sum = 0d;
                for (var i = 0; i < AlphaCuts.Count; i++)
                {
                    sum += AlphaCuts[i].GreaterThan(other.AlphaCuts[i]);
                }

                return(sum / AlphaCuts.Count);
            }

            throw new NotImplementedException();
        }
예제 #3
0
파일: cos.cs 프로젝트: dzibma/FuzzyMath
 /// <summary>
 /// Calculates a cosine of the fuzzy angle.
 /// </summary>
 /// <param name="X">A fuzzy number represents the angle in radians.</param>
 public static FuzzyNumber Cos(FuzzyNumber X)
 {
     return FuzzyNumber.Map(X, x => Cos(x));
 }
예제 #4
0
파일: pow.cs 프로젝트: dzibma/FuzzyMath
 /// <summary>
 /// Calculates a value of the fuzzy number raised to the specified power.
 /// </summary>
 /// <param name="X">Base</param>
 /// <param name="y">Exponent</param>
 public static FuzzyNumber Pow(FuzzyNumber X, double y)
 {
     return(FuzzyNumber.Map(X, x => Pow(x, y)));
 }
예제 #5
0
파일: min.cs 프로젝트: dzibma/FuzzyMath
 /// <summary>
 /// Returns the smaller of two fuzzy numbers.
 /// </summary>
 public static FuzzyNumber Min(FuzzyNumber X, FuzzyNumber Y)
 {
     return(FuzzyNumber.Map(X, Y, (x, y) => Min(x, y)));
 }
예제 #6
0
        public static FuzzyNumber Atan2(FuzzyNumber Y, FuzzyNumber X)
        {
            var rotated = Y.Support.Contains(0) && !X.Support.Contains(0);

            return(FuzzyNumber.Map(Y, X, (y, x) => Atan2(y, x, rotated)));
        }
예제 #7
0
파일: min.cs 프로젝트: dzibma/FuzzyMath
 /// <summary>
 /// Returns the smaller of two fuzzy numbers.
 /// </summary>
 public static FuzzyNumber Min(FuzzyNumber X, FuzzyNumber Y)
 {
     return FuzzyNumber.Map(X, Y, (x, y) => Min(x, y));
 }
예제 #8
0
 /// <summary>
 /// Calculates a sine of the fuzzy angle.
 /// </summary>
 /// <param name="X">A fuzzy number represents the angle in radians.</param>
 public static FuzzyNumber Sin(FuzzyNumber X)
 {
     return(FuzzyNumber.Map(X, x => Sin(x)));
 }
예제 #9
0
        /// <summary>
        /// How much is greater than other fuzzy number?
        /// </summary>
        /// <param name="other"></param>
        /// <returns>A Presumption (0 - 1) that the fuzzy number is greater</returns>
        public double GreaterThan(FuzzyNumber other)
        {
            if (other.AlphaCuts.Count == AlphaCuts.Count)
            {
                var sum = 0d;
                for (var i = 0; i < AlphaCuts.Count; i++)
                {
                    sum += AlphaCuts[i].GreaterThan(other.AlphaCuts[i]);
                }

                return sum / AlphaCuts.Count;
            }

            throw new NotImplementedException();
        }
예제 #10
0
파일: exp.cs 프로젝트: dzibma/FuzzyMath
 /// <summary>
 /// Calculates e raised to the specified fuzzy number.
 /// </summary>
 /// <param name="X">Exponent</param>
 public static FuzzyNumber Exp(FuzzyNumber X)
 {
     return FuzzyNumber.Map(X, x => Exp(x));
 }
예제 #11
0
 /// <summary>
 /// Maps an unary operation on a fuzzy number
 /// </summary>
 public static FuzzyNumber Map(FuzzyNumber X, Func <Interval, Interval> operation)
 {
     return(new FuzzyNumber(X.AlphaCuts.Select(operation)));
 }
예제 #12
0
파일: pow.cs 프로젝트: dzibma/FuzzyMath
 /// <summary>
 /// Calculates a value of the fuzzy number raised to the specified power.
 /// </summary>
 /// <param name="X">Base</param>
 /// <param name="y">Exponent</param>
 public static FuzzyNumber Pow(FuzzyNumber X, double y)
 {
     return FuzzyNumber.Map(X, x => Pow(x, y));
 }
예제 #13
0
        /// <summary>
        /// Maps a binary operation on two fuzzy numbers
        /// (Performs the operation over each pair of corresponding alpha-cuts)
        /// </summary>
        public static FuzzyNumber Map(FuzzyNumber X, FuzzyNumber Y, Func<Interval, Interval, Interval> operation)
        {
            if (X.AlphaCuts.Count == Y.AlphaCuts.Count)
            {
                return new FuzzyNumber(X.AlphaCuts.Zip(Y.AlphaCuts, operation));

            }

            throw new NotImplementedException();
        }
예제 #14
0
 /// <summary>
 /// Maps an unary operation on a fuzzy number
 /// </summary>
 public static FuzzyNumber Map(FuzzyNumber X, Func<Interval, Interval> operation)
 {
     return new FuzzyNumber(X.AlphaCuts.Select(operation));
 }
예제 #15
0
파일: cos.cs 프로젝트: dzibma/FuzzyMath
 /// <summary>
 /// Calculates a cosine of the fuzzy angle.
 /// </summary>
 /// <param name="X">A fuzzy number represents the angle in radians.</param>
 public static FuzzyNumber Cos(FuzzyNumber X)
 {
     return(FuzzyNumber.Map(X, x => Cos(x)));
 }
예제 #16
0
파일: exp.cs 프로젝트: dzibma/FuzzyMath
 /// <summary>
 /// Calculates e raised to the specified fuzzy number.
 /// </summary>
 /// <param name="X">Exponent</param>
 public static FuzzyNumber Exp(FuzzyNumber X)
 {
     return(FuzzyNumber.Map(X, x => Exp(x)));
 }
예제 #17
0
파일: sin.cs 프로젝트: dzibma/FuzzyMath
 /// <summary>
 /// Calculates a sine of the fuzzy angle.
 /// </summary>
 /// <param name="X">A fuzzy number represents the angle in radians.</param>
 public static FuzzyNumber Sin(FuzzyNumber X)
 {
     return FuzzyNumber.Map(X, x => Sin(x));
 }
예제 #18
0
파일: atan2.cs 프로젝트: dzibma/FuzzyMath
        public static FuzzyNumber Atan2(FuzzyNumber Y, FuzzyNumber X)
        {
            var rotated = Y.Support.Contains(0) && !X.Support.Contains(0);

            return FuzzyNumber.Map(Y, X, (y, x) => Atan2(y, x, rotated));
        }