Пример #1
0
def test_route():
    return_path, cost = mcp.route_through_array(a, (1, 6), (7, 2),
                                                geometric=True)
    assert_almost_equal(cost, np.sqrt(2) / 2)
    assert_array_equal(return_path, [(1, 6), (1, 5), (1, 4), (1, 3), (1, 2),
                                     (2, 1), (3, 1), (4, 1), (5, 1), (6, 1),
                                     (7, 2)])
Пример #2
0
def test_route():
    with expected_warnings(['Upgrading NumPy' + warning_optional]):
        return_path, cost = mcp.route_through_array(a, (1, 6), (7, 2),
                                                    geometric=True)
    assert_almost_equal(cost, np.sqrt(2) / 2)
    assert_array_equal(return_path, [(1, 6), (1, 5), (1, 4), (1, 3), (1, 2),
                                     (2, 1), (3, 1), (4, 1), (5, 1), (6, 1),
                                     (7, 2)])
Пример #3
0
def test_route():
    return_path, cost = mcp.route_through_array(a, (1,6), (7,2), geometric=True)
    assert_almost_equal(cost, np.sqrt(2)/2)
    assert_array_equal(return_path,
                       [(1, 6),
                        (1, 5),
                        (1, 4),
                        (1, 3),
                        (1, 2),
                        (2, 1),
                        (3, 1),
                        (4, 1),
                        (5, 1),
                        (6, 1),
                        (7, 2)])
Пример #4
0
def test_route():
    with expected_warnings(['Upgrading NumPy' + warning_optional]):
        return_path, cost = mcp.route_through_array(a, (1, 6), (7, 2),
                                                    geometric=True)
    assert_almost_equal(cost, np.sqrt(2) / 2)
    assert_array_equal(return_path,
                       [(1, 6),
                        (1, 5),
                        (1, 4),
                        (1, 3),
                        (1, 2),
                        (2, 1),
                        (3, 1),
                        (4, 1),
                        (5, 1),
                        (6, 1),
                        (7, 2)])