public void IntersectionfFuzzySets() { TriangularFunction func1 = new TriangularFunction(1.0, 2.0); TrapezoidalFunction func2 = new TrapezoidalFunction(1.0, 2.0, 1.8, 1.5); FuzzySet set1 = new FuzzySet(func1); FuzzySet set2 = new FuzzySet(func2); Assert.AreEqual(set1.Intersection(set2, 1.0), 0); }
internal void Intersection_VariousInputs_ReturnsExpectedResult(double input, double expected) { // Arrange var function1 = TriangularFunction.Create(1, 3, 5); var function2 = TriangularFunction.Create(2, 4, 6, 0, 0.75); var fuzzySet1 = new FuzzySet("some_fuzzy_state1", function1); var fuzzySet2 = new FuzzySet("some_fuzzy_state2", function2); // Act var result = fuzzySet1.Intersection(fuzzySet2, input); // Assert Assert.Equal(UnitInterval.Create(expected), result); }