public IFuzzy ApplyRule(float x) { // Get the membership of input float firingLevel = input.GetTerm(inputProperty).Membership(x); // Copy the second rule base so that changing the linguistic base won't affect this result IFuzzy outCopy = (IFuzzy)output.GetTerm(outputProperty).Clone(); // Return a delegate that clamps that value return(new DelegateFuzzy((y) => Mathf.Min(outCopy.Membership(y), firingLevel), outCopy.close_left, outCopy.close_right // Bounds are same as outputProperty )); }