Пример #1
0
def test_lambda_cut_boundaries():
    x = np.arange(10)
    mfx = fuzz.trapmf(x, [0, 6, 7, 10])

    assert_allclose(fuzz.lambda_cut_boundaries(x, mfx, 0.2), np.r_[1.2])

    x = np.arange(11)
    mfx = fuzz.trapmf(x, [0, 6, 7, 10])
    assert_allclose(fuzz.lambda_cut_boundaries(x, mfx, 0.2), np.r_[1.2, 9.4])
Пример #2
0
def test_lambda_cut_boundaries():
    x = np.arange(10)
    mfx = fuzz.trapmf(x, [0, 6, 7, 10])

    assert_allclose(fuzz.lambda_cut_boundaries(x, mfx, 0.2), np.r_[1.2])

    x = np.arange(11)
    mfx = fuzz.trapmf(x, [0, 6, 7, 10])
    assert_allclose(fuzz.lambda_cut_boundaries(x, mfx, 0.2), np.r_[1.2, 9.4])
Пример #3
0
def test_lambda_cut_boundaries_degenerate():
    x = np.arange(11)
    mfx = fuzz.trimf(x, [0, 7, 10])
    assert_allclose(fuzz.lambda_cut_boundaries(x, mfx, 1), np.r_[7])
Пример #4
0
def test_lambda_cut_boundaries_degenerate():
    x = np.arange(11)
    mfx = fuzz.trimf(x, [0, 7, 10])
    assert_allclose(fuzz.lambda_cut_boundaries(x, mfx, 1), np.r_[7])