Ejemplo n.º 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)])
Ejemplo n.º 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)])
Ejemplo n.º 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)])
Ejemplo n.º 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)])