def test_fuzzy_min():
    x = np.r_[0:8]
    A = np.r_[0, .3, .6, .8, 1, .7, .2, 0]
    B = np.r_[0,  1, .9, .5, .2, .1, 0, 0]

    testu_, test_mf = fuzzy_min(x, A, x, B)

    expected_u = np.r_[0., 1., 2., 3., 4., 5., 6., 7.]
    expected_mf = np.r_[0., 1., 0.9, 0.5, 0.2, 0.1, 0., 0.]
    assert_allclose(testu_, expected_u)
    assert_allclose(test_mf, expected_mf)
예제 #2
0
def test_fuzzy_min():
    x = np.r_[0:8]
    A = np.r_[0, .3, .6, .8, 1, .7, .2, 0]
    B = np.r_[0, 1, .9, .5, .2, .1, 0, 0]

    testu_, test_mf = fuzzy_min(x, A, x, B)

    expected_u = np.r_[0., 1., 2., 3., 4., 5., 6., 7.]
    expected_mf = np.r_[0., 1., 0.9, 0.5, 0.2, 0.1, 0., 0.]
    assert_allclose(testu_, expected_u)
    assert_allclose(test_mf, expected_mf)