MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / test_load_between_multiple_dimensions

Function test_load_between_multiple_dimensions

tests/search/test_Route.py:682–699  ·  view source on GitHub ↗

Tests that the load_between() method correctly calculates the load for multiple dimensions.

(frm, to, dim, expected)

Source from the content-addressed store, hash-verified

680 ],
681)
682def test_load_between_multiple_dimensions(frm, to, dim, expected):
683 """
684 Tests that the load_between() method correctly calculates the load for
685 multiple dimensions.
686 """
687 data = ProblemData(
688 clients=[
689 Client(1, 0, delivery=[1, 2]),
690 Client(2, 0, delivery=[4, 5]),
691 ],
692 depots=[Depot(0, 0)],
693 vehicle_types=[VehicleType(1, capacity=[10, 10])],
694 distance_matrices=[np.zeros((3, 3), dtype=int)],
695 duration_matrices=[np.zeros((3, 3), dtype=int)],
696 )
697
698 route = make_search_route(data, [1, 2])
699 assert_equal(route.load_between(frm, to, dimension=dim).load(), expected)
700
701
702def test_load_between_equal_to_before_after_when_one_is_depot_different_dims(

Callers

nothing calls this directly

Calls 6

ProblemDataClass · 0.90
ClientClass · 0.90
DepotClass · 0.90
VehicleTypeClass · 0.90
make_search_routeFunction · 0.90
loadMethod · 0.45

Tested by

no test coverage detected