public void should_correctly_calculate_logistic_curve_value(float slope, float xShift, float yShift, float verticalSize, float inputValue, float expectedValue) { var curve = new LogisticCurveFunction(slope, xShift, yShift, verticalSize); var actualValue = curve.Plot(inputValue); Assert.Equal(expectedValue.ToString("F"), actualValue.ToString("F")); }
public static LogisticCurveFunction Alter(this LogisticCurveFunction curve, float?slope = null, float?xShift = null, float?yShift = null, float?verticalSize = null) { return(new LogisticCurveFunction( slope.HasValue ? slope.Value : curve.Slope, xShift.HasValue ? xShift.Value : curve.XShift, yShift.HasValue ? yShift.Value : curve.YShift, verticalSize.HasValue ? verticalSize.Value : curve.VerticalSize )); }