コード例 #1
0
ファイル: test_defuzz.py プロジェクト: SankaW/teamfx
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
ファイル: test_defuzz.py プロジェクト: SankaW/teamfx
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])