コード例 #1
0
        public static FuzzySet Summary(FuzzySet setOne, FuzzySet setTwo)
        {
            //s-norma
            if (setOne.Type == CalcType.Gamma && setTwo.Type == CalcType.L)
            {
                return(SumLGamma(setTwo, setOne));
            }
            else if (setOne.Type == CalcType.L && setTwo.Type == CalcType.Gamma)
            {
                return(SumLGamma(setOne, setTwo));
            }

            return(new FuzzySet {
            });
        }
コード例 #2
0
 public FuzzySet Sum(FuzzySet sSet)
 {
     return(FuzzySolver.Summary(this, sSet));
 }
コード例 #3
0
 public FuzzySet Product(FuzzySet sSet)
 {
     return(FuzzySolver.Product(this, sSet));
 }
コード例 #4
0
        public static FuzzySet Complement(FuzzySet setOne)
        {
            FuzzySet freturn = setOne;

            if (setOne.Type == CalcType.Singleton)
            {
                //Invert the values excluding the singleton point (inverted class T - CT)
                //I don't know if this is correct, probably without +1 and -1 would be correct
                freturn.Type           = CalcType.CSingleton;
                freturn.absolutePoints = new List <FuzzyValue> {
                };
                freturn.absolutePoints.Add(new FuzzyValue
                {
                    x = 1,
                    //value = freturn.a.x - 1 //is it true?
                    value = freturn.a.x
                });
                freturn.absolutePoints.Add(new FuzzyValue
                {
                    x     = 0,
                    value = freturn.a.x
                });
                freturn.absolutePoints.Add(new FuzzyValue
                {
                    x = 1,
                    //value = freturn.a.x + 1 //is it true?
                    value = freturn.a.x
                });
            }
            else if (setOne.Type == CalcType.CSingleton) //complement singleton is changed to singleton
            {
                freturn.Type           = CalcType.Singleton;
                freturn.absolutePoints = new List <FuzzyValue> {
                };                                                 //just clear absolute values for current singleton
            }
            else if (setOne.Type == CalcType.T)
            {
                freturn.Type = CalcType.CT; //T is changed to Complement T
            }
            else if (setOne.Type == CalcType.CT)
            {
                freturn.Type = CalcType.T; //Complement T is changed to T
            }
            else if (setOne.Type == CalcType.Gamma)
            {
                freturn.Type = CalcType.L; //Gamma is changed to L
            }
            else if (setOne.Type == CalcType.L)
            {
                freturn.Type = CalcType.Gamma; //L is changed to Gamma
            }


            if (freturn.a.x != null)
            {
                freturn.a.x = 1 - freturn.a.x;
            }

            if (freturn.b.x != null)
            {
                freturn.b.x = 1 - freturn.b.x;
            }

            if (freturn.c.x != null)
            {
                freturn.c.x = 1 - freturn.c.x;
            }

            return(freturn);
        }
コード例 #5
0
 public static FuzzySet Product(FuzzySet setOne, FuzzySet setTwo)
 {
     //?
     return(setOne);
 }