Exemplo n.º 1
0
        static void Primjer13()
        {
            IDomain   d    = Domain.IntRange(0, 11);
            IFuzzySet set1 = new MutableFuzzySet(d)
                             .Set(DomainElement.Of(0), 1.0)
                             .Set(DomainElement.Of(1), 0.8)
                             .Set(DomainElement.Of(2), 0.6)
                             .Set(DomainElement.Of(3), 0.4)
                             .Set(DomainElement.Of(4), 0.2);

            Debug1.Print(set1, "Set1:");

            IFuzzySet notSet1 = Operations.Operations.UnaryOperation(
                set1, Operations.Operations.ZadehNot());

            Debug1.Print(notSet1, "notSet1:");



            IFuzzySet union = Operations.Operations.BinaryOperation(
                set1, notSet1, Operations.Operations.ZadehOr());

            Debug1.Print(union, "Set1 union notSet1:");

            IFuzzySet hinters = Operations.Operations.BinaryOperation(
                set1, notSet1, Operations.Operations.HamacherTNorm(1.0));

            Debug1.Print(hinters, "Set1 intersection with notSet1 using parameterised Hamacher T norm with parameter 1.0:");

            IFuzzySet presjek = Operations.Operations.BinaryOperation(set1, notSet1, Operations.Operations.ZadehAnd());

            Debug1.Print(presjek, "Set1 presjek notSet1:");
        }
Exemplo n.º 2
0
        static void Primjer12()
        {
            IDomain d = Domain.IntRange(0, 11); // {0,1,...,10}
            //Debug1.Print(d, "Elementi domene d1:");

            IFuzzySet set1 = new MutableFuzzySet(d)
                             .Set(DomainElement.Of(0), 1.0)
                             .Set(DomainElement.Of(1), 0.8)
                             .Set(DomainElement.Of(2), 0.6)
                             .Set(DomainElement.Of(3), 0.4)
                             .Set(DomainElement.Of(4), 0.2);

            Debug1.Print(set1, "Set1:");

            IDomain   d2   = Domain.IntRange(-5, 6); // {-5,-4,...,4,5}
            IFuzzySet set2 = new CalculatedFuzzySet(
                d2,
                StandardFuzzySets.LambdaFunction(
                    d2.IndexOfElement(DomainElement.Of(-4)),
                    d2.IndexOfElement(DomainElement.Of(0)),
                    d2.IndexOfElement(DomainElement.Of(4))
                    )
                );

            Debug1.Print(set2, "Set2:");
        }
Exemplo n.º 3
0
        public static void Test33()
        {
            double[] antecMembershipFunctions = new double[] {
                0.8, 0.8, 0.7, 1, 0.7, 0.9
            };

            double minMembershipFunc = antecMembershipFunctions.Min();

            IDomain u = Domain.IntRange(-5, 6);

            IFuzzySet _conseq = new CalculatedFuzzySet(
                u,
                StandardFuzzySets.LambdaFunction(
                    u.IndexOfElement(DomainElement.Of(-5)),
                    u.IndexOfElement(DomainElement.Of(-3)),
                    u.IndexOfElement(DomainElement.Of(0))
                    )
                );

            Debug1.Print(_conseq, "Konsekv1:");


            IFuzzySet antecedents = new CalculatedFuzzySet(                                     //mjere pripadnosti su na minimumu mj.pripadnosti antecedenata
                _conseq.GetDomain(),
                StandardFuzzySets.UniversalFunction(minMembershipFunc)
                );

            IFuzzySet conclusion = Operations.Operations.BinaryOperation(antecedents, _conseq, Operations.Operations.ZadehAnd());

            Debug1.Print(conclusion, "Zakljucak1:");
        }
Exemplo n.º 4
0
        public static void Test32()
        {
            IDomain u  = Domain.IntRange(-5, 6); // {-5,-4,...,4,5}
            IDomain u2 = Domain.Combine(u, u);

            IFuzzySet set = new CalculatedFuzzySet(
                u2,
                StandardFuzzySets.LambdaFunction(
                    u2.IndexOfElement(DomainElement.Of(-4, 2)),
                    u2.IndexOfElement(DomainElement.Of(0, 0)),
                    u2.IndexOfElement(DomainElement.Of(4, 2))
                    )
                );

            Debug1.Print(set, "Set cf:");

            IFuzzySet notSet1 = Operations.Operations.UnaryOperation(
                set, Operations.Operations.ZadehNot());

            Debug1.Print(notSet1, "notSet1:");



            IFuzzySet union = Operations.Operations.BinaryOperation(
                set, notSet1, Operations.Operations.ZadehOr());

            Debug1.Print(union, "Set1 union notSet1:");
        }
Exemplo n.º 5
0
        public static void Test31()
        {
            IDomain u  = Domain.IntRange(-5, 6); // {-5,-4,...,4,5}
            IDomain u2 = Domain.Combine(u, u);

            IFuzzySet set = new CalculatedFuzzySet(
                u2,
                StandardFuzzySets.LambdaFunction(
                    u2.IndexOfElement(DomainElement.Of(-4, 2)),
                    u2.IndexOfElement(DomainElement.Of(0, 0)),
                    u2.IndexOfElement(DomainElement.Of(4, 2))
                    )
                );

            Debug1.Print(set, "Set cf:");
        }
Exemplo n.º 6
0
        static void Primjer11()
        {
            Console.WriteLine("Hi");
            IDomain d1 = Domain.IntRange(0, 5);

            Debug1.Print(d1, "Elementi domene d1:");

            IDomain d2 = Domain.IntRange(0, 3);

            Debug1.Print(d2, "Elementi domene d2:");

            IDomain d3 = Domain.Combine(d1, d2);

            Debug1.Print(d3, "Elementi domene d3:");

            //IDomain d4 = Domain.Combine(d1, d3);
            //Debug1.Print(d4, "Elementi domene d4:");

            Console.WriteLine(d3.ElementForIndex(0));
            Console.WriteLine(d3.ElementForIndex(5));
            Console.WriteLine(d3.ElementForIndex(14));
            Console.WriteLine(d3.IndexOfElement(DomainElement.Of(4, 1)));
        }