コード例 #1
0
ファイル: Program.cs プロジェクト: mateher624/SparkFuzzySQL
        static FuzzyVariable DefineTemperatureVariable()
        {
            var temperature = new FuzzyVariable("temperature");

            temperature.AddTerm(new FuzzyTerm("freezing", new TriangularMembershipFunction(5.0, 10.0, 15.0)));
            temperature.AddTerm(new FuzzyTerm("cold", new TriangularMembershipFunction(10.0, 15.0, 20.0)));
            temperature.AddTerm(new FuzzyTerm("chilly", new TriangularMembershipFunction(15.0, 20.0, 25.0)));
            temperature.AddTerm(new FuzzyTerm("warm", new TriangularMembershipFunction(20.0, 25.0, 30.0)));
            temperature.AddTerm(new FuzzyTerm("hot", new TriangularMembershipFunction(25.0, 30.0, 35.0)));
            return(temperature);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: mateher624/SparkFuzzySQL
        static FuzzyVariable DefineAgeVariable()
        {
            var age = new FuzzyVariable("age");

            age.AddTerm(new FuzzyTerm("child", new TrapezoidMembershipFunction(0.0, 0.0, 10.0, 14.0)));
            age.AddTerm(new FuzzyTerm("adolescent", new TrapezoidMembershipFunction(10.0, 13.0, 17.0, 20.0)));
            age.AddTerm(new FuzzyTerm("adult", new TrapezoidMembershipFunction(17.0, 21.0, 36.0, 40.0)));
            age.AddTerm(new FuzzyTerm("middle-aged", new TrapezoidMembershipFunction(36.0, 40.0, 48.0, 52.0)));
            age.AddTerm(new FuzzyTerm("aged", new TrapezoidMembershipFunction(48.0, 60.0, 80.0, 80.0)));
            return(age);
        }