示例#1
0
        private ContinuousFuzzySet <double, double> CreateContinuousSet(double left, double right, double step,
                                                                        double a, double b, double c)
        {
            ContinuousFuzzySet <double, double> set = null;

            switch (comboBox1.SelectedIndex)
            {
            case (int)FunctionTypes.SFunction:
                FuzzySetCreator <double, double> .MemberShipFunction3 Sfunc =
                    new FuzzySetCreator <double, double> .MemberShipFunction3(FuzzyHelper.SFunction);

                set = FuzzySetCreator <double, double> .CreateInstance(Sfunc, left, right, step, a, b);

                break;

            case (int)FunctionTypes.ZFunction:
                FuzzySetCreator <double, double> .MemberShipFunction3 Zfunc =
                    new FuzzySetCreator <double, double> .MemberShipFunction3(FuzzyHelper.ZFunction);

                set = FuzzySetCreator <double, double> .CreateInstance(Zfunc, left, right, step, a, b);

                break;

            case (int)FunctionTypes.PFunction:
                FuzzySetCreator <double, double> .MemberShipFunction4 Pfunc =
                    new FuzzySetCreator <double, double> .MemberShipFunction4(FuzzyHelper.PFunction);

                set = FuzzySetCreator <double, double> .CreateInstance(Pfunc, left, right, step, a, b, c);

                break;

            case (int)FunctionTypes.Custom:
                List <KeyValuePair <double, double> > DataList = CreateContiniousSet(left, right, step,
                                                                                     textBox4);
                set = FuzzySetCreator <double, double> .CreateInstance(DataList);

                break;
            }
            return(set);
        }
示例#2
0
        private DiscreteFuzzyStringSet CreateDiscreteStringSet(double a, double b, double c, string[] src)
        {
            DiscreteFuzzyStringSet set = null;

            switch (comboBox1.SelectedIndex)
            {
            case (int)FunctionTypes.SFunction:
                FuzzySetCreator <double, double> .MemberShipFunction3 Sfunc =
                    new FuzzySetCreator <double, double> .MemberShipFunction3(FuzzyHelper.SFunction);

                set = FuzzySetCreator <double, double> .CreateInstance(Sfunc, a, b, src);

                break;

            case (int)FunctionTypes.ZFunction:
                FuzzySetCreator <double, double> .MemberShipFunction3 Zfunc =
                    new FuzzySetCreator <double, double> .MemberShipFunction3(FuzzyHelper.ZFunction);

                set = FuzzySetCreator <double, double> .CreateInstance(Zfunc, a, b, src);

                break;

            case (int)FunctionTypes.PFunction:
                FuzzySetCreator <double, double> .MemberShipFunction4 Pfunc =
                    new FuzzySetCreator <double, double> .MemberShipFunction4(FuzzyHelper.PFunction);

                set = FuzzySetCreator <double, double> .CreateInstance(Pfunc, a, b, c, src);

                break;

            case (int)FunctionTypes.Custom:
                List <KeyValuePair <string, double> > list = ReadFromText(textBox4);
                set = FuzzySetCreator <string, double> .CreateInstance(list);

                break;
            }
            return(set);
        }