public void ToStringTest() { var numVariable = new NumericVariable("MyVariable"); var sut = new NumericValue(numVariable, 42); Assert.AreEqual(numVariable.Identifier + " = 42", sut.ToString()); }
public void Constructor() { var numVariable = new NumericVariable("MyVariable"); var sut = new NumericValue(numVariable, 42); Assert.AreEqual(numVariable, sut.Variable); Assert.AreEqual(42, sut.Value); }
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; }
private Scope fuzzify(NumericValue[] input) { var values = _fuzzifier.Apply(input); return new Scope(values); }