public void SandZ_Fuzzify_Success(Double a, Double b, Double inputValue, Double expectedResult) { //Arrange var SmembershipFunction = new SShapedMembershipFunction("test", a, b); var ZmembershipFunction = new ZShapedMembershipFunction("test", a, b); //Act var resultS = SmembershipFunction.Fuzzify(inputValue); var resultZ = ZmembershipFunction.Fuzzify(inputValue); //Assert Assert.That(Math.Round(resultS, 4), Is.EqualTo(expectedResult)); Assert.That(Math.Round(resultZ, 4), Is.EqualTo(1 - expectedResult)); }
public void SandZ_Max_Success() { //Arrange var SmembershipFunction = new SShapedMembershipFunction("test", 50, 20); var ZmembershipFunction = new ZShapedMembershipFunction("test", 50, 20); //Act var resultS = SmembershipFunction.Max(); var resultZ = ZmembershipFunction.Max(); //Assert Assert.That(resultS, Is.EqualTo(100)); Assert.That(resultZ, Is.EqualTo(100)); }
public void CoG_Defuzzify_ZShaped() { var memFunc = new ZShapedMembershipFunction("mf", 50, 10); CoG_Defuzzify(memFunc, 25); }