예제 #1
0
        public void ToStringTest()
        {
            var numVariable = new NumericVariable("MyVariable");

            var sut = new NumericValue(numVariable, 42);

            Assert.AreEqual(numVariable.Identifier + " = 42", sut.ToString());
        }
예제 #2
0
        public void Constructor()
        {
            var numVariable = new NumericVariable("MyVariable");

            var sut = new NumericValue(numVariable, 42);

            Assert.AreEqual(numVariable, sut.Variable);
            Assert.AreEqual(42, sut.Value);
        }
예제 #3
0
 private static Dictionary<FuzzyTerm, double> getMembershipValuesThatAreGreaterZero(FuzzyVariable fuzzyVariable, NumericValue value)
 {
     var values = new Dictionary<FuzzyTerm, double>();
     foreach (var term in fuzzyVariable.FuzzyTerms)
     {
         var membershipValue = term.MembershipFunction.Apply(value.Value);
         if (membershipValue > 0)
         {
             values.Add(term, membershipValue);
         }
     }
     return values;
 }
예제 #4
0
 private Scope fuzzify(NumericValue[] input)
 {
     var values = _fuzzifier.Apply(input);
     return new Scope(values);
 }