Inheritance: ComparerTests.TestCaseStructure
Exemple #1
0
 public void Setup()
 {
     this.entityModel = new EntityModel <Customer>();
     this.domain      = new SimpleDomain();
     this.repository  = new Repository <Customer>(this.entityModel, this.domain.Customers);
     this.context     = new Context();
 }
        public override void Setup()
        {
            base.Setup();

            this.objA = SimpleDomain.CreateObjectWithValueSet1();
            this.objB = SimpleDomain.CreateObjectWithValueSet1();
        }
Exemple #3
0
        private static void Main(string[] args)
        {
            SimpleDomain sd = new SimpleDomain(-4, 5);

            PrintDomain(sd, "sd: ");

            IDomain cd = IDomain.Combine(sd, sd);

            PrintDomain(cd, "cd: ");

            IDomain   d    = IDomain.IntRange(0, 11);
            IFuzzySet set1 = new MutableFuzzySet(d).Set(DomainElement.Of(0), 1.0);

            PrintFuzzySet(set1, "set1: ");

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

            PrintFuzzySet(set2, "set2: ");


            IDomain d7 = IDomain.IntRange(0, 11);

            IFuzzySet set3 = new MutableFuzzySet(d7).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);

            PrintFuzzySet(set3, "set3: ");

            IFuzzySet notSet3 = Operations.UnaryOperation(set3, Operations.ZadehNot());

            PrintFuzzySet(notSet3, "notSet3: ");

            IFuzzySet union = Operations.BinaryOperation(set3, notSet3, Operations.ZadehOr());

            PrintFuzzySet(union, "Set3 U notSet3: ");

            IFuzzySet hinters = Operations.BinaryOperation(set3, notSet3, Operations.HamacherTNorm(1.0));

            PrintFuzzySet(hinters, "Set3 Intersection with notSet3 using parameterised Hamacher T norm with parameter 1.0: ");
        }
Exemple #4
0
        private static void PrintExample1()
        {
            Console.WriteLine("EXAMPLE 1");
            SimpleDomain d1 = new SimpleDomain(0, 5);

            PrintDomain(d1, "sd: ");

            SimpleDomain d2 = new SimpleDomain(0, 3);

            PrintDomain(d2, "sd: ");

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

            PrintDomain(d3, "cd: ");

            Console.WriteLine($"({d3.ElementForIndex(0)})");
            Console.WriteLine($"({d3.ElementForIndex(5)})");
            Console.WriteLine($"({d3.ElementForIndex(13)})");
            Console.WriteLine(d3.IndexOfElement(DomainElement.Of(4, 1)));
            Console.WriteLine("---------------------------------------");
            Console.WriteLine();
        }