public void T6RuleApply() { testRule = LinguisticRule.fromJson(TestJsonRule); MFSetup(); testRule.Apply(TestLingVars); Debug.Log("[Rule Application Test Resut] : " + testRule.membershipValue.fuzzy); }
public void T7Implication() { testRule = LinguisticRule.fromJson(TestJsonRule); MFSetup(); testRule.Apply(TestLingVars); Debug.Log("[Implication Result at Index " + testNVal + "] : " + testRule.Implication(testNVal, testMF)); }
public void T3ParseJson() { testRule = LinguisticRule.fromJson(TestJsonRule); Assert.AreEqual( TestOperator, testRule.fOperator); Assert.AreEqual( TestImplication, testRule.implicationM); Assert.AreEqual( testActualRule, testRule.rule); Debug.Log("[Test Rule]\n" + testRule.encodeLinguisticJson().Print(true)); }
public void T8Implicate() { testRule = LinguisticRule.fromJson(TestJsonRule); MFSetup(); testRule.Apply(TestLingVars); testRule.Implicate(testMF, 1); string LogMsg = "[Implicate Test Result]\n"; for (int i = 0; i < testRule.implData.data.Count; i++) { LogMsg += "Index " + (testRule.implData.StartAxis + testRule.implData.spacing * i) + " -> " + testRule.implData.data[i] + "\n"; } Debug.Log(LogMsg); }
public void T4LinguisticEncode() { testRule = LinguisticRule.fromJson(TestJsonRule); Assert.AreEqual( testRuleValue, testRule.encodeLinguisticJson().GetField("Value").str ); Assert.AreEqual( TestImplication, FuzzyImplication.TryParse( testRule.encodeLinguisticJson(). GetField("Implication").str) ); Assert.AreEqual( FuzzyOperator.nameOf(TestOperator), testRule.encodeLinguisticJson(). GetField("Operator").str ); Assert.AreEqual( testActualRule, testRule.encodeLinguisticJson().GetField("Rule").str ); }
public void T5NumericRule() { testRule = LinguisticRule.fromJson(TestJsonRule); MFSetup(); Debug.Log("[Numeric Rule Test Result] = " + testRule.numericRule(TestLingVars)); }